From 88ae1ff267c541ded537672ac7b7f29308ad701d Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 2 Jun 2016 00:44:20 +0100 Subject: [PATCH] Ensure variables are declared correctly --- frontends/amiga/arexx.c | 2 +- frontends/amiga/bitmap.c | 2 +- frontends/amiga/bitmap.h | 2 +- frontends/amiga/clipboard.c | 2 +- frontends/amiga/cookies.c | 2 ++ frontends/amiga/cookies.h | 2 +- frontends/amiga/download.c | 2 +- frontends/amiga/dt_anim.c | 4 ++-- frontends/amiga/filetype.c | 2 +- frontends/amiga/font.h | 2 +- frontends/amiga/font_bullet.c | 2 +- frontends/amiga/gui_options.c | 16 +++++++++------- frontends/amiga/gui_options.h | 2 +- frontends/amiga/help.c | 4 ++-- frontends/amiga/history.c | 2 ++ frontends/amiga/history.h | 2 +- frontends/amiga/history_local.c | 4 ++-- frontends/amiga/hotlist.c | 1 + frontends/amiga/hotlist.h | 2 +- frontends/amiga/icon.c | 4 ++-- frontends/amiga/iff_dr2d.c | 4 ++-- frontends/amiga/launch.c | 2 +- frontends/amiga/menu.c | 12 ++++++++---- frontends/amiga/menu.h | 4 ++-- frontends/amiga/object.c | 2 +- frontends/amiga/selectmenu.h | 2 -- frontends/amiga/theme.c | 9 ++++++--- frontends/amiga/theme.h | 3 ++- 28 files changed, 56 insertions(+), 43 deletions(-) diff --git a/frontends/amiga/arexx.c b/frontends/amiga/arexx.c index 534391b8a..6f2ca0c1b 100644 --- a/frontends/amiga/arexx.c +++ b/frontends/amiga/arexx.c @@ -68,7 +68,7 @@ enum RX_HOTLIST }; -Object *arexx_obj = NULL; +static Object *arexx_obj = NULL; STATIC char result[100]; STATIC VOID rx_open(struct ARexxCmd *, struct RexxMsg *); diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c index 2dc0719bb..8d1815298 100644 --- a/frontends/amiga/bitmap.c +++ b/frontends/amiga/bitmap.c @@ -78,7 +78,7 @@ enum { AMI_NSBM_PALETTEMAPPED }; -APTR pool_bitmap = NULL; +static APTR pool_bitmap = NULL; /* exported function documented in amiga/bitmap.h */ void *amiga_bitmap_create(int width, int height, unsigned int state) diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h index d7dd70bce..9a657a60a 100755 --- a/frontends/amiga/bitmap.h +++ b/frontends/amiga/bitmap.h @@ -28,7 +28,7 @@ #define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8 #define AMI_BITMAP_SCALE_ICON 0xFF -struct gui_bitmap_table *amiga_bitmap_table; +extern struct gui_bitmap_table *amiga_bitmap_table; struct bitmap; struct nsurl; diff --git a/frontends/amiga/clipboard.c b/frontends/amiga/clipboard.c index bcdc51c97..3a96456c6 100644 --- a/frontends/amiga/clipboard.c +++ b/frontends/amiga/clipboard.c @@ -50,7 +50,7 @@ #define ID_UTF8 MAKE_ID('U','T','F','8') -struct IFFHandle *iffh = NULL; +static struct IFFHandle *iffh = NULL; static struct IFFHandle *ami_clipboard_init_internal(int unit) { diff --git a/frontends/amiga/cookies.c b/frontends/amiga/cookies.c index c775c8316..15f6dcef4 100755 --- a/frontends/amiga/cookies.c +++ b/frontends/amiga/cookies.c @@ -25,6 +25,8 @@ #include "amiga/cookies.h" #include "amiga/tree.h" +struct treeview_window *cookies_window; + void ami_cookies_initialise(void) { cookies_window = ami_tree_create(TREE_COOKIES, NULL); diff --git a/frontends/amiga/cookies.h b/frontends/amiga/cookies.h index d6922750c..85e553cb8 100755 --- a/frontends/amiga/cookies.h +++ b/frontends/amiga/cookies.h @@ -24,5 +24,5 @@ void ami_cookies_initialise(void); void ami_cookies_free(void); -struct treeview_window *cookies_window; +extern struct treeview_window *cookies_window; #endif diff --git a/frontends/amiga/download.c b/frontends/amiga/download.c index f39ddaede..b9fecf362 100644 --- a/frontends/amiga/download.c +++ b/frontends/amiga/download.c @@ -89,7 +89,7 @@ enum { AMINS_DLOAD_ABORT, }; -int downloads_in_progress = 0; +static int downloads_in_progress = 0; static struct gui_download_window *gui_download_window_create(download_context *ctx, struct gui_window *gui) diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c index c177321e1..04f1ce27d 100644 --- a/frontends/amiga/dt_anim.c +++ b/frontends/amiga/dt_anim.c @@ -59,7 +59,7 @@ typedef struct amiga_dt_anim_content { int h; } amiga_dt_anim_content; -APTR ami_colormap_to_clut(struct ColorMap *cmap); +static APTR ami_colormap_to_clut(struct ColorMap *cmap); static nserror amiga_dt_anim_create(const content_handler *handler, lwc_string *imime_type, const struct http_parameter *params, @@ -339,7 +339,7 @@ content_type amiga_dt_anim_content_type(void) return CONTENT_IMAGE; } -APTR ami_colormap_to_clut(struct ColorMap *cmap) +static APTR ami_colormap_to_clut(struct ColorMap *cmap) { int i; UBYTE *clut = ami_misc_allocvec_clear(256 * 4, 0); /* NB: Was not MEMF_PRIVATE */ diff --git a/frontends/amiga/filetype.c b/frontends/amiga/filetype.c index 39058b41c..d598f530c 100644 --- a/frontends/amiga/filetype.c +++ b/frontends/amiga/filetype.c @@ -37,7 +37,7 @@ * filetype -- determine the MIME type of a local file */ -struct MinList *ami_mime_list = NULL; +static struct MinList *ami_mime_list = NULL; struct ami_mime_entry { diff --git a/frontends/amiga/font.h b/frontends/amiga/font.h index 5e0721167..4f5821115 100755 --- a/frontends/amiga/font.h +++ b/frontends/amiga/font.h @@ -57,7 +57,7 @@ struct ami_font_functions { const struct ami_font_functions *ami_nsfont; -struct gui_layout_table *ami_layout_table; +extern struct gui_layout_table *ami_layout_table; #endif diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c index 67204d664..b0c2999a1 100644 --- a/frontends/amiga/font_bullet.c +++ b/frontends/amiga/font_bullet.c @@ -131,7 +131,7 @@ const uint16 sc_table[] = { #endif 0, 0}; -lwc_string *glypharray[0xffff + 1]; +static lwc_string *glypharray[0xffff + 1]; static struct List ami_diskfontlib_list; diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c index f8be3bc6a..340af4b27 100755 --- a/frontends/amiga/gui_options.c +++ b/frontends/amiga/gui_options.c @@ -232,16 +232,18 @@ struct ami_gui_opts_window { #endif }; +char *current_user_options = NULL; + static struct ami_gui_opts_window *gow = NULL; -CONST_STRPTR tabs[OPTS_MAX_TABS]; +static CONST_STRPTR tabs[OPTS_MAX_TABS]; static STRPTR screenopts[OPTS_MAX_SCREEN]; -CONST_STRPTR proxyopts[OPTS_MAX_PROXY]; -CONST_STRPTR nativebmopts[OPTS_MAX_NATIVEBM]; -CONST_STRPTR ditheropts[OPTS_MAX_DITHER]; -CONST_STRPTR fontopts[6]; -CONST_STRPTR gadlab[OPTS_LAST]; -struct List *websearch_list; +static CONST_STRPTR proxyopts[OPTS_MAX_PROXY]; +static CONST_STRPTR nativebmopts[OPTS_MAX_NATIVEBM]; +static CONST_STRPTR ditheropts[OPTS_MAX_DITHER]; +static CONST_STRPTR fontopts[6]; +static CONST_STRPTR gadlab[OPTS_LAST]; +static struct List *websearch_list; #ifndef __amigaos4__ static void ami_gui_opts_array_to_list(struct List *list, const char *array[], int type) diff --git a/frontends/amiga/gui_options.h b/frontends/amiga/gui_options.h index 04c1be51e..3d680845b 100755 --- a/frontends/amiga/gui_options.h +++ b/frontends/amiga/gui_options.h @@ -27,6 +27,6 @@ void ami_gui_opts_close(void); struct List *ami_gui_opts_websearch(void); void ami_gui_opts_websearch_free(struct List *websearchlist); -char *current_user_options; +extern char *current_user_options; #endif diff --git a/frontends/amiga/help.c b/frontends/amiga/help.c index 64b338426..fe1f1241d 100755 --- a/frontends/amiga/help.c +++ b/frontends/amiga/help.c @@ -23,8 +23,8 @@ /* AmigaGuide class */ #include "amiga/agclass/amigaguide_class.h" -Class *AmigaGuideClass = NULL; -Object *AmigaGuideObject = NULL; +static Class *AmigaGuideClass = NULL; +static Object *AmigaGuideObject = NULL; /* This array needs to match the enum in help.h */ CONST_STRPTR context_nodes[] = { diff --git a/frontends/amiga/history.c b/frontends/amiga/history.c index bc16d3000..2287c7069 100755 --- a/frontends/amiga/history.c +++ b/frontends/amiga/history.c @@ -27,6 +27,8 @@ #include "amiga/tree.h" #include "amiga/tree.h" +struct treeview_window *global_history_window = NULL; + void ami_global_history_initialise(void) { global_history_window = ami_tree_create(TREE_HISTORY, NULL); diff --git a/frontends/amiga/history.h b/frontends/amiga/history.h index 1f064746a..d20cfe0e1 100755 --- a/frontends/amiga/history.h +++ b/frontends/amiga/history.h @@ -25,5 +25,5 @@ void ami_global_history_initialise(void); void ami_global_history_free(void); -struct treeview_window *global_history_window; +extern struct treeview_window *global_history_window; #endif diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c index e7171e2b2..e08349616 100755 --- a/frontends/amiga/history_local.c +++ b/frontends/amiga/history_local.c @@ -57,7 +57,7 @@ #include "amiga/gui.h" #include "amiga/history_local.h" -void ami_history_update_extent(struct history_window *hw); +static void ami_history_update_extent(struct history_window *hw); HOOKF(void, ami_history_scroller_hook, Object *, object, struct IntuiMessage *); /** @@ -295,7 +295,7 @@ BOOL ami_history_event(struct history_window *hw) return FALSE; } -void ami_history_update_extent(struct history_window *hw) +static void ami_history_update_extent(struct history_window *hw) { struct IBox *bbox; int width, height; diff --git a/frontends/amiga/hotlist.c b/frontends/amiga/hotlist.c index 44691742c..fc2342d73 100755 --- a/frontends/amiga/hotlist.c +++ b/frontends/amiga/hotlist.c @@ -37,6 +37,7 @@ struct ami_hotlist_ctx { bool (*cb)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder); }; +struct treeview_window *hotlist_window = NULL; void ami_hotlist_initialise(const char *hotlist_file) { diff --git a/frontends/amiga/hotlist.h b/frontends/amiga/hotlist.h index 23a97480b..113a2d1c0 100755 --- a/frontends/amiga/hotlist.h +++ b/frontends/amiga/hotlist.h @@ -22,7 +22,7 @@ struct nsurl; struct treeview_window; -struct treeview_window *hotlist_window; +extern struct treeview_window *hotlist_window; void ami_hotlist_initialise(const char *hotlist_file); diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c index 201ce5f78..f19797676 100644 --- a/frontends/amiga/icon.c +++ b/frontends/amiga/icon.c @@ -53,7 +53,7 @@ #define THUMBNAIL_WIDTH 100 /* Icon sizes for thumbnails, usually the same as */ #define THUMBNAIL_HEIGHT 86 /* WIDTH/HEIGHT in desktop/thumbnail.c */ -ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height, +static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height, ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha); #ifdef WITH_AMIGA_ICON @@ -314,7 +314,7 @@ content_type amiga_icon_content_type(void) #endif /* WITH_AMIGA_ICON */ -ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height, +static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG height, ULONG trans, ULONG pals1, struct ColorRegister *pal1, int alpha) { ULONG *argbicon; diff --git a/frontends/amiga/iff_dr2d.c b/frontends/amiga/iff_dr2d.c index a4d17386b..d4e3b220c 100644 --- a/frontends/amiga/iff_dr2d.c +++ b/frontends/amiga/iff_dr2d.c @@ -36,8 +36,8 @@ #include "misc.h" #endif -struct ColorRegister cm[1000]; -ULONG numcols; +static struct ColorRegister cm[1000]; +static ULONG numcols; static ULONG findcolour(ULONG newcol) { diff --git a/frontends/amiga/launch.c b/frontends/amiga/launch.c index 1f2b9e16c..8020dd6b8 100755 --- a/frontends/amiga/launch.c +++ b/frontends/amiga/launch.c @@ -38,7 +38,7 @@ struct Library *OpenURLBase = NULL; struct OpenURLIFace *IOpenURL = NULL; -struct MinList *ami_unsupportedprotocols; +static struct MinList *ami_unsupportedprotocols; struct ami_protocol { diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c index 4fa5ba19f..e1017cd1f 100644 --- a/frontends/amiga/menu.c +++ b/frontends/amiga/menu.c @@ -87,12 +87,16 @@ enum { NSA_GLYPH_MAX }; -BOOL menualreadyinit; +struct gui_window_2 *ami_menu_window_close = NULL; +bool ami_menu_check_toggled = false; + +static BOOL menualreadyinit; +static Object *menu_glyph[NSA_GLYPH_MAX]; +static int menu_glyph_width[NSA_GLYPH_MAX]; +static bool menu_glyphs_loaded = false; + const char * const netsurf_version; const char * const verdate; -Object *menu_glyph[NSA_GLYPH_MAX]; -int menu_glyph_width[NSA_GLYPH_MAX]; -bool menu_glyphs_loaded = false; static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin); void ami_menu_arexx_scan(struct gui_window_2 *gwin); diff --git a/frontends/amiga/menu.h b/frontends/amiga/menu.h index 3bec113d0..22e998439 100755 --- a/frontends/amiga/menu.h +++ b/frontends/amiga/menu.h @@ -135,8 +135,8 @@ enum { struct gui_window; struct gui_window_2; -struct gui_window_2 *ami_menu_window_close; -bool ami_menu_check_toggled; +extern struct gui_window_2 *ami_menu_window_close; +extern bool ami_menu_check_toggled; void ami_free_menulabs(struct gui_window_2 *gwin); struct Menu *ami_menu_create(struct gui_window_2 *gwin); diff --git a/frontends/amiga/object.c b/frontends/amiga/object.c index 8da16394e..6459d63c0 100755 --- a/frontends/amiga/object.c +++ b/frontends/amiga/object.c @@ -37,7 +37,7 @@ #define NewnsList NewList #endif -APTR pool_nsobj = NULL; +static APTR pool_nsobj = NULL; bool ami_object_init(void) { diff --git a/frontends/amiga/selectmenu.h b/frontends/amiga/selectmenu.h index f55b6ca98..920b7e738 100755 --- a/frontends/amiga/selectmenu.h +++ b/frontends/amiga/selectmenu.h @@ -24,8 +24,6 @@ struct gui_window; struct form_control; -BOOL popupmenu_lib_ok; - void gui_create_form_select_menu(struct gui_window *g, struct form_control *control); /** diff --git a/frontends/amiga/theme.c b/frontends/amiga/theme.c index 40a9503c8..e18ee3365 100644 --- a/frontends/amiga/theme.c +++ b/frontends/amiga/theme.c @@ -51,9 +51,12 @@ #include "amiga/theme.h" #include "amiga/misc.h" -struct BitMap *throbber = NULL; -struct bitmap *throbber_nsbm = NULL; -int throbber_frames, throbber_update_interval; +ULONG throbber_width; +ULONG throbber_height; + +static struct BitMap *throbber = NULL; +static struct bitmap *throbber_nsbm = NULL; +static int throbber_frames, throbber_update_interval; static Object *mouseptrobj[AMI_LASTPOINTER+1]; static struct BitMap *mouseptrbm[AMI_LASTPOINTER+1]; diff --git a/frontends/amiga/theme.h b/frontends/amiga/theme.h index 34a8dd5c3..bf6ba57f7 100644 --- a/frontends/amiga/theme.h +++ b/frontends/amiga/theme.h @@ -28,7 +28,8 @@ struct gui_window; #define AMI_GUI_POINTER_DRAG GUI_POINTER_PROGRESS+2 #define AMI_LASTPOINTER AMI_GUI_POINTER_DRAG -ULONG throbber_width, throbber_height; +extern ULONG throbber_width; +extern ULONG throbber_height; void ami_theme_init(void); void ami_get_theme_filename(char *filename, const char *themestring, bool protocol);