From bb41604045cbabbf9aea502ccc9b0e9db50e6aa7 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Wed, 5 May 2004 16:33:15 +0000 Subject: [project @ 2004-05-05 16:33:15 by bursa] Fix some compiler warnings. Ignore size attribute for file inputs. svn path=/import/netsurf/; revision=828 --- content/content.c | 4 ++-- content/content.h | 4 ++-- content/fetch.c | 2 +- content/fetchcache.c | 1 - css/css.c | 6 +++--- desktop/browser.c | 11 +++++------ desktop/gui.h | 2 -- render/box.c | 8 ++++---- riscos/gif.c | 12 ++++++------ riscos/gui.c | 16 ++++++++-------- riscos/history.c | 1 + riscos/menus.c | 1 + riscos/plugin.c | 3 ++- riscos/plugin.h | 3 ++- riscos/save.c | 3 ++- 15 files changed, 39 insertions(+), 38 deletions(-) diff --git a/content/content.c b/content/content.c index e8cfade5d..22c6f9904 100644 --- a/content/content.c +++ b/content/content.c @@ -219,8 +219,8 @@ struct content * content_create(char *url) * \param params array of strings, ordered attribute, value, attribute, ..., 0 */ -void content_set_type(struct content *c, content_type type, char* mime_type, - const char *params[]) +void content_set_type(struct content *c, content_type type, + const char *mime_type, const char *params[]) { union content_msg_data data; assert(c != 0); diff --git a/content/content.h b/content/content.h index b005da848..d3555f9ad 100644 --- a/content/content.h +++ b/content/content.h @@ -171,8 +171,8 @@ struct browser_window; content_type content_lookup(const char *mime_type); struct content * content_create(char *url); -void content_set_type(struct content *c, content_type type, char *mime_type, - const char *params[]); +void content_set_type(struct content *c, content_type type, + const char *mime_type, const char *params[]); void content_process_data(struct content *c, char *data, unsigned long size); void content_convert(struct content *c, unsigned long width, unsigned long height); void content_revive(struct content *c, unsigned long width, unsigned long height); diff --git a/content/fetch.c b/content/fetch.c index 35f19ca0f..c8630f343 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -599,7 +599,7 @@ size_t fetch_curl_data(void * data, size_t size, size_t nmemb, struct fetch *f) size_t fetch_curl_header(char * data, size_t size, size_t nmemb, struct fetch *f) { - int i; + unsigned int i; size *= nmemb; if (12 < size && strncasecmp(data, "Location:", 9) == 0) { /* extract Location header */ diff --git a/content/fetchcache.c b/content/fetchcache.c index f6fcb01f8..a56da83f9 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -79,7 +79,6 @@ struct content * fetchcache(const char *url, char *referer, struct content *c; char *url1 = xstrdup(url); char *hash = strchr(url1, '#'); - const char *params[] = { 0 }; char error_message[500]; /* strip fragment identifier */ diff --git a/css/css.c b/css/css.c index 1bb822e2e..ebf446dba 100644 --- a/css/css.c +++ b/css/css.c @@ -92,7 +92,7 @@ static void css_atimport_callback(content_msg msg, struct content *css, - void *p1, void *p2, const char *error); + void *p1, void *p2, union content_msg_data data); static bool css_match_rule(struct css_selector *rule, xmlNode *element); static bool css_match_detail(const struct css_selector *detail, xmlNode *element); @@ -580,7 +580,7 @@ void css_atimport(struct content *c, struct css_node *node) */ void css_atimport_callback(content_msg msg, struct content *css, - void *p1, void *p2, const char *error) + void *p1, void *p2, union content_msg_data data) { struct content *c = p1; unsigned int i = (unsigned int) p2; @@ -615,7 +615,7 @@ void css_atimport_callback(content_msg msg, struct content *css, case CONTENT_MSG_REDIRECT: c->active--; free(c->data.css.import_url[i]); - c->data.css.import_url[i] = strdup(error); + c->data.css.import_url[i] = strdup(data.redirect); if (!c->data.css.import_url[i]) { /** \todo report to user */ c->error = 1; diff --git a/desktop/browser.c b/desktop/browser.c index 064c229cb..91474259a 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -600,7 +600,7 @@ void browser_window_gadget_select(struct browser_window* bw, struct form_control inline_box->width = g->box->width; inline_box->length = strlen(inline_box->text); - box_coords(g->box, (unsigned long*)&x, (unsigned long*)&y); + box_coords(g->box, &x, &y); gui_window_redraw(bw->window, (unsigned int)x, (unsigned int)y, (unsigned int)(x + g->box->width), (unsigned int)(y + g->box->height)); @@ -611,7 +611,7 @@ int browser_window_gadget_click(struct browser_window* bw, unsigned long click_x struct box_selection* click_boxes; int found, plot_index; int i; - unsigned long x, y; + int x, y; found = 0; click_boxes = NULL; @@ -790,8 +790,8 @@ void browser_window_textarea_callback(struct browser_window *bw, char key, void struct box *ic; int char_offset = textarea->gadget->caret_char_offset; int pixel_offset, dy; - unsigned long actual_x, actual_y; - unsigned long width=0, height=0; + int actual_x, actual_y; + unsigned long width = 0, height = 0; bool reflow = false; box_coords(textarea, &actual_x, &actual_y); @@ -1144,7 +1144,7 @@ void browser_window_input_callback(struct browser_window *bw, char key, void *p) struct box *text_box = input->children->children; int char_offset = input->gadget->caret_char_offset; int pixel_offset; - unsigned long actual_x, actual_y; + int actual_x, actual_y; struct form* form = input->gadget->form; box_coords(input, &actual_x, &actual_y); @@ -1451,7 +1451,6 @@ void browser_window_follow_link(struct browser_window *bw, int done = 0; struct css_style *style; gui_pointer_shape pointer = GUI_POINTER_DEFAULT; - struct browser_window *new_bw; found = 0; click_boxes = NULL; diff --git a/desktop/gui.h b/desktop/gui.h index bffcc23fd..df3ed5ad9 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -23,8 +23,6 @@ typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET, #include #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" -#include "netsurf/riscos/gui.h" -#include "netsurf/riscos/wimp.h" bool gui_window_in_list(gui_window *g); gui_window *gui_create_browser_window(struct browser_window *bw, struct browser_window *clone); diff --git a/render/box.c b/render/box.c index fb1d0041e..e5c856978 100644 --- a/render/box.c +++ b/render/box.c @@ -609,9 +609,9 @@ struct css_style * box_get_style(struct content ** stylesheet, style->width.width = CSS_WIDTH_LENGTH; if (!type || strcasecmp(type, "text") == 0 || strcasecmp(type, "password") == 0) - /* in characters for text or password */ + /* in characters for text, password, file */ style->width.value.length.unit = CSS_UNIT_EX; - else + else if (strcasecmp(type, "file") != 0) /* in pixels otherwise */ style->width.value.length.unit = CSS_UNIT_PX; style->width.value.length.value = size; @@ -1998,8 +1998,8 @@ struct result box_embed(xmlNode *n, struct status *status, pp->type = 0; pp->next = 0; - if(strcasecmp((char*)a->name, "src") != 0) { - pp->name = strdup((char*)a->name); + if(strcasecmp((const char*)a->name, "src") != 0) { + pp->name = strdup((const char*)a->name); pp->value = strdup((char*)a->children->content); pp->valuetype = strdup("data"); diff --git a/riscos/gif.c b/riscos/gif.c index 63952342e..2b227af6d 100644 --- a/riscos/gif.c +++ b/riscos/gif.c @@ -4,9 +4,6 @@ * http://www.opensource.org/licenses/gpl-license * Copyright 2003 John M Bell * Copyright 2004 Richard Wilson - * - * Parts modified from IGviewer source by Peter Hartley - * http://utter.chaos.org/~pdh/software/intergif.htm */ #include @@ -94,9 +91,12 @@ void nsgif_redraw(struct content *c, long x, long y, /* Decode from the last frame to the current frame */ - previous_frame = c->data.gif.gif->decoded_frame; - if (previous_frame > c->data.gif.current_frame) previous_frame = -1; - for (frame = previous_frame + 1; frame <= c->data.gif.current_frame; frame++) { + if (c->data.gif.current_frame < c->data.gif.gif->decoded_frame) + previous_frame = 0; + else + previous_frame = c->data.gif.gif->decoded_frame + 1; + + for (frame = previous_frame; frame <= c->data.gif.current_frame; frame++) { gif_decode_frame(c->data.gif.gif, frame); } diff --git a/riscos/gui.c b/riscos/gui.c index dd7254bfa..cc3dfe747 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -68,7 +68,7 @@ static clock_t gui_last_poll; /**< Time of last wimp_poll. */ osspriteop_area *pointers; /**< Sprite area containing pointer data */ gui_pointer_shape curr_pointer; /**< Current shape of the pointer */ /** Accepted wimp user messages. */ -static const wimp_MESSAGE_LIST(27) task_messages = { { +static wimp_MESSAGE_LIST(27) task_messages = { { message_DATA_SAVE, message_DATA_SAVE_ACK, message_DATA_LOAD, @@ -158,7 +158,7 @@ void gui_init(int argc, char** argv) messages_load(".Resources.LangNames"); error = xwimp_initialise(wimp_VERSION_RO38, "NetSurf", - (wimp_message_list*) &task_messages, 0, + (const wimp_message_list *) &task_messages, 0, &task_handle); if (error) { LOG(("xwimp_initialise failed: 0x%x: %s", @@ -215,7 +215,7 @@ void gui_init(int argc, char** argv) void gui_window_clone_options(struct browser_window *new_bw, struct browser_window *old_bw) { gui_window *old_gui = NULL; gui_window *new_gui; - + /* Abort on bad input */ if (new_bw == NULL) return; @@ -239,10 +239,10 @@ void gui_window_clone_options(struct browser_window *new_bw, struct browser_wind } else { new_gui->scale = old_gui->scale; new_gui->option_dither_sprites = old_gui->option_dither_sprites; - new_gui->option_filter_sprites = old_gui->option_filter_sprites; + new_gui->option_filter_sprites = old_gui->option_filter_sprites; new_gui->option_animate_images = old_gui->option_animate_images; } - + /* Set up the toolbar */ if (new_gui->data.browser.toolbar) { @@ -271,7 +271,7 @@ void gui_window_clone_options(struct browser_window *new_bw, struct browser_wind */ void gui_window_default_options(struct browser_window *bw) { gui_window *gui; - + /* Abort on bad input */ if (bw == NULL) return; @@ -287,7 +287,7 @@ void gui_window_default_options(struct browser_window *bw) { option_dither_sprites = gui->option_dither_sprites; option_filter_sprites = gui->option_filter_sprites; option_animate_images = gui->option_animate_images; - + /* Set up the toolbar */ if (gui->data.browser.toolbar) { @@ -769,7 +769,7 @@ void ro_gui_open_window_request(wimp_open *open) { if (g) { toolbar = g->data.browser.toolbar; if (toolbar) { - toolbar->resize_status = 1; + toolbar->resize_status = 1; ro_theme_resize_toolbar(g); } } diff --git a/riscos/history.c b/riscos/history.c index 112727810..f29dd8ad4 100644 --- a/riscos/history.c +++ b/riscos/history.c @@ -20,6 +20,7 @@ #include "netsurf/riscos/gui.h" #include "netsurf/riscos/thumbnail.h" #include "netsurf/riscos/tinct.h" +#include "netsurf/riscos/wimp.h" #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" diff --git a/riscos/menus.c b/riscos/menus.c index 9fcc3dc4e..44f12aaac 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -20,6 +20,7 @@ #include "netsurf/riscos/gui.h" #include "netsurf/riscos/theme.h" #include "netsurf/riscos/options.h" +#include "netsurf/riscos/wimp.h" #include "netsurf/utils/log.h" #include "netsurf/utils/messages.h" #include "netsurf/utils/url.h" diff --git a/riscos/plugin.c b/riscos/plugin.c index 4a63f2900..6baa41c4f 100644 --- a/riscos/plugin.c +++ b/riscos/plugin.c @@ -525,7 +525,8 @@ void plugin_destroy(struct content *c) */ void plugin_redraw(struct content *c, long x, long y, unsigned long width, unsigned long height, - long clip_x0, long clip_y0, long clip_x1, long clip_y1) + long clip_x0, long clip_y0, long clip_x1, long clip_y1, + float scale) { struct plugin_list *npl; diff --git a/riscos/plugin.h b/riscos/plugin.h index f08465897..b996b977f 100644 --- a/riscos/plugin.h +++ b/riscos/plugin.h @@ -78,7 +78,8 @@ void plugin_reformat(struct content *c, unsigned int width, unsigned int height) void plugin_destroy(struct content *c); void plugin_redraw(struct content *c, long x, long y, unsigned long width, unsigned long height, - long clip_x0, long clip_y0, long clip_x1, long clip_y1); + long clip_x0, long clip_y0, long clip_x1, long clip_y1, + float scale); void plugin_add_instance(struct content *c, struct browser_window *bw, struct content *page, struct box *box, struct object_params *params, void **state); diff --git a/riscos/save.c b/riscos/save.c index 79c79adfb..9c91becb3 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -23,6 +23,7 @@ #include "netsurf/riscos/save_complete.h" #include "netsurf/riscos/save_draw.h" #include "netsurf/riscos/thumbnail.h" +#include "netsurf/riscos/wimp.h" #include "netsurf/utils/log.h" #include "netsurf/utils/messages.h" #include "netsurf/utils/utils.h" @@ -286,7 +287,7 @@ void ro_gui_save_complete(struct content *c, char *path) /* !Paint gets confused with uppercase characters */ - for (int index = 0; index < 12; index++) { + for (index = 0; index < 12; index++) { sprite_header->name[index] = tolower(sprite_header->name[index]); } thumbnail_create(c, area, -- cgit v1.2.3