mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-28 23:09:43 +03:00
[project @ 2003-12-27 01:37:51 by jmb]
Reduce compiler warnings svn path=/import/netsurf/; revision=455
This commit is contained in:
parent
3613ab36a9
commit
4da66aef4b
16
css/css.c
16
css/css.c
@ -98,7 +98,7 @@ void css_create(struct content *c)
|
||||
c->data.css.css = xcalloc(1, sizeof(*c->data.css.css));
|
||||
css_lex_init(&c->data.css.css->lexer);
|
||||
/*css_parser_Trace(stderr, "css parser: ");*/
|
||||
c->data.css.css->parser = css_parser_Alloc(malloc);
|
||||
c->data.css.css->parser = css_parser_Alloc((void*)malloc);
|
||||
for (i = 0; i != HASH_SIZE; i++)
|
||||
c->data.css.css->rule[i] = 0;
|
||||
c->data.css.import_count = 0;
|
||||
@ -129,7 +129,7 @@ int css_convert(struct content *c, unsigned int width, unsigned int height)
|
||||
buffer = css__scan_buffer(c->data.css.data, c->data.css.length + 2,
|
||||
c->data.css.css->lexer);
|
||||
assert(buffer);
|
||||
while (token = css_lex(c->data.css.css->lexer)) {
|
||||
while ((token = css_lex(c->data.css.css->lexer))) {
|
||||
css_parser_(c->data.css.css->parser, token,
|
||||
xstrdup(css_get_text(c->data.css.css->lexer)),
|
||||
¶m);
|
||||
@ -168,7 +168,7 @@ void css_revive(struct content *c, unsigned int width, unsigned int height)
|
||||
for (i = 0; i != c->data.css.import_count; i++) {
|
||||
c->data.css.import_content[i] = fetchcache(
|
||||
c->data.css.import_url[i], c->url,
|
||||
css_atimport_callback, c, i,
|
||||
css_atimport_callback, c, (void*)i,
|
||||
c->width, c->height, true, 0, 0, false);
|
||||
if (c->data.css.import_content[i] == 0)
|
||||
continue;
|
||||
@ -204,7 +204,7 @@ void css_destroy(struct content *c)
|
||||
if (c->data.css.import_content[i] != 0) {
|
||||
free(c->data.css.import_url[i]);
|
||||
content_remove_user(c->data.css.import_content[i],
|
||||
css_atimport_callback, c, i);
|
||||
css_atimport_callback, c, (void*)i);
|
||||
}
|
||||
xfree(c->data.css.import_url);
|
||||
xfree(c->data.css.import_content);
|
||||
@ -335,7 +335,7 @@ void css_atimport(struct content *c, struct css_node *node)
|
||||
c->data.css.import_url[i] = url1;
|
||||
c->data.css.import_content[i] = fetchcache(
|
||||
c->data.css.import_url[i], c->url, css_atimport_callback,
|
||||
c, i, c->width, c->height, true, 0, 0, false);
|
||||
c, (void*)i, c->width, c->height, true, 0, 0, false);
|
||||
if (c->data.css.import_content[i] &&
|
||||
c->data.css.import_content[i]->status != CONTENT_STATUS_DONE)
|
||||
c->active++;
|
||||
@ -352,7 +352,7 @@ void css_atimport_callback(content_msg msg, struct content *css,
|
||||
switch (msg) {
|
||||
case CONTENT_MSG_LOADING:
|
||||
if (css->type != CONTENT_CSS) {
|
||||
content_remove_user(css, css_atimport_callback, c, i);
|
||||
content_remove_user(css, css_atimport_callback, c, (void*)i);
|
||||
c->data.css.import_content[i] = 0;
|
||||
c->active--;
|
||||
c->error = 1;
|
||||
@ -383,7 +383,7 @@ void css_atimport_callback(content_msg msg, struct content *css,
|
||||
c->data.css.import_url[i] = xstrdup(error);
|
||||
c->data.css.import_content[i] = fetchcache(
|
||||
c->data.css.import_url[i], c->url, css_atimport_callback,
|
||||
c, i, css->width, css->height, true, 0, 0, false);
|
||||
c, (void*)i, css->width, css->height, true, 0, 0, false);
|
||||
if (c->data.css.import_content[i] &&
|
||||
c->data.css.import_content[i]->status != CONTENT_STATUS_DONE)
|
||||
c->active++;
|
||||
@ -573,7 +573,7 @@ void css_parse_property_list(struct css_style * style, char * str)
|
||||
struct parse_params param = {1, 0, 0, false};
|
||||
|
||||
css_lex_init(&lexer);
|
||||
parser = css_parser_Alloc(malloc);
|
||||
parser = css_parser_Alloc((void*)malloc);
|
||||
css_parser_(parser, LBRACE, xstrdup("{"), ¶m);
|
||||
|
||||
buffer = css__scan_string(str, lexer);
|
||||
|
@ -202,7 +202,7 @@ void css_add_declarations(struct css_style *style, struct css_node *declaration)
|
||||
assert(n->type == CSS_NODE_DECLARATION && n->data != 0 && n->left != 0);
|
||||
p = bsearch(n->data, property_table,
|
||||
sizeof(property_table) / sizeof(property_table[0]),
|
||||
sizeof(property_table[0]), strcasecmp);
|
||||
sizeof(property_table[0]), (void*)strcasecmp);
|
||||
if (p == 0)
|
||||
continue;
|
||||
p->parse(style, n->left);
|
||||
@ -285,7 +285,7 @@ colour named_colour(const char *name)
|
||||
struct colour_entry *col;
|
||||
col = bsearch(name, colour_table,
|
||||
sizeof(colour_table) / sizeof(colour_table[0]),
|
||||
sizeof(colour_table[0]), strcasecmp);
|
||||
sizeof(colour_table[0]), (void*)strcasecmp);
|
||||
if (col == 0)
|
||||
return TRANSPARENT;
|
||||
return col->col;
|
||||
@ -318,7 +318,7 @@ colour parse_colour(const struct css_node * const v)
|
||||
case CSS_NODE_IDENT:
|
||||
col = bsearch(v->data, colour_table,
|
||||
sizeof(colour_table) / sizeof(colour_table[0]),
|
||||
sizeof(colour_table[0]), strcasecmp);
|
||||
sizeof(colour_table[0]), (void*)strcasecmp);
|
||||
if (col != 0)
|
||||
c = col->col;
|
||||
break;
|
||||
@ -439,7 +439,7 @@ void parse_font_size(struct css_style * const s, const struct css_node * const v
|
||||
case CSS_NODE_IDENT:
|
||||
fs = bsearch(v->data, font_size_table,
|
||||
sizeof(font_size_table) / sizeof(font_size_table[0]),
|
||||
sizeof(font_size_table[0]), strcasecmp);
|
||||
sizeof(font_size_table[0]), (void*)strcasecmp);
|
||||
if (fs != 0) {
|
||||
s->font_size.size = CSS_FONT_SIZE_LENGTH;
|
||||
s->font_size.value.length.unit = CSS_UNIT_PT;
|
||||
@ -524,6 +524,7 @@ void parse_text_align(struct css_style * const s, const struct css_node * const
|
||||
|
||||
void parse_text_decoration(struct css_style * const s, const struct css_node * const v)
|
||||
{
|
||||
struct css_node *temp;
|
||||
css_text_decoration z;
|
||||
if (v->type != CSS_NODE_IDENT)
|
||||
return;
|
||||
@ -535,8 +536,8 @@ void parse_text_decoration(struct css_style * const s, const struct css_node * c
|
||||
}
|
||||
if (z != CSS_TEXT_DECORATION_UNKNOWN)
|
||||
s->text_decoration |= z;
|
||||
for (v = v->next; v; v = v->next) {
|
||||
z = css_text_decoration_parse(v->data);
|
||||
for (temp = v->next; temp; temp = temp->next) {
|
||||
z = css_text_decoration_parse(temp->data);
|
||||
if (z != CSS_TEXT_DECORATION_UNKNOWN)
|
||||
s->text_decoration |= z;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user