1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

[viewer] cast

This commit is contained in:
Witold Filipczyk 2022-01-26 18:18:44 +01:00
parent af29b2a93f
commit 4837d4eb92
6 changed files with 27 additions and 27 deletions

View File

@ -660,7 +660,7 @@ dump_next(LIST_OF(struct string_list_item) *url_list)
if (url_list) { if (url_list) {
/* Steal all them nice list items but keep the same order */ /* Steal all them nice list items but keep the same order */
while (!list_empty(*url_list)) { while (!list_empty(*url_list)) {
item = url_list->next; item = (struct string_list_item *)url_list->next;
del_from_list(item); del_from_list(item);
add_to_list_end(todo_list, item); add_to_list_end(todo_list, item);
} }
@ -672,7 +672,7 @@ dump_next(LIST_OF(struct string_list_item) *url_list)
program.terminate = 0; program.terminate = 0;
item = todo_list.next; item = (struct string_list_item *)todo_list.next;
del_from_list(item); del_from_list(item);
add_to_list(done_list, item); add_to_list(done_list, item);

View File

@ -135,7 +135,7 @@ fixup_select_state(struct el_form_control *fc, struct form_state *fs)
void void
selected_item(struct terminal *term, void *item_, void *ses_) selected_item(struct terminal *term, void *item_, void *ses_)
{ {
struct session *ses = ses_; struct session *ses = (struct session *)ses_;
int item = (long) item_; int item = (long) item_;
struct document_view *doc_view; struct document_view *doc_view;
struct link *link; struct link *link;
@ -1436,7 +1436,7 @@ auto_submit_form(struct session *ses)
struct document *document = ses->doc_view->document; struct document *document = ses->doc_view->document;
if (!list_empty(document->forms)) if (!list_empty(document->forms))
submit_given_form(ses, ses->doc_view, document->forms.next, 0); submit_given_form(ses, ses->doc_view, (struct form *)document->forms.next, 0);
} }
@ -1444,8 +1444,8 @@ auto_submit_form(struct session *ses)
static void static void
set_file_form_state(struct terminal *term, void *filename_, void *fs_) set_file_form_state(struct terminal *term, void *filename_, void *fs_)
{ {
char *filename = filename_; char *filename = (char *)filename_;
struct form_state *fs = fs_; struct form_state *fs = (struct form_state *)fs_;
/* The menu code doesn't free the filename data */ /* The menu code doesn't free the filename data */
mem_free_set(&fs->value, filename); mem_free_set(&fs->value, filename);
@ -1457,8 +1457,8 @@ set_file_form_state(struct terminal *term, void *filename_, void *fs_)
static void static void
file_form_menu(struct terminal *term, void *path_, void *fs_) file_form_menu(struct terminal *term, void *path_, void *fs_)
{ {
char *path = path_; char *path = (char *)path_;
struct form_state *fs = fs_; struct form_state *fs = (struct form_state *)fs_;
/* FIXME: It doesn't work for ../../ */ /* FIXME: It doesn't work for ../../ */
#if 0 #if 0
@ -1754,7 +1754,7 @@ field_op(struct session *ses, struct document_view *doc_view,
break; break;
} }
text = memrchr(fs->value, ASCII_LF, fs->state); text = (char *)memrchr(fs->value, ASCII_LF, fs->state);
if (text) { if (text) {
/* Leave the new-line character if it does not /* Leave the new-line character if it does not
* immediately precede the cursor. */ * immediately precede the cursor. */
@ -2091,7 +2091,7 @@ get_form_info(struct session *ses, struct document_view *doc_view)
static void static void
link_form_menu_func(struct terminal *term, void *link_number_, void *ses_) link_form_menu_func(struct terminal *term, void *link_number_, void *ses_)
{ {
struct session *ses = ses_; struct session *ses = (struct session *)ses_;
struct document_view *doc_view; struct document_view *doc_view;
int link_number = *(int *) link_number_; int link_number = *(int *) link_number_;

View File

@ -1309,7 +1309,7 @@ try_document_key(struct session *ses, struct document_view *doc_view,
void void
link_menu(struct terminal *term, void *xxx, void *ses_) link_menu(struct terminal *term, void *xxx, void *ses_)
{ {
struct session *ses = ses_; struct session *ses = (struct session *)ses_;
struct document_view *doc_view; struct document_view *doc_view;
struct link *link; struct link *link;
struct menu_item *mi; struct menu_item *mi;

View File

@ -1883,8 +1883,8 @@ struct search_dlg_hop {
static widget_handler_status_T static widget_handler_status_T
search_dlg_cancel(struct dialog_data *dlg_data, struct widget_data *widget_data) search_dlg_cancel(struct dialog_data *dlg_data, struct widget_data *widget_data)
{ {
void (*fn)(void *) = widget_data->widget->data; void (*fn)(void *) = (void (*)(void *))widget_data->widget->data;
struct search_dlg_hop *hop = dlg_data->dlg->udata2; struct search_dlg_hop *hop = (struct search_dlg_hop *)dlg_data->dlg->udata2;
void *data = hop->data; void *data = hop->data;
if (fn) fn(data); if (fn) fn(data);
@ -1894,8 +1894,8 @@ search_dlg_cancel(struct dialog_data *dlg_data, struct widget_data *widget_data)
static widget_handler_status_T static widget_handler_status_T
search_dlg_ok(struct dialog_data *dlg_data, struct widget_data *widget_data) search_dlg_ok(struct dialog_data *dlg_data, struct widget_data *widget_data)
{ {
void (*fn)(void *, char *) = widget_data->widget->data; void (*fn)(void *, char *) = (void (*)(void *, char *))widget_data->widget->data;
struct search_dlg_hop *hop = dlg_data->dlg->udata2; struct search_dlg_hop *hop = (struct search_dlg_hop *)dlg_data->dlg->udata2;
void *data = hop->data; void *data = hop->data;
char *text = dlg_data->widgets_data->cdata; char *text = dlg_data->widgets_data->cdata;
@ -1997,7 +1997,7 @@ search_dlg(struct session *ses, struct document_view *doc_view, int direction)
search_dlg_do(ses->tab->term, NULL, search_dlg_do(ses->tab->term, NULL,
title, ses, title, ses,
&search_history, &search_history,
search_function); (void (*)(void *, char *))search_function);
return FRAME_EVENT_OK; return FRAME_EVENT_OK;
} }

View File

@ -176,7 +176,7 @@ format_text(char *text, int width, enum form_wrap wrap, int format)
char *wrappos; char *wrappos;
/* Find a place to wrap the text */ /* Find a place to wrap the text */
wrappos = memrchr(&text[begin], ' ', pos - begin); wrappos = (char *)memrchr(&text[begin], ' ', pos - begin);
if (wrappos) { if (wrappos) {
/* When formatting text for form submitting we /* When formatting text for form submitting we
* have to apply the wrapping mode. */ * have to apply the wrapping mode. */
@ -611,7 +611,7 @@ free_textarea_data(struct terminal *term)
assert(term); assert(term);
if (term->textarea_data) if (term->textarea_data)
done_textarea_data(term->textarea_data); done_textarea_data((struct textarea_data *)term->textarea_data);
term->textarea_data = NULL; term->textarea_data = NULL;
} }
@ -666,7 +666,7 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
} else if (op == 1) { } else if (op == 1) {
struct string file; struct string file;
td = term_->textarea_data; td = (struct textarea_data *)term_->textarea_data;
term_->textarea_data = NULL; term_->textarea_data = NULL;
assert(td); assert(td);
@ -713,7 +713,7 @@ textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
void void
menu_textarea_edit(struct terminal *term, void *xxx, void *ses_) menu_textarea_edit(struct terminal *term, void *xxx, void *ses_)
{ {
struct session *ses = ses_; struct session *ses = (struct session *)ses_;
struct document_view *doc_view; struct document_view *doc_view;
struct link *link; struct link *link;
struct form_state *fs; struct form_state *fs;

View File

@ -1559,7 +1559,7 @@ send_mouse_event(struct session *ses, struct document_view *doc_view,
struct window *m; struct window *m;
activate_bfu_technology(ses, -1); activate_bfu_technology(ses, -1);
m = term->windows.next; m = (struct window *)term->windows.next;
m->handler(m, ev); m->handler(m, ev);
return ses; return ses;
@ -1576,7 +1576,7 @@ send_mouse_event(struct session *ses, struct document_view *doc_view,
&& mouse->y == term->prev_mouse_event.y) { && mouse->y == term->prev_mouse_event.y) {
if (current_tab->data == ses) ses = NULL; if (current_tab->data == ses) ses = NULL;
close_tab(term, current_tab->data); close_tab(term, (struct session *)current_tab->data);
} }
return ses; return ses;
@ -1594,7 +1594,7 @@ send_mouse_event(struct session *ses, struct document_view *doc_view,
if (check_mouse_button(ev, B_MIDDLE)) { if (check_mouse_button(ev, B_MIDDLE)) {
do_not_ignore_next_mouse_event(term); do_not_ignore_next_mouse_event(term);
} else if (check_mouse_button(ev, B_RIGHT)) { } else if (check_mouse_button(ev, B_RIGHT)) {
tab_menu(current_tab->data, mouse->x, mouse->y, 1); tab_menu((struct session *)current_tab->data, mouse->x, mouse->y, 1);
} }
} }
@ -1653,10 +1653,10 @@ try_menu(struct session *ses, struct term_event *ev)
get_kbd_modifier(ev) &= ~KBD_MOD_ALT; get_kbd_modifier(ev) &= ~KBD_MOD_ALT;
activate_bfu_technology(ses, -1); activate_bfu_technology(ses, -1);
win = ses->tab->term->windows.next; win = (struct window *)ses->tab->term->windows.next;
win->handler(win, ev); win->handler(win, ev);
if (ses->tab->term->windows.next == win) { if (ses->tab->term->windows.next == win) {
deselect_mainmenu(win->term, win->data); deselect_mainmenu(win->term, (struct menu *)win->data);
print_screen_status(ses); print_screen_status(ses);
} }
if (!tabs_are_on_top(ses->tab->term)) { if (!tabs_are_on_top(ses->tab->term)) {
@ -1835,7 +1835,7 @@ static void
save_formatted_finish(struct terminal *term, int h, save_formatted_finish(struct terminal *term, int h,
void *data, enum download_flags flags) void *data, enum download_flags flags)
{ {
struct document *document = data; struct document *document = (struct document *)data;
assert(term && document); assert(term && document);
if_assert_failed return; if_assert_failed return;
@ -1851,7 +1851,7 @@ save_formatted_finish(struct terminal *term, int h,
static void static void
save_formatted(void *data, char *file) save_formatted(void *data, char *file)
{ {
struct session *ses = data; struct session *ses = (struct session *)data;
struct document_view *doc_view; struct document_view *doc_view;
assert(ses && ses->tab && ses->tab->term && file); assert(ses && ses->tab && ses->tab->term && file);