From ef19b694c83b22f09b5a0fd7655ffcf08be068ed Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 26 Sep 2009 08:54:15 +0000 Subject: [PATCH] Matt Turner 2008-06-06 11:48:45 PDT Quite a few functions in SDL_image can be marked as static, AFAICS. Such functions are IMG_Init* and IMG_Quit* functions. --- IMG_jpg.c | 8 ++++---- IMG_png.c | 8 ++++---- IMG_tif.c | 8 ++++---- IMG_xcf.c | 32 ++++++++++++++++---------------- showimage.c | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/IMG_jpg.c b/IMG_jpg.c index 311b74db..3b6ac672 100644 --- a/IMG_jpg.c +++ b/IMG_jpg.c @@ -53,7 +53,7 @@ static struct { } lib; #ifdef LOAD_JPG_DYNAMIC -int IMG_InitJPG() +static int IMG_InitJPG() { if ( lib.loaded == 0 ) { lib.handle = SDL_LoadObject(LOAD_JPG_DYNAMIC); @@ -128,7 +128,7 @@ int IMG_InitJPG() return 0; } -void IMG_QuitJPG() +static void IMG_QuitJPG() { if ( lib.loaded == 0 ) { return; @@ -139,7 +139,7 @@ void IMG_QuitJPG() --lib.loaded; } #else -int IMG_InitJPG() +static int IMG_InitJPG() { if ( lib.loaded == 0 ) { lib.jpeg_calc_output_dimensions = jpeg_calc_output_dimensions; @@ -156,7 +156,7 @@ int IMG_InitJPG() return 0; } -void IMG_QuitJPG() +static void IMG_QuitJPG() { if ( lib.loaded == 0 ) { return; diff --git a/IMG_png.c b/IMG_png.c index bb668d23..794b75f4 100644 --- a/IMG_png.c +++ b/IMG_png.c @@ -92,7 +92,7 @@ static struct { } lib; #ifdef LOAD_PNG_DYNAMIC -int IMG_InitPNG() +static int IMG_InitPNG() { if ( lib.loaded == 0 ) { lib.handle = SDL_LoadObject(LOAD_PNG_DYNAMIC); @@ -216,7 +216,7 @@ int IMG_InitPNG() return 0; } -void IMG_QuitPNG() +static void IMG_QuitPNG() { if ( lib.loaded == 0 ) { return; @@ -227,7 +227,7 @@ void IMG_QuitPNG() --lib.loaded; } #else -int IMG_InitPNG() +static int IMG_InitPNG() { if ( lib.loaded == 0 ) { lib.png_create_info_struct = png_create_info_struct; @@ -251,7 +251,7 @@ int IMG_InitPNG() return 0; } -void IMG_QuitPNG() +static void IMG_QuitPNG() { if ( lib.loaded == 0 ) { return; diff --git a/IMG_tif.c b/IMG_tif.c index 78c2f79a..17dc7719 100644 --- a/IMG_tif.c +++ b/IMG_tif.c @@ -41,7 +41,7 @@ static struct { } lib; #ifdef LOAD_TIF_DYNAMIC -int IMG_InitTIF() +static int IMG_InitTIF() { if ( lib.loaded == 0 ) { lib.handle = SDL_LoadObject(LOAD_TIF_DYNAMIC); @@ -88,7 +88,7 @@ int IMG_InitTIF() return 0; } -void IMG_QuitTIF() +static void IMG_QuitTIF() { if ( lib.loaded == 0 ) { return; @@ -99,7 +99,7 @@ void IMG_QuitTIF() --lib.loaded; } #else -int IMG_InitTIF() +static int IMG_InitTIF() { if ( lib.loaded == 0 ) { lib.TIFFClientOpen = TIFFClientOpen; @@ -112,7 +112,7 @@ int IMG_InitTIF() return 0; } -void IMG_QuitTIF() +static void IMG_QuitTIF() { if ( lib.loaded == 0 ) { return; diff --git a/IMG_xcf.c b/IMG_xcf.c index e9a2a108..de9314de 100644 --- a/IMG_xcf.c +++ b/IMG_xcf.c @@ -251,7 +251,7 @@ static Uint32 Swap32 (Uint32 v) { | ((v & 0xFF000000)); } -void xcf_read_property (SDL_RWops * src, xcf_prop * prop) { +static void xcf_read_property (SDL_RWops * src, xcf_prop * prop) { prop->id = SDL_ReadBE32 (src); prop->length = SDL_ReadBE32 (src); @@ -286,14 +286,14 @@ void xcf_read_property (SDL_RWops * src, xcf_prop * prop) { } } -void free_xcf_header (xcf_header * h) { +static void free_xcf_header (xcf_header * h) { if (h->cm_num) free (h->cm_map); free (h); } -xcf_header * read_xcf_header (SDL_RWops * src) { +static xcf_header * read_xcf_header (SDL_RWops * src) { xcf_header * h; xcf_prop prop; @@ -326,12 +326,12 @@ xcf_header * read_xcf_header (SDL_RWops * src) { return h; } -void free_xcf_layer (xcf_layer * l) { +static void free_xcf_layer (xcf_layer * l) { free (l->name); free (l); } -xcf_layer * read_xcf_layer (SDL_RWops * src) { +static xcf_layer * read_xcf_layer (SDL_RWops * src) { xcf_layer * l; xcf_prop prop; @@ -358,12 +358,12 @@ xcf_layer * read_xcf_layer (SDL_RWops * src) { return l; } -void free_xcf_channel (xcf_channel * c) { +static void free_xcf_channel (xcf_channel * c) { free (c->name); free (c); } -xcf_channel * read_xcf_channel (SDL_RWops * src) { +static xcf_channel * read_xcf_channel (SDL_RWops * src) { xcf_channel * l; xcf_prop prop; @@ -401,12 +401,12 @@ xcf_channel * read_xcf_channel (SDL_RWops * src) { return l; } -void free_xcf_hierarchy (xcf_hierarchy * h) { +static void free_xcf_hierarchy (xcf_hierarchy * h) { free (h->level_file_offsets); free (h); } -xcf_hierarchy * read_xcf_hierarchy (SDL_RWops * src) { +static xcf_hierarchy * read_xcf_hierarchy (SDL_RWops * src) { xcf_hierarchy * h; int i; @@ -425,12 +425,12 @@ xcf_hierarchy * read_xcf_hierarchy (SDL_RWops * src) { return h; } -void free_xcf_level (xcf_level * l) { +static void free_xcf_level (xcf_level * l) { free (l->tile_file_offsets); free (l); } -xcf_level * read_xcf_level (SDL_RWops * src) { +static xcf_level * read_xcf_level (SDL_RWops * src) { xcf_level * l; int i; @@ -448,11 +448,11 @@ xcf_level * read_xcf_level (SDL_RWops * src) { return l; } -void free_xcf_tile (unsigned char * t) { +static void free_xcf_tile (unsigned char * t) { free (t); } -unsigned char * load_xcf_tile_none (SDL_RWops * src, Uint32 len, int bpp, int x, int y) { +static unsigned char * load_xcf_tile_none (SDL_RWops * src, Uint32 len, int bpp, int x, int y) { unsigned char * load; load = (unsigned char *) malloc (len); // expect this is okay @@ -461,7 +461,7 @@ unsigned char * load_xcf_tile_none (SDL_RWops * src, Uint32 len, int bpp, int x, return load; } -unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, int x, int y) { +static unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, int x, int y) { unsigned char * load, * t, * data, * d; Uint32 reallen; int i, size, count, j, length; @@ -528,7 +528,7 @@ static Uint32 rgb2grey (Uint32 a) { return (l << 16) | (l << 8) | l; } -void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 color, Uint32 opacity) { +static void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 color, Uint32 opacity) { Uint32 c = 0; switch (itype) { @@ -543,7 +543,7 @@ void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 co SDL_FillRect (surf, NULL, c); } -int do_layer_surface (SDL_Surface * surface, SDL_RWops * src, xcf_header * head, xcf_layer * layer, load_tile_type load_tile) { +static int do_layer_surface (SDL_Surface * surface, SDL_RWops * src, xcf_header * head, xcf_layer * layer, load_tile_type load_tile) { xcf_hierarchy * hierarchy; xcf_level * level; unsigned char * tile; diff --git a/showimage.c b/showimage.c index 706365a6..1b1183d2 100644 --- a/showimage.c +++ b/showimage.c @@ -35,7 +35,7 @@ #endif /* Draw a Gimpish background pattern to show transparency in the image */ -void draw_background(SDL_Surface *screen) +static void draw_background(SDL_Surface *screen) { Uint8 *dst = screen->pixels; int x, y;