Matt Turner 2008-06-06 11:48:45 PDT
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Sep 2009 08:54:15 +0000
changeset 204dcb38b0e78a6
parent 203 b3d13895fd59
child 205 0aa18e250940
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
IMG_png.c
IMG_tif.c
IMG_xcf.c
showimage.c
     1.1 --- a/IMG_jpg.c	Sat Sep 26 08:42:09 2009 +0000
     1.2 +++ b/IMG_jpg.c	Sat Sep 26 08:54:15 2009 +0000
     1.3 @@ -53,7 +53,7 @@
     1.4  } lib;
     1.5  
     1.6  #ifdef LOAD_JPG_DYNAMIC
     1.7 -int IMG_InitJPG()
     1.8 +static int IMG_InitJPG()
     1.9  {
    1.10  	if ( lib.loaded == 0 ) {
    1.11  		lib.handle = SDL_LoadObject(LOAD_JPG_DYNAMIC);
    1.12 @@ -128,7 +128,7 @@
    1.13  
    1.14  	return 0;
    1.15  }
    1.16 -void IMG_QuitJPG()
    1.17 +static void IMG_QuitJPG()
    1.18  {
    1.19  	if ( lib.loaded == 0 ) {
    1.20  		return;
    1.21 @@ -139,7 +139,7 @@
    1.22  	--lib.loaded;
    1.23  }
    1.24  #else
    1.25 -int IMG_InitJPG()
    1.26 +static int IMG_InitJPG()
    1.27  {
    1.28  	if ( lib.loaded == 0 ) {
    1.29  		lib.jpeg_calc_output_dimensions = jpeg_calc_output_dimensions;
    1.30 @@ -156,7 +156,7 @@
    1.31  
    1.32  	return 0;
    1.33  }
    1.34 -void IMG_QuitJPG()
    1.35 +static void IMG_QuitJPG()
    1.36  {
    1.37  	if ( lib.loaded == 0 ) {
    1.38  		return;
     2.1 --- a/IMG_png.c	Sat Sep 26 08:42:09 2009 +0000
     2.2 +++ b/IMG_png.c	Sat Sep 26 08:54:15 2009 +0000
     2.3 @@ -92,7 +92,7 @@
     2.4  } lib;
     2.5  
     2.6  #ifdef LOAD_PNG_DYNAMIC
     2.7 -int IMG_InitPNG()
     2.8 +static int IMG_InitPNG()
     2.9  {
    2.10  	if ( lib.loaded == 0 ) {
    2.11  		lib.handle = SDL_LoadObject(LOAD_PNG_DYNAMIC);
    2.12 @@ -216,7 +216,7 @@
    2.13  
    2.14  	return 0;
    2.15  }
    2.16 -void IMG_QuitPNG()
    2.17 +static void IMG_QuitPNG()
    2.18  {
    2.19  	if ( lib.loaded == 0 ) {
    2.20  		return;
    2.21 @@ -227,7 +227,7 @@
    2.22  	--lib.loaded;
    2.23  }
    2.24  #else
    2.25 -int IMG_InitPNG()
    2.26 +static int IMG_InitPNG()
    2.27  {
    2.28  	if ( lib.loaded == 0 ) {
    2.29  		lib.png_create_info_struct = png_create_info_struct;
    2.30 @@ -251,7 +251,7 @@
    2.31  
    2.32  	return 0;
    2.33  }
    2.34 -void IMG_QuitPNG()
    2.35 +static void IMG_QuitPNG()
    2.36  {
    2.37  	if ( lib.loaded == 0 ) {
    2.38  		return;
     3.1 --- a/IMG_tif.c	Sat Sep 26 08:42:09 2009 +0000
     3.2 +++ b/IMG_tif.c	Sat Sep 26 08:54:15 2009 +0000
     3.3 @@ -41,7 +41,7 @@
     3.4  } lib;
     3.5  
     3.6  #ifdef LOAD_TIF_DYNAMIC
     3.7 -int IMG_InitTIF()
     3.8 +static int IMG_InitTIF()
     3.9  {
    3.10  	if ( lib.loaded == 0 ) {
    3.11  		lib.handle = SDL_LoadObject(LOAD_TIF_DYNAMIC);
    3.12 @@ -88,7 +88,7 @@
    3.13  
    3.14  	return 0;
    3.15  }
    3.16 -void IMG_QuitTIF()
    3.17 +static void IMG_QuitTIF()
    3.18  {
    3.19  	if ( lib.loaded == 0 ) {
    3.20  		return;
    3.21 @@ -99,7 +99,7 @@
    3.22  	--lib.loaded;
    3.23  }
    3.24  #else
    3.25 -int IMG_InitTIF()
    3.26 +static int IMG_InitTIF()
    3.27  {
    3.28  	if ( lib.loaded == 0 ) {
    3.29  		lib.TIFFClientOpen = TIFFClientOpen;
    3.30 @@ -112,7 +112,7 @@
    3.31  
    3.32  	return 0;
    3.33  }
    3.34 -void IMG_QuitTIF()
    3.35 +static void IMG_QuitTIF()
    3.36  {
    3.37  	if ( lib.loaded == 0 ) {
    3.38  		return;
     4.1 --- a/IMG_xcf.c	Sat Sep 26 08:42:09 2009 +0000
     4.2 +++ b/IMG_xcf.c	Sat Sep 26 08:54:15 2009 +0000
     4.3 @@ -251,7 +251,7 @@
     4.4      |  ((v & 0xFF000000));
     4.5  }
     4.6  
     4.7 -void xcf_read_property (SDL_RWops * src, xcf_prop * prop) {
     4.8 +static void xcf_read_property (SDL_RWops * src, xcf_prop * prop) {
     4.9    prop->id = SDL_ReadBE32 (src);
    4.10    prop->length = SDL_ReadBE32 (src);
    4.11  
    4.12 @@ -286,14 +286,14 @@
    4.13    }
    4.14  }
    4.15  
    4.16 -void free_xcf_header (xcf_header * h) {
    4.17 +static void free_xcf_header (xcf_header * h) {
    4.18    if (h->cm_num)
    4.19      free (h->cm_map);
    4.20  
    4.21    free (h);
    4.22  }
    4.23  
    4.24 -xcf_header * read_xcf_header (SDL_RWops * src) {
    4.25 +static xcf_header * read_xcf_header (SDL_RWops * src) {
    4.26    xcf_header * h;
    4.27    xcf_prop prop;
    4.28  
    4.29 @@ -326,12 +326,12 @@
    4.30    return h;
    4.31  }
    4.32  
    4.33 -void free_xcf_layer (xcf_layer * l) {
    4.34 +static void free_xcf_layer (xcf_layer * l) {
    4.35    free (l->name);
    4.36    free (l);
    4.37  }
    4.38  
    4.39 -xcf_layer * read_xcf_layer (SDL_RWops * src) {
    4.40 +static xcf_layer * read_xcf_layer (SDL_RWops * src) {
    4.41    xcf_layer * l;
    4.42    xcf_prop    prop;
    4.43  
    4.44 @@ -358,12 +358,12 @@
    4.45    return l;
    4.46  }
    4.47  
    4.48 -void free_xcf_channel (xcf_channel * c) {
    4.49 +static void free_xcf_channel (xcf_channel * c) {
    4.50    free (c->name);
    4.51    free (c);
    4.52  }
    4.53  
    4.54 -xcf_channel * read_xcf_channel (SDL_RWops * src) {
    4.55 +static xcf_channel * read_xcf_channel (SDL_RWops * src) {
    4.56    xcf_channel * l;
    4.57    xcf_prop    prop;
    4.58  
    4.59 @@ -401,12 +401,12 @@
    4.60    return l;
    4.61  }
    4.62  
    4.63 -void free_xcf_hierarchy (xcf_hierarchy * h) {
    4.64 +static void free_xcf_hierarchy (xcf_hierarchy * h) {
    4.65    free (h->level_file_offsets);
    4.66    free (h);
    4.67  }
    4.68  
    4.69 -xcf_hierarchy * read_xcf_hierarchy (SDL_RWops * src) {
    4.70 +static xcf_hierarchy * read_xcf_hierarchy (SDL_RWops * src) {
    4.71    xcf_hierarchy * h;
    4.72    int i;
    4.73  
    4.74 @@ -425,12 +425,12 @@
    4.75    return h;
    4.76  }
    4.77  
    4.78 -void free_xcf_level (xcf_level * l) {
    4.79 +static void free_xcf_level (xcf_level * l) {
    4.80    free (l->tile_file_offsets);
    4.81    free (l);
    4.82  }
    4.83  
    4.84 -xcf_level * read_xcf_level (SDL_RWops * src) {
    4.85 +static xcf_level * read_xcf_level (SDL_RWops * src) {
    4.86    xcf_level * l;
    4.87    int i;
    4.88  
    4.89 @@ -448,11 +448,11 @@
    4.90    return l;
    4.91  }
    4.92  
    4.93 -void free_xcf_tile (unsigned char * t) {
    4.94 +static void free_xcf_tile (unsigned char * t) {
    4.95    free (t);
    4.96  }
    4.97  
    4.98 -unsigned char * load_xcf_tile_none (SDL_RWops * src, Uint32 len, int bpp, int x, int y) {
    4.99 +static unsigned char * load_xcf_tile_none (SDL_RWops * src, Uint32 len, int bpp, int x, int y) {
   4.100    unsigned char * load;
   4.101  
   4.102    load = (unsigned char *) malloc (len); // expect this is okay
   4.103 @@ -461,7 +461,7 @@
   4.104    return load;
   4.105  }
   4.106  
   4.107 -unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, int x, int y) {
   4.108 +static unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, int x, int y) {
   4.109    unsigned char * load, * t, * data, * d;
   4.110    Uint32 reallen;
   4.111    int i, size, count, j, length;
   4.112 @@ -528,7 +528,7 @@
   4.113    return (l << 16) | (l << 8) | l;
   4.114  }
   4.115  
   4.116 -void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 color, Uint32 opacity) {
   4.117 +static void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 color, Uint32 opacity) {
   4.118    Uint32 c = 0;
   4.119  
   4.120    switch (itype) {
   4.121 @@ -543,7 +543,7 @@
   4.122    SDL_FillRect (surf, NULL, c);
   4.123  }
   4.124  
   4.125 -int do_layer_surface (SDL_Surface * surface, SDL_RWops * src, xcf_header * head, xcf_layer * layer, load_tile_type load_tile) {
   4.126 +static int do_layer_surface (SDL_Surface * surface, SDL_RWops * src, xcf_header * head, xcf_layer * layer, load_tile_type load_tile) {
   4.127    xcf_hierarchy * hierarchy;
   4.128    xcf_level     * level;
   4.129    unsigned char * tile;
     5.1 --- a/showimage.c	Sat Sep 26 08:42:09 2009 +0000
     5.2 +++ b/showimage.c	Sat Sep 26 08:54:15 2009 +0000
     5.3 @@ -35,7 +35,7 @@
     5.4  #endif
     5.5  
     5.6  /* Draw a Gimpish background pattern to show transparency in the image */
     5.7 -void draw_background(SDL_Surface *screen)
     5.8 +static void draw_background(SDL_Surface *screen)
     5.9  {
    5.10      Uint8 *dst = screen->pixels;
    5.11      int x, y;