1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[html] cast

This commit is contained in:
Witold Filipczyk 2022-01-25 17:52:09 +01:00
parent dea07293e7
commit c399ac257c
10 changed files with 18 additions and 18 deletions

View File

@ -282,7 +282,7 @@ reset_document(struct document *document)
/// done_document_options(&document->options); /// done_document_options(&document->options);
while (!list_empty(document->forms)) { while (!list_empty(document->forms)) {
done_form(document->forms.next); done_form((struct form *)document->forms.next);
} }
#ifdef CONFIG_CSS #ifdef CONFIG_CSS
@ -352,7 +352,7 @@ done_document(struct document *document)
done_document_options(&document->options); done_document_options(&document->options);
while (!list_empty(document->forms)) { while (!list_empty(document->forms)) {
done_form(document->forms.next); done_form((struct form *)document->forms.next);
} }
#ifdef CONFIG_CSS #ifdef CONFIG_CSS

View File

@ -205,7 +205,7 @@ void
import_css_stylesheet(struct css_stylesheet *css, struct uri *base_uri, import_css_stylesheet(struct css_stylesheet *css, struct uri *base_uri,
const char *unterminated_url, int len) const char *unterminated_url, int len)
{ {
struct html_context *html_context = css->import_data; struct html_context *html_context = (struct html_context *)css->import_data;
char *url; char *url;
char *import_url; char *import_url;
struct uri *uri; struct uri *uri;
@ -602,7 +602,7 @@ look_for_link(char **pos, char *eof, struct menu_item **menu,
ld->target = target; ld->target = target;
for (nmenu = 0; !mi_is_end_of_menu(&(*menu)[nmenu]); nmenu++) { for (nmenu = 0; !mi_is_end_of_menu(&(*menu)[nmenu]); nmenu++) {
struct link_def *ll = (*menu)[nmenu].data; struct link_def *ll = (struct link_def *)(*menu)[nmenu].data;
if (!strcmp(ll->link, ld->link) && if (!strcmp(ll->link, ld->link) &&
!strcmp(ll->target, ld->target)) { !strcmp(ll->target, ld->target)) {
@ -727,7 +727,7 @@ void
done_html_parser_state(struct html_context *html_context, done_html_parser_state(struct html_context *html_context,
void *state) void *state)
{ {
struct html_element *element = state; struct html_element *element = (struct html_element *)state;
html_context->line_breax = 1; html_context->line_breax = 1;
@ -859,7 +859,7 @@ done_html_parser(struct html_context *html_context)
mem_free(html_context->base_target); mem_free(html_context->base_target);
done_uri(html_context->base_href); done_uri(html_context->base_href);
kill_html_stack_item(html_context, html_context->stack.next); kill_html_stack_item(html_context, (struct html_element *)html_context->stack.next);
assertm(list_empty(html_context->stack), assertm(list_empty(html_context->stack),
"html stack not empty after operation"); "html stack not empty after operation");

View File

@ -339,7 +339,7 @@ do_html_select(char *attr, char *html,
char *eof, char **end, char *eof, char **end,
struct html_context *html_context) struct html_context *html_context)
{ {
struct conv_table *ct = html_context->special_f(html_context, SP_TABLE, NULL); struct conv_table *ct = (struct conv_table *)html_context->special_f(html_context, SP_TABLE, NULL);
struct el_form_control *fc; struct el_form_control *fc;
struct string lbl = NULL_STRING, orig_lbl = NULL_STRING; struct string lbl = NULL_STRING, orig_lbl = NULL_STRING;
char **values = NULL; char **values = NULL;

View File

@ -1119,7 +1119,7 @@ html_frameset(struct html_context *html_context, char *a,
fp.parent = html_top->frameset; fp.parent = html_top->frameset;
if (fp.x && fp.y) { if (fp.x && fp.y) {
html_top->frameset = html_context->special_f(html_context, SP_FRAMESET, &fp); html_top->frameset = (struct frameset_desc *)html_context->special_f(html_context, SP_FRAMESET, &fp);
} }
mem_free_if(fp.width); mem_free_if(fp.width);
mem_free_if(fp.height); mem_free_if(fp.height);

View File

@ -149,7 +149,7 @@ void
html_stack_dup(struct html_context *html_context, enum html_element_mortality_type type) html_stack_dup(struct html_context *html_context, enum html_element_mortality_type type)
{ {
struct html_element *e; struct html_element *e;
struct html_element *ep = html_context->stack.next; struct html_element *ep = (struct html_element *)html_context->stack.next;
assertm(ep && (void *) ep != &html_context->stack, "html stack empty"); assertm(ep && (void *) ep != &html_context->stack, "html stack empty");
if_assert_failed return; if_assert_failed return;

View File

@ -1511,7 +1511,7 @@ new_link(struct html_context *html_context, char *name, int namelen)
* though, so we can safely just take that. */ * though, so we can safely just take that. */
form = fc->form; form = fc->form;
if (!form && !list_empty(document->forms)) if (!form && !list_empty(document->forms))
form = document->forms.next; form = (struct form *)document->forms.next;
link->target = null_or_stracpy(form ? form->target : NULL); link->target = null_or_stracpy(form ? form->target : NULL);
} }
@ -2100,7 +2100,7 @@ html_special_form_control(struct part *part, struct el_form_control *fc)
add_to_list(part->document->forms, form); add_to_list(part->document->forms, form);
} }
/* Attach this form control to the last form encountered. */ /* Attach this form control to the last form encountered. */
form = part->document->forms.next; form = (struct form *)part->document->forms.next;
fc->form = form; fc->form = form;
add_to_list(form->items, fc); add_to_list(form->items, fc);
} }
@ -2495,7 +2495,7 @@ format_html_part(struct html_context *html_context,
#endif #endif
if (document) { if (document) {
struct node *node = document->nodes.next; struct node *node = (struct node *)document->nodes.next;
node->box.height = y - node->box.y + part->box.height; node->box.height = y - node->box.y + part->box.height;
} }

View File

@ -867,7 +867,7 @@ draw_table_cell(struct table *table, int col, int row, int x, int y,
#endif #endif
} }
state = init_html_parser_state(html_context, ELEMENT_DONT_KILL, state = (struct html_element *)init_html_parser_state(html_context, ELEMENT_DONT_KILL,
cell->align, 0, 0); cell->align, 0, 0);
if (cell->is_header) elformat.style.attr |= AT_BOLD; if (cell->is_header) elformat.style.attr |= AT_BOLD;
@ -1301,7 +1301,7 @@ format_table(char *attr, char *html, char *eof,
* Otherwise i.e. <form> tags between <table> and <tr> are broken. */ * Otherwise i.e. <form> tags between <table> and <tr> are broken. */
draw_table_bad_html(html_context, table); draw_table_bad_html(html_context, table);
state = init_html_parser_state(html_context, ELEMENT_DONT_KILL, state = (struct html_element *)init_html_parser_state(html_context, ELEMENT_DONT_KILL,
ALIGN_LEFT, 0, 0); ALIGN_LEFT, 0, 0);
margins = /*par_elformat.blockquote_level + */par_elformat.leftmargin + par_elformat.rightmargin; margins = /*par_elformat.blockquote_level + */par_elformat.leftmargin + par_elformat.rightmargin;
@ -1331,7 +1331,7 @@ format_table(char *attr, char *html, char *eof,
goto ret2; goto ret2;
} }
node = part->document->nodes.next; node = (struct node *)part->document->nodes.next;
node->box.height = part->box.y - node->box.y + part->cy; node->box.height = part->box.y - node->box.y + part->cy;
indent = get_table_indent(html_context, table); indent = get_table_indent(html_context, table);

View File

@ -115,7 +115,7 @@ check_link_word(struct document *document, char *uri, int length,
{ {
struct uri test; struct uri test;
char *where = NULL; char *where = NULL;
char *mailto = memchr(uri, '@', length); char *mailto = (char *)memchr(uri, '@', length);
int keep = uri[length]; int keep = uri[length];
struct link *new_link; struct link *new_link;

View File

@ -67,7 +67,7 @@ done_document_refresh(struct document_refresh *refresh)
static void static void
do_document_refresh(void *data) do_document_refresh(void *data)
{ {
struct document_view *doc_view = data; struct document_view *doc_view = (struct document_view *)data;
struct document_refresh *refresh = doc_view->document->refresh; struct document_refresh *refresh = doc_view->document->refresh;
struct type_query *type_query; struct type_query *type_query;

View File

@ -553,7 +553,7 @@ render_document_frames(struct session *ses, int no_cache)
static int static int
comp_links(const void *v1, const void *v2) comp_links(const void *v1, const void *v2)
{ {
const struct link *l1 = v1, *l2 = v2; const struct link *l1 = (const struct link *)v1, *l2 = (const struct link *)v2;
assert(l1 && l2); assert(l1 && l2);
if_assert_failed return 0; if_assert_failed return 0;