mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[cache] cast
This commit is contained in:
parent
e4550c1562
commit
86a40432e0
4
src/cache/cache.c
vendored
4
src/cache/cache.c
vendored
@ -485,7 +485,7 @@ get_cache_fragment(struct cache_entry *cached)
|
|||||||
if (list_empty(cached->frag))
|
if (list_empty(cached->frag))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
first_frag = cached->frag.next;
|
first_frag = (struct fragment *)cached->frag.next;
|
||||||
if (first_frag->offset)
|
if (first_frag->offset)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -637,7 +637,7 @@ delete_entry_content(struct cache_entry *cached)
|
|||||||
enlarge_entry(cached, -cached->data_size);
|
enlarge_entry(cached, -cached->data_size);
|
||||||
|
|
||||||
while (cached->frag.next != (void *) &cached->frag) {
|
while (cached->frag.next != (void *) &cached->frag) {
|
||||||
struct fragment *f = cached->frag.next;
|
struct fragment *f = (struct fragment *)cached->frag.next;
|
||||||
|
|
||||||
del_from_list(f);
|
del_from_list(f);
|
||||||
frag_free(f);
|
frag_free(f);
|
||||||
|
14
src/cache/dialogs.c
vendored
14
src/cache/dialogs.c
vendored
@ -48,7 +48,7 @@ is_cache_entry_used(struct listbox_item *item)
|
|||||||
static char *
|
static char *
|
||||||
get_cache_entry_text(struct listbox_item *item, struct terminal *term)
|
get_cache_entry_text(struct listbox_item *item, struct terminal *term)
|
||||||
{
|
{
|
||||||
struct cache_entry *cached = item->udata;
|
struct cache_entry *cached = (struct cache_entry *)item->udata;
|
||||||
|
|
||||||
return get_uri_string(cached->uri, URI_PUBLIC);
|
return get_uri_string(cached->uri, URI_PUBLIC);
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ get_cache_entry_text(struct listbox_item *item, struct terminal *term)
|
|||||||
static char *
|
static char *
|
||||||
get_cache_entry_info(struct listbox_item *item, struct terminal *term)
|
get_cache_entry_info(struct listbox_item *item, struct terminal *term)
|
||||||
{
|
{
|
||||||
struct cache_entry *cached = item->udata;
|
struct cache_entry *cached = (struct cache_entry *)item->udata;
|
||||||
struct string msg;
|
struct string msg;
|
||||||
|
|
||||||
if (item->type == BI_FOLDER) return NULL;
|
if (item->type == BI_FOLDER) return NULL;
|
||||||
@ -160,7 +160,7 @@ get_cache_entry_info(struct listbox_item *item, struct terminal *term)
|
|||||||
static struct uri *
|
static struct uri *
|
||||||
get_cache_entry_uri(struct listbox_item *item)
|
get_cache_entry_uri(struct listbox_item *item)
|
||||||
{
|
{
|
||||||
struct cache_entry *cached = item->udata;
|
struct cache_entry *cached = (struct cache_entry *)item->udata;
|
||||||
|
|
||||||
return get_uri_reference(cached->uri);
|
return get_uri_reference(cached->uri);
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ can_delete_cache_entry(struct listbox_item *item)
|
|||||||
static void
|
static void
|
||||||
delete_cache_entry_item(struct listbox_item *item, int last)
|
delete_cache_entry_item(struct listbox_item *item, int last)
|
||||||
{
|
{
|
||||||
struct cache_entry *cached = item->udata;
|
struct cache_entry *cached = (struct cache_entry *)item->udata;
|
||||||
|
|
||||||
assert(!is_object_used(cached));
|
assert(!is_object_used(cached));
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ static enum listbox_match
|
|||||||
match_cache_entry(struct listbox_item *item, struct terminal *term,
|
match_cache_entry(struct listbox_item *item, struct terminal *term,
|
||||||
char *text)
|
char *text)
|
||||||
{
|
{
|
||||||
struct cache_entry *cached = item->udata;
|
struct cache_entry *cached = (struct cache_entry *)item->udata;
|
||||||
|
|
||||||
if (c_strcasestr((const char *)struri(cached->uri), (const char *)text)
|
if (c_strcasestr((const char *)struri(cached->uri), (const char *)text)
|
||||||
|| (cached->head && c_strcasestr((const char *)cached->head, (const char *)text)))
|
|| (cached->head && c_strcasestr((const char *)cached->head, (const char *)text)))
|
||||||
@ -204,7 +204,7 @@ static enum listbox_match
|
|||||||
match_cache_entry_contents(struct listbox_item *item, struct terminal *term,
|
match_cache_entry_contents(struct listbox_item *item, struct terminal *term,
|
||||||
char *text)
|
char *text)
|
||||||
{
|
{
|
||||||
struct cache_entry *cached = item->udata;
|
struct cache_entry *cached = (struct cache_entry *)item->udata;
|
||||||
struct fragment *fragment = get_cache_fragment(cached);
|
struct fragment *fragment = get_cache_fragment(cached);
|
||||||
|
|
||||||
if (fragment && strlcasestr(fragment->data, fragment->length, text, -1))
|
if (fragment && strlcasestr(fragment->data, fragment->length, text, -1))
|
||||||
@ -297,7 +297,7 @@ push_invalidate_button(struct dialog_data *dlg_data, struct widget_data *button)
|
|||||||
{
|
{
|
||||||
struct terminal *term = dlg_data->win->term;
|
struct terminal *term = dlg_data->win->term;
|
||||||
struct listbox_data *box = get_dlg_listbox_data(dlg_data);
|
struct listbox_data *box = get_dlg_listbox_data(dlg_data);
|
||||||
struct cache_entry *cached = box->sel->udata;
|
struct cache_entry *cached = (struct cache_entry *)box->sel->udata;
|
||||||
|
|
||||||
if (!box->sel || !box->sel->udata) return EVENT_PROCESSED;
|
if (!box->sel || !box->sel->udata) return EVENT_PROCESSED;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user