1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-13 05:43:37 -04:00

[globhist] cast

This commit is contained in:
Witold Filipczyk 2022-01-24 21:07:08 +01:00
parent 0029ed4c54
commit abe32780ab
2 changed files with 10 additions and 10 deletions

View File

@ -44,7 +44,7 @@ is_globhist_item_used(struct listbox_item *item)
static char *
get_globhist_item_text(struct listbox_item *box_item, struct terminal *term)
{
struct global_history_item *item = box_item->udata;
struct global_history_item *item = (struct global_history_item *)box_item->udata;
struct string info;
if (get_opt_int("document.history.global.display_type", NULL)
@ -59,7 +59,7 @@ get_globhist_item_text(struct listbox_item *box_item, struct terminal *term)
static char *
get_globhist_item_info(struct listbox_item *box_item, struct terminal *term)
{
struct global_history_item *item = box_item->udata;
struct global_history_item *item = (struct global_history_item *)box_item->udata;
struct string info;
if (box_item->type == BI_FOLDER) return NULL;
@ -82,7 +82,7 @@ get_globhist_item_root(struct listbox_item *box_item)
static struct uri *
get_globhist_item_uri(struct listbox_item *item)
{
struct global_history_item *historyitem = item->udata;
struct global_history_item *historyitem = (struct global_history_item *)item->udata;
return get_uri(historyitem->url, URI_NONE);
}
@ -96,7 +96,7 @@ can_delete_globhist_item(struct listbox_item *item)
static void
delete_globhist_item(struct listbox_item *item, int last)
{
struct global_history_item *historyitem = item->udata;
struct global_history_item *historyitem = (struct global_history_item *)item->udata;
assert(!is_object_used(historyitem));
@ -150,11 +150,11 @@ static const struct listbox_ops gh_listbox_ops = {
static void
history_search_do(void *data)
{
struct dialog *dlg = data;
struct listbox_item *item = globhist_browser.root.child.next;
struct dialog *dlg = (struct dialog *)data;
struct listbox_item *item = (struct listbox_item *)globhist_browser.root.child.next;
struct listbox_data *box;
if (!globhist_simple_search(dlg->widgets[1].data, dlg->widgets[0].data)) return;
if (!globhist_simple_search((char *)dlg->widgets[1].data, (char *)dlg->widgets[0].data)) return;
if (list_empty(globhist_browser.root.child)) return;
/* Shouldn't we rather do this only for the specific listbox_data box
@ -211,7 +211,7 @@ push_bookmark_button(struct dialog_data *dlg_data,
if (!box->sel) return EVENT_PROCESSED;
historyitem = box->sel->udata;
historyitem = (struct global_history_item *)box->sel->udata;
if (!historyitem) return EVENT_PROCESSED;
launch_bm_add_dialog(term, NULL, NULL,

View File

@ -225,7 +225,7 @@ cap_global_history(int max_globhist_items)
while (global_history.size >= max_globhist_items) {
struct global_history_item *history_item;
history_item = global_history.entries.prev;
history_item = (struct global_history_item *)global_history.entries.prev;
if ((void *) history_item == &global_history.entries) {
INTERNAL("global history is empty");
@ -410,7 +410,7 @@ free_global_history(void)
}
while (!list_empty(global_history.entries))
delete_global_history_item(global_history.entries.next);
delete_global_history_item((struct global_history_item *)global_history.entries.next);
reap_deleted_globhist_items();
}