Ensure variables are declared correctly

This commit is contained in:
Chris Young 2016-06-02 00:44:20 +01:00
parent df2b14ed5f
commit 88ae1ff267
28 changed files with 56 additions and 43 deletions

View File

@ -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 *);

View File

@ -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)

View File

@ -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;

View File

@ -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)
{

View File

@ -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);

View File

@ -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

View File

@ -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)

View File

@ -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 */

View File

@ -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
{

View File

@ -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

View File

@ -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;

View File

@ -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)

View File

@ -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

View File

@ -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[] = {

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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)
{

View File

@ -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);

View File

@ -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;

View File

@ -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)
{

View File

@ -38,7 +38,7 @@
struct Library *OpenURLBase = NULL;
struct OpenURLIFace *IOpenURL = NULL;
struct MinList *ami_unsupportedprotocols;
static struct MinList *ami_unsupportedprotocols;
struct ami_protocol
{

View File

@ -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);

View File

@ -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);

View File

@ -37,7 +37,7 @@
#define NewnsList NewList
#endif
APTR pool_nsobj = NULL;
static APTR pool_nsobj = NULL;
bool ami_object_init(void)
{

View File

@ -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);
/**

View File

@ -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];

View File

@ -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);