From 6a7b1a73a7bcc4e4e6ee3a2343fd11b2453aefb1 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 16 Apr 2009 12:49:49 +0000 Subject: Fix compilation with GCC 2.95. It astounds me how some of this lot compiled at all. svn path=/trunk/netsurf/; revision=7104 --- render/box_construct.c | 18 +++++++++--------- render/hubbub_binding.c | 4 ++-- render/list.c | 2 +- render/table.c | 2 +- utils/filename.c | 2 +- utils/talloc.c | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/render/box_construct.c b/render/box_construct.c index 4f9bdfd32..dc354586e 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -2030,7 +2030,7 @@ bool box_create_frameset(struct content_html_frames *f, xmlNode *n, xmlFree(s); } frame->no_resize = xmlHasProp(c, - (const xmlChar *) "noresize"); + (const xmlChar *) "noresize") != NULL; if ((s = (char *) xmlGetProp(c, (const xmlChar *) "frameborder"))) { i = atoi(s); @@ -2448,25 +2448,25 @@ bool box_input_text(BOX_SPECIAL_PARAMS, bool password) xmlFree(s); if (box->gadget->value == NULL || box->gadget->initial_value == NULL) { box_free(box); - return NULL; + return false; } box->gadget->length = strlen(box->gadget->value); #endif inline_container = box_create(0, 0, 0, 0, 0, content); if (!inline_container) - return 0; + return false; inline_container->type = BOX_INLINE_CONTAINER; inline_box = box_create(box->style, 0, 0, box->title, 0, content); if (!inline_box) - return 0; + return false; inline_box->type = BOX_TEXT; if (password) { inline_box->length = strlen(box->gadget->value); inline_box->text = talloc_array(content, char, inline_box->length + 1); if (!inline_box->text) - return 0; + return false; memset(inline_box->text, '*', inline_box->length); inline_box->text[inline_box->length] = '\0'; } else { @@ -2474,17 +2474,17 @@ bool box_input_text(BOX_SPECIAL_PARAMS, bool password) * wrapping */ char *text = cnv_space2nbsp(box->gadget->value); if (!text) - return 0; + return false; inline_box->text = talloc_strdup(content, text); free(text); if (!inline_box->text) - return 0; + return false; inline_box->length = strlen(inline_box->text); } box_add_child(inline_container, inline_box); box_add_child(box, inline_container); - return box; + return true; } @@ -2693,7 +2693,7 @@ bool box_select_add_option(struct form_control *control, xmlNode *n) if (!value) goto no_memory; - selected = xmlHasProp(n, (const xmlChar *) "selected"); + selected = xmlHasProp(n, (const xmlChar *) "selected") != NULL; /* replace spaces/TABs with hard spaces to prevent line wrapping */ text_nowrap = cnv_space2nbsp(text); diff --git a/render/hubbub_binding.c b/render/hubbub_binding.c index 3bab8f260..a99bcf7cb 100644 --- a/render/hubbub_binding.c +++ b/render/hubbub_binding.c @@ -864,7 +864,7 @@ struct form_control *parse_input_element(xmlNode *node) if (control->type == GADGET_CHECKBOX || control->type == GADGET_RADIO) { control->selected = - xmlHasProp(node, (const xmlChar *) "checked"); + xmlHasProp(node, (const xmlChar *) "checked") != NULL; } if (control->type == GADGET_PASSWORD || @@ -983,7 +983,7 @@ struct form_control *parse_select_element(xmlNode *node) return NULL; control->data.select.multiple = - xmlHasProp(node, (const xmlChar *) "multiple"); + xmlHasProp(node, (const xmlChar *) "multiple") != NULL; name = xmlGetProp(node, (const xmlChar *) "name"); if (name != NULL) { diff --git a/render/list.c b/render/list.c index 8b5ef698e..84b5beffc 100644 --- a/render/list.c +++ b/render/list.c @@ -186,7 +186,7 @@ bool render_list_counter_increment(char *name, int value) { if (counter->state) counter->state->count += value; /* render_list_counter_output(name); -*/ return (counter->state); +*/ return counter->state != NULL; } diff --git a/render/table.c b/render/table.c index e0172994e..9423401f3 100644 --- a/render/table.c +++ b/render/table.c @@ -216,7 +216,7 @@ void table_collapse_borders(struct box *table) assert(row_group->type == BOX_TABLE_ROW_GROUP); assert(row_group->style); table_collapse_borders_h(table, row_group, &first); - first = (row_group->children); + first = row_group->children != NULL; for (row = row_group->children; row; row = row->next) { assert(row->type == BOX_TABLE_ROW); assert(row->style); diff --git a/utils/filename.c b/utils/filename.c index e48983a53..77ec7d6b2 100644 --- a/utils/filename.c +++ b/utils/filename.c @@ -36,7 +36,7 @@ #include "utils/url.h" #include "utils/utils.h" -#define FULL_WORD (unsigned int)4294967295 +#define FULL_WORD (unsigned int)4294967295U /* '0' + '0' * 10 */ #define START_PREFIX 528 diff --git a/utils/talloc.c b/utils/talloc.c index 985bba93b..7b84a9a77 100644 --- a/utils/talloc.c +++ b/utils/talloc.c @@ -55,7 +55,7 @@ #include "replace.h" #else #include -#if !defined(__BEOS__) && !defined(__HAIKU__) +#if !defined(__BEOS__) && !defined(__HAIKU__) && __GNUC__ > 2 /* Assume we've got va_copy */ #define HAVE_VA_COPY #include -- cgit v1.2.3