mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Cast variadic arguments of getml to void *.
getml reads the args with va_arg(ap, void *), and the NULL macro in particular may have the wrong type.
This commit is contained in:
parent
2a15cd69f2
commit
a05f7203cd
@ -335,7 +335,7 @@ hierbox_browser(struct hierbox_browser *browser, struct session *ses)
|
||||
* have to subtract one. */
|
||||
add_dlg_end(dlg, button + 2 - (anonymous ? anonymous - 1 : 0));
|
||||
|
||||
return do_dialog(term, dlg, getml(dlg, NULL));
|
||||
return do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
}
|
||||
|
||||
|
||||
@ -434,7 +434,7 @@ push_hierbox_info_button(struct dialog_data *dlg_data, struct widget_data *butto
|
||||
|
||||
box->ops->lock(item);
|
||||
|
||||
msg_box(term, getml(context, NULL), MSGBOX_FREE_TEXT /* | MSGBOX_SCROLLABLE */,
|
||||
msg_box(term, getml(context, (void *) NULL), MSGBOX_FREE_TEXT /* | MSGBOX_SCROLLABLE */,
|
||||
N_("Info"), ALIGN_LEFT,
|
||||
msg,
|
||||
context, 1,
|
||||
@ -747,7 +747,7 @@ query_delete_selected_item(void *context_)
|
||||
|
||||
if (item->type == BI_FOLDER) {
|
||||
ops->lock(item);
|
||||
msg_box(term, getml(context, NULL), MSGBOX_FREE_TEXT,
|
||||
msg_box(term, getml(context, (void *) NULL), MSGBOX_FREE_TEXT,
|
||||
listbox_message(delete_folder_title), ALIGN_CENTER,
|
||||
msg_text(term, listbox_message(delete_folder), text),
|
||||
context, 2,
|
||||
@ -758,7 +758,7 @@ query_delete_selected_item(void *context_)
|
||||
|
||||
ops->lock(item);
|
||||
|
||||
msg_box(term, getml(context, NULL), MSGBOX_FREE_TEXT,
|
||||
msg_box(term, getml(context, (void *) NULL), MSGBOX_FREE_TEXT,
|
||||
listbox_message(delete_item_title), ALIGN_LEFT,
|
||||
msg_text(term, listbox_message(delete_item),
|
||||
text, empty_string_or_(msg)),
|
||||
@ -807,7 +807,7 @@ push_hierbox_delete_button(struct dialog_data *dlg_data,
|
||||
return status;
|
||||
}
|
||||
|
||||
msg_box(term, getml(context, NULL), 0,
|
||||
msg_box(term, getml(context, (void *) NULL), 0,
|
||||
listbox_message(delete_marked_items_title), ALIGN_CENTER,
|
||||
listbox_message(delete_marked_items),
|
||||
context, 2,
|
||||
@ -869,7 +869,7 @@ push_hierbox_clear_button(struct dialog_data *dlg_data,
|
||||
return EVENT_PROCESSED;
|
||||
}
|
||||
|
||||
msg_box(term, getml(context, NULL), 0,
|
||||
msg_box(term, getml(context, (void *) NULL), 0,
|
||||
listbox_message(clear_all_items_title), ALIGN_CENTER,
|
||||
listbox_message(clear_all_items),
|
||||
context, 2,
|
||||
|
@ -908,5 +908,5 @@ input_field_line(struct session *ses, unsigned char *prompt, void *data,
|
||||
add_dlg_field_float2(dlg, prompt, 0, 0, NULL, INPUT_LINE_BUFFER_SIZE,
|
||||
buffer, history);
|
||||
|
||||
do_dialog(ses->tab->term, dlg, getml(dlg, NULL));
|
||||
do_dialog(ses->tab->term, dlg, getml(dlg, (void *) NULL));
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ build_edit_dialog(struct terminal *term, struct session *ses,
|
||||
|
||||
add_dlg_end(dlg, EDIT_WIDGETS_COUNT);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, name, desc, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) name, (void *) desc, (void *) NULL));
|
||||
#undef EDIT_WIDGETS_COUNT
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ invalid_option:
|
||||
ctx->option = option;
|
||||
ctx->widget_data = dlg_data->widgets_data;
|
||||
|
||||
input_dialog(term, getml(ctx, NULL), N_("Add option"), N_("Name"),
|
||||
input_dialog(term, getml(ctx, (void *) NULL), N_("Add option"), N_("Name"),
|
||||
ctx, NULL,
|
||||
MAX_STR_LEN, "", 0, 0, check_option_name,
|
||||
add_option_to_tree, NULL);
|
||||
@ -807,7 +807,7 @@ really_add_keybinding(void *data, unsigned char *keystroke)
|
||||
if (init_string(&canonical))
|
||||
add_keystroke_to_string(&canonical, &hop->kbd, 0);
|
||||
|
||||
msg_box(new_hop->term, getml(new_hop, NULL), MSGBOX_FREE_TEXT,
|
||||
msg_box(new_hop->term, getml(new_hop, (void *) NULL), MSGBOX_FREE_TEXT,
|
||||
N_("Keystroke already used"), ALIGN_CENTER,
|
||||
msg_text(new_hop->term, N_("The keystroke \"%s\" "
|
||||
"is currently used for \"%s\".\n"
|
||||
@ -886,7 +886,7 @@ push_kbdbind_add_button(struct dialog_data *dlg_data,
|
||||
get_action_name(hop->keymap_id, hop->action_id),
|
||||
get_keymap_name(hop->keymap_id));
|
||||
|
||||
input_dialog(term, getml(hop, text, NULL),
|
||||
input_dialog(term, getml(hop, (void *) text, (void *) NULL),
|
||||
N_("Add keybinding"), text,
|
||||
hop, NULL,
|
||||
MAX_STR_LEN, "", 0, 0, check_keystroke,
|
||||
|
@ -373,7 +373,7 @@ build_edit_dialog(struct terminal *term, struct cookie *cookie)
|
||||
|
||||
add_dlg_end(dlg, EDIT_WIDGETS_COUNT);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, dlg_server, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) dlg_server, (void *) NULL));
|
||||
#undef EDIT_WIDGETS_COUNT
|
||||
}
|
||||
|
||||
@ -469,7 +469,7 @@ push_add_server_button(struct dialog_data *dlg_data, struct widget_data *button)
|
||||
add_dlg_ok_button(dlg, _("~OK", term), B_ENTER, add_server_do, name);
|
||||
add_dlg_button(dlg, _("~Cancel", term), B_ESC, cancel_dialog, NULL);
|
||||
add_dlg_end(dlg, SERVER_WIDGETS_COUNT);
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
|
||||
return EVENT_PROCESSED;
|
||||
#undef SERVER_WIDGETS_COUNT
|
||||
|
@ -270,7 +270,7 @@ display_download(struct terminal *term, struct file_download *file_download,
|
||||
add_dlg_end(dlg, DOWNLOAD_WIDGETS_COUNT - !!file_download->external_handler);
|
||||
#endif
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@ do_edit_dialog(struct terminal *term, int intl, unsigned char *title,
|
||||
|
||||
add_dlg_end(dlg, EDIT_WIDGETS_COUNT);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
|
||||
#undef EDIT_WIDGETS_COUNT
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ menu_keys(struct terminal *term, void *d_, void *xxx)
|
||||
add_actions_to_string(&keys, action_ids, KEYMAP_MAIN, term);
|
||||
}
|
||||
|
||||
msg_box(term, getml(info, NULL), MSGBOX_FREE_TEXT | MSGBOX_SCROLLABLE,
|
||||
msg_box(term, getml(info, (void *) NULL), MSGBOX_FREE_TEXT | MSGBOX_SCROLLABLE,
|
||||
N_("Keys"), ALIGN_LEFT,
|
||||
keys.source,
|
||||
info, 2,
|
||||
|
@ -236,7 +236,7 @@ terminal_options(struct terminal *term, void *xxx, struct session *ses)
|
||||
|
||||
add_dlg_end(dlg, TERMOPT_WIDGETS_COUNT - anonymous);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NLS
|
||||
@ -315,5 +315,5 @@ resize_terminal_dialog(struct terminal *term)
|
||||
|
||||
add_dlg_end(dlg, RESIZE_WIDGETS_COUNT);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ menu_del_ext(struct terminal *term, void *fcp, void *xxx2)
|
||||
return;
|
||||
}
|
||||
|
||||
msg_box(term, getml(extension, NULL), MSGBOX_FREE_TEXT,
|
||||
msg_box(term, getml(extension, (void *) NULL), MSGBOX_FREE_TEXT,
|
||||
N_("Delete extension"), ALIGN_CENTER,
|
||||
msg_text(term, N_("Delete extension %s -> %s?"),
|
||||
extension, opt->value.string),
|
||||
@ -133,7 +133,7 @@ menu_add_ext(struct terminal *term, void *fcp, void *xxx2)
|
||||
|
||||
add_dlg_end(dlg, MIME_WIDGETS_COUNT);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ do_auth_dialog(struct session *ses, void *data)
|
||||
|
||||
add_dlg_end(dlg, AUTH_WIDGETS_COUNT);
|
||||
|
||||
dlg_data = do_dialog(term, dlg, getml(dlg, NULL));
|
||||
dlg_data = do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
/* When there's some username, but no password, automagically jump at
|
||||
* the password. */
|
||||
if (dlg_data && a->user[0] && !a->password[0])
|
||||
|
@ -814,7 +814,7 @@ bittorrent_query_callback(void *data, enum connection_state state,
|
||||
|
||||
add_dlg_end(dlg, widgets);
|
||||
|
||||
ml = getml(dlg, NULL);
|
||||
ml = getml(dlg, (void *) NULL);
|
||||
if (!ml) {
|
||||
/* XXX: Assume that the allocated @external_handler will be
|
||||
* freed when releasing the @type_query. */
|
||||
|
@ -392,7 +392,7 @@ l_edit_bookmark_dialog(LS)
|
||||
|
||||
add_dlg_end(dlg, L_EDIT_BMK_WIDGETS_COUNT);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
|
||||
lua_pushnumber(S, 1);
|
||||
return 1;
|
||||
@ -473,7 +473,7 @@ l_xdialog(LS)
|
||||
|
||||
add_dlg_end(dlg, nitems);
|
||||
|
||||
do_dialog(term, dlg, getml(dlg, NULL));
|
||||
do_dialog(term, dlg, getml(dlg, (void *) NULL));
|
||||
|
||||
lua_pushnumber(S, 1);
|
||||
return 1;
|
||||
|
@ -78,7 +78,7 @@ python_info_box(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
title = stracpy(title);
|
||||
if (!title) goto free_text;
|
||||
|
||||
(void) msg_box(python_ses->tab->term, getml(title, NULL),
|
||||
(void) msg_box(python_ses->tab->term, getml(title, (void *) NULL),
|
||||
MSGBOX_NO_INTL | MSGBOX_SCROLLABLE | MSGBOX_FREE_TEXT,
|
||||
title, ALIGN_LEFT,
|
||||
text,
|
||||
@ -206,7 +206,8 @@ python_input_box(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
hop->callback = callback;
|
||||
Py_INCREF(callback);
|
||||
|
||||
input_dialog(python_ses->tab->term, getml(prompt, title, initial, NULL),
|
||||
input_dialog(python_ses->tab->term,
|
||||
getml(prompt, (void *) title, (void *) initial, (void *) NULL),
|
||||
title, prompt,
|
||||
hop, NULL,
|
||||
MAX_STR_LEN, initial, 0, 0, NULL,
|
||||
|
@ -140,7 +140,7 @@ python_menu(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
* Keep track of all the memory we allocate so we'll be able to free
|
||||
* it in case any error prevents us from displaying the menu.
|
||||
*/
|
||||
ml = getml(menu, NULL);
|
||||
ml = getml(menu, (void *) NULL);
|
||||
if (!ml) {
|
||||
mem_free(menu);
|
||||
return PyErr_NoMemory();
|
||||
|
@ -1252,7 +1252,7 @@ do_type_query(struct type_query *type_query, unsigned char *ct, struct mime_hand
|
||||
|
||||
add_dlg_end(dlg, widgets);
|
||||
|
||||
ml = getml(dlg, NULL);
|
||||
ml = getml(dlg, (void *) NULL);
|
||||
if (!ml) {
|
||||
/* XXX: Assume that the allocated @external_handler will be
|
||||
* freed when releasing the @type_query. */
|
||||
|
@ -270,7 +270,7 @@ ses_goto(struct session *ses, struct uri *uri, unsigned char *target_frame,
|
||||
mem_free_if(uristring);
|
||||
}
|
||||
|
||||
msg_box(ses->tab->term, getml(task, NULL), MSGBOX_FREE_TEXT,
|
||||
msg_box(ses->tab->term, getml(task, (void *) NULL), MSGBOX_FREE_TEXT,
|
||||
N_("Warning"), ALIGN_CENTER,
|
||||
message,
|
||||
task, 2,
|
||||
|
Loading…
Reference in New Issue
Block a user