mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 14:31:20 +03:00
[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
This commit is contained in:
parent
9deb539031
commit
bb41604045
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -23,8 +23,6 @@ typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET,
|
||||
#include <stdbool.h>
|
||||
#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);
|
||||
|
@ -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");
|
||||
|
||||
|
12
riscos/gif.c
12
riscos/gif.c
@ -4,9 +4,6 @@
|
||||
* http://www.opensource.org/licenses/gpl-license
|
||||
* Copyright 2003 John M Bell <jmb202@ecs.soton.ac.uk>
|
||||
* Copyright 2004 Richard Wilson <not_ginger_matt@sourceforge.net>
|
||||
*
|
||||
* Parts modified from IGviewer source by Peter Hartley
|
||||
* http://utter.chaos.org/~pdh/software/intergif.htm
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
16
riscos/gui.c
16
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("<NetSurf$Dir>.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);
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user