From 5f6c2cbff7cd778b6487943d62e71ff9e7b04893 Mon Sep 17 00:00:00 2001 From: John Tytgat Date: Sat, 26 Jul 2008 22:29:15 +0000 Subject: - Compiler warning squash - Changed a lineending \n\r -> \n for a couple of files. - More code style conformance. svn path=/trunk/netsurf/; revision=4762 --- riscos/gui/progress_bar.c | 49 ++++++++++++++++++++++++++++++---------------- riscos/gui/progress_bar.h | 8 ++++---- riscos/gui/status_bar.c | 50 +++++++++++++++++++++++++++++------------------ riscos/gui/status_bar.h | 4 ++-- 4 files changed, 69 insertions(+), 42 deletions(-) (limited to 'riscos/gui') diff --git a/riscos/gui/progress_bar.c b/riscos/gui/progress_bar.c index 068f0103b..1195d57bb 100644 --- a/riscos/gui/progress_bar.c +++ b/riscos/gui/progress_bar.c @@ -23,10 +23,10 @@ #include #include #include -#include +#include "swis.h" #include "oslib/colourtrans.h" #include "oslib/os.h" -#include +#include "oslib/osspriteop.h" #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" #include "desktop/plotters.h" @@ -99,7 +99,8 @@ static void ro_gui_progress_bar_animate(void *p); * * \param icons the sprite area to use for icons */ -void ro_gui_progress_bar_init(osspriteop_area *icons) { +void ro_gui_progress_bar_init(osspriteop_area *icons) +{ os_error *error; progress_bar_definition.sprite_area = icons; @@ -120,7 +121,8 @@ void ro_gui_progress_bar_init(osspriteop_area *icons) { /** * Create a new progress bar */ -struct progress_bar *ro_gui_progress_bar_create(void) { +struct progress_bar *ro_gui_progress_bar_create(void) +{ struct progress_bar *pb; os_error *error; @@ -149,7 +151,8 @@ struct progress_bar *ro_gui_progress_bar_create(void) { * * \param pb the progress bar to destroy */ -void ro_gui_progress_bar_destroy(struct progress_bar *pb) { +void ro_gui_progress_bar_destroy(struct progress_bar *pb) +{ os_error *error; assert(pb); @@ -172,7 +175,8 @@ void ro_gui_progress_bar_destroy(struct progress_bar *pb) { * \param pb the progress bar to get the window handle of * \return the progress bar's window handle */ -wimp_w ro_gui_progress_bar_get_window(struct progress_bar *pb) { +wimp_w ro_gui_progress_bar_get_window(struct progress_bar *pb) +{ assert(pb); return pb->w; @@ -185,7 +189,8 @@ wimp_w ro_gui_progress_bar_get_window(struct progress_bar *pb) { * \param pb the progress bar to set the icon for * \param icon the icon to use, or NULL for no icon */ -void ro_gui_progress_bar_set_icon(struct progress_bar *pb, const char *icon) { +void ro_gui_progress_bar_set_icon(struct progress_bar *pb, const char *icon) +{ assert(pb); if (!strcmp(icon, pb->icon)) @@ -208,7 +213,8 @@ void ro_gui_progress_bar_set_icon(struct progress_bar *pb, const char *icon) { * \param pb the progress bar to set the value for * \param value the value to use */ -void ro_gui_progress_bar_set_value(struct progress_bar *pb, unsigned int value) { +void ro_gui_progress_bar_set_value(struct progress_bar *pb, unsigned int value) +{ assert(pb); pb->value = value; @@ -224,7 +230,8 @@ void ro_gui_progress_bar_set_value(struct progress_bar *pb, unsigned int value) * \param pb the progress bar to get the value of * \return the current value */ -unsigned int ro_gui_progress_bar_get_value(struct progress_bar *pb) { +unsigned int ro_gui_progress_bar_get_value(struct progress_bar *pb) +{ assert(pb); return pb->value; @@ -237,7 +244,8 @@ unsigned int ro_gui_progress_bar_get_value(struct progress_bar *pb) { * \param pb the progress bar to set the range for * \param range the range to use */ -void ro_gui_progress_bar_set_range(struct progress_bar *pb, unsigned int range) { +void ro_gui_progress_bar_set_range(struct progress_bar *pb, unsigned int range) +{ assert(pb); pb->range = range; @@ -253,7 +261,8 @@ void ro_gui_progress_bar_set_range(struct progress_bar *pb, unsigned int range) * \param pb the progress bar to get the range of * \return the current range */ -unsigned int ro_gui_progress_bar_get_range(struct progress_bar *pb) { +unsigned int ro_gui_progress_bar_get_range(struct progress_bar *pb) +{ assert(pb); return pb->range; @@ -267,7 +276,8 @@ unsigned int ro_gui_progress_bar_get_range(struct progress_bar *pb) { * \param width the new progress bar width * \param height the new progress bar height */ -void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height) { +void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height) +{ wimp_draw redraw; os_error *error; osbool more; @@ -321,8 +331,8 @@ void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height) * * \param redraw the redraw request to process */ -void ro_gui_progress_bar_redraw(wimp_draw *redraw) { - +void ro_gui_progress_bar_redraw(wimp_draw *redraw) +{ struct progress_bar *pb; os_error *error; osbool more; @@ -346,7 +356,8 @@ void ro_gui_progress_bar_redraw(wimp_draw *redraw) { * * \param p the progress bar to animate */ -void ro_gui_progress_bar_animate(void *p) { +void ro_gui_progress_bar_animate(void *p) +{ wimp_draw redraw; os_error *error; osbool more; @@ -377,7 +388,9 @@ void ro_gui_progress_bar_animate(void *p) { * \param height the height of the progress bar * \return the address of the associated icon, or NULL */ -void ro_gui_progress_bar_calculate(struct progress_bar *pb, int width, int height) { +void ro_gui_progress_bar_calculate(struct progress_bar *pb, int width, + int height) +{ os_error *error; int icon_width, icon_height; int icon_x0 = 0, icon_y0 = 0, progress_x0, progress_x1, progress_ymid = 0; @@ -448,7 +461,9 @@ void ro_gui_progress_bar_calculate(struct progress_bar *pb, int width, int heigh * \param redraw the section of the window to redraw * \param pb the progress bar to redraw */ -void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, struct progress_bar *pb) { +void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, + struct progress_bar *pb) +{ os_error *error; osbool more = true; int clip_x0 = 0, clip_y0 = 0, clip_x1 = 0, clip_y1 = 0; diff --git a/riscos/gui/progress_bar.h b/riscos/gui/progress_bar.h index 47fc3acf3..e4cec1369 100644 --- a/riscos/gui/progress_bar.h +++ b/riscos/gui/progress_bar.h @@ -20,13 +20,13 @@ * Progress bar (interface). */ -#include -#include -#include "oslib/wimp.h" - #ifndef _NETSURF_RISCOS_PROGRESS_BAR_H_ #define _NETSURF_RISCOS_PROGRESS_BAR_H_ +#include +#include "oslib/osspriteop.h" +#include "oslib/wimp.h" + struct progress_bar; void ro_gui_progress_bar_init(osspriteop_area *icons); diff --git a/riscos/gui/status_bar.c b/riscos/gui/status_bar.c index 95173a479..1ab458c1f 100644 --- a/riscos/gui/status_bar.c +++ b/riscos/gui/status_bar.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include "swis.h" #include "oslib/colourtrans.h" #include "oslib/os.h" #include "oslib/wimp.h" @@ -110,7 +110,8 @@ static void ro_gui_status_position_progress_bar(struct status_bar *sb); * \param parent the window to contain the status bar * \param width the proportional width to use (0...10,000) */ -struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width) { +struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width) +{ struct status_bar *sb; os_error *error; @@ -152,7 +153,8 @@ struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width) { * * \param sb the status bar to destroy */ -void ro_gui_status_bar_destroy(struct status_bar *sb) { +void ro_gui_status_bar_destroy(struct status_bar *sb) +{ os_error *error; assert(sb); @@ -178,7 +180,8 @@ void ro_gui_status_bar_destroy(struct status_bar *sb) { * \param sb the status bar to get the window handle of * \return the status bar's window handle */ -wimp_w ro_gui_status_bar_get_window(struct status_bar *sb) { +wimp_w ro_gui_status_bar_get_window(struct status_bar *sb) +{ assert(sb); return sb->w; @@ -191,7 +194,8 @@ wimp_w ro_gui_status_bar_get_window(struct status_bar *sb) { * \param sb the status bar to get the width of * \return the status bar's width (0...10,000) */ -unsigned int ro_gui_status_bar_get_width(struct status_bar *sb) { +unsigned int ro_gui_status_bar_get_width(struct status_bar *sb) +{ assert(sb); return sb->scale; @@ -204,7 +208,8 @@ unsigned int ro_gui_status_bar_get_width(struct status_bar *sb) { * \param sb the status bar to check the visiblity of * \return whether the status bar is visible */ -void ro_gui_status_bar_set_visible(struct status_bar *sb, bool visible) { +void ro_gui_status_bar_set_visible(struct status_bar *sb, bool visible) +{ os_error *error; assert(sb); @@ -228,7 +233,8 @@ void ro_gui_status_bar_set_visible(struct status_bar *sb, bool visible) { * \param sb the status bar to check the visiblity of * \return whether the status bar is visible */ -bool ro_gui_status_bar_get_visible(struct status_bar *sb) { +bool ro_gui_status_bar_get_visible(struct status_bar *sb) +{ assert(sb); return sb->visible; @@ -242,8 +248,8 @@ bool ro_gui_status_bar_get_visible(struct status_bar *sb) { * \param value the value to use */ void ro_gui_status_bar_set_progress_value(struct status_bar *sb, - unsigned int value) { - + unsigned int value) +{ assert(sb); ro_gui_status_bar_set_progress_range(sb, @@ -259,7 +265,8 @@ void ro_gui_status_bar_set_progress_value(struct status_bar *sb, * \param value the value to use, or 0 to turn off the progress bar */ void ro_gui_status_bar_set_progress_range(struct status_bar *sb, - unsigned int range) { + unsigned int range) +{ unsigned int old_range; os_error *error; @@ -289,7 +296,8 @@ void ro_gui_status_bar_set_progress_range(struct status_bar *sb, * \param icon the icon to use, or NULL for no icon */ void ro_gui_status_bar_set_progress_icon(struct status_bar *sb, - const char *icon) { + const char *icon) +{ assert(sb); ro_gui_progress_bar_set_icon(sb->pb, icon); @@ -301,8 +309,8 @@ void ro_gui_status_bar_set_progress_icon(struct status_bar *sb, * * \param text the UTF8 text to display, or NULL for none */ -void ro_gui_status_bar_set_text(struct status_bar *sb, const char *text) { - +void ro_gui_status_bar_set_text(struct status_bar *sb, const char *text) +{ assert(sb); /* check for no change */ @@ -340,7 +348,8 @@ void ro_gui_status_bar_set_text(struct status_bar *sb, const char *text) { * * \param sb the status bar to resize */ -void ro_gui_status_bar_resize(struct status_bar *sb) { +void ro_gui_status_bar_resize(struct status_bar *sb) +{ int window_width, window_height; int status_width, status_height; int redraw_left, redraw_right; @@ -435,8 +444,8 @@ void ro_gui_status_bar_resize(struct status_bar *sb) { * * \param redraw the redraw request to process */ -void ro_gui_status_bar_redraw(wimp_draw *redraw) { - +void ro_gui_status_bar_redraw(wimp_draw *redraw) +{ struct status_bar *sb; os_error *error; osbool more; @@ -506,7 +515,8 @@ void ro_gui_status_bar_redraw(wimp_draw *redraw) { * * \param pointer details of the mouse click */ -bool ro_gui_status_bar_click(wimp_pointer *pointer) { +bool ro_gui_status_bar_click(wimp_pointer *pointer) +{ wimp_drag drag; os_error *error; @@ -535,7 +545,8 @@ bool ro_gui_status_bar_click(wimp_pointer *pointer) { * * \param open the request to process */ -void ro_gui_status_bar_open(wimp_open *open) { +void ro_gui_status_bar_open(wimp_open *open) +{ struct status_bar *sb; int window_width, status_width; wimp_window_state state; @@ -571,7 +582,8 @@ void ro_gui_status_bar_open(wimp_open *open) { * * \param sb the status bar to update */ -void ro_gui_status_position_progress_bar(struct status_bar *sb) { +void ro_gui_status_position_progress_bar(struct status_bar *sb) +{ wimp_window_state state; os_error *error; int left, right; diff --git a/riscos/gui/status_bar.h b/riscos/gui/status_bar.h index 0c4d35412..8b5bb35aa 100644 --- a/riscos/gui/status_bar.h +++ b/riscos/gui/status_bar.h @@ -20,11 +20,11 @@ * UTF8 status bar (interface). */ -#include - #ifndef _NETSURF_RISCOS_STATUS_BAR_H_ #define _NETSURF_RISCOS_STATUS_BAR_H_ +#include + struct status_bar; struct status_bar *ro_gui_status_bar_create(wimp_w parent, unsigned int width); -- cgit v1.2.3