IMG_xcf.c
changeset 80 e793c7a63324
parent 70 ef5fe56a0f07
child 82 fac87f1baeae
     1.1 --- a/IMG_xcf.c	Mon Feb 10 00:39:33 2003 +0000
     1.2 +++ b/IMG_xcf.c	Fri Feb 21 16:50:33 2003 +0000
     1.3 @@ -27,11 +27,14 @@
     1.4  #include <stdio.h>
     1.5  #include <ctype.h>
     1.6  #include <string.h>
     1.7 +#include <stdlib.h>
     1.8  
     1.9 +#include "SDL_endian.h"
    1.10  #include "SDL_image.h"
    1.11  
    1.12  #ifdef LOAD_XCF
    1.13  
    1.14 +#if DEBUG
    1.15  static char prop_names [][30] = {
    1.16    "end",
    1.17    "colormap",
    1.18 @@ -59,6 +62,8 @@
    1.19    "paths",
    1.20    "user_unit"
    1.21  };
    1.22 +#endif
    1.23 +
    1.24  
    1.25  typedef enum
    1.26  {
    1.27 @@ -247,7 +252,7 @@
    1.28    prop->id = SDL_ReadBE32 (src);
    1.29    prop->length = SDL_ReadBE32 (src);
    1.30  
    1.31 -#if 0
    1.32 +#if DEBUG
    1.33    printf ("%.8X: %s: %d\n", SDL_RWtell (src), prop->id < 25 ? prop_names [prop->id] : "unknown", prop->length);
    1.34  #endif
    1.35  
    1.36 @@ -306,7 +311,7 @@
    1.37      if (prop.id == PROP_COMPRESSION)
    1.38        h->compr = prop.data.compression;
    1.39      else if (prop.id == PROP_COLORMAP) {
    1.40 -      int i;
    1.41 +      // unused var: int i;
    1.42  
    1.43        h->cm_num = prop.data.colormap.num;
    1.44        h->cm_map = (char *) malloc (sizeof (char) * 3 * h->cm_num);
    1.45 @@ -384,6 +389,7 @@
    1.46        l->visible = prop.data.visible ? 1 : 0;
    1.47        break;
    1.48      default:
    1.49 +        ;
    1.50      }
    1.51    } while (prop.id != PROP_END);
    1.52  
    1.53 @@ -520,7 +526,7 @@
    1.54  }
    1.55  
    1.56  void create_channel_surface (SDL_Surface * surf, xcf_image_type itype, Uint32 color, Uint32 opacity) {
    1.57 -  Uint32 c;
    1.58 +  Uint32 c = 0;
    1.59  
    1.60    switch (itype) {
    1.61    case IMAGE_RGB:
    1.62 @@ -541,7 +547,7 @@
    1.63    Uint8  * p8;
    1.64    Uint16 * p16;
    1.65    Uint32 * p;
    1.66 -  int x, y, tx, ty, ox, oy, width, height, i, j;
    1.67 +  int x, y, tx, ty, ox, oy, i, j;
    1.68    Uint32 *row;
    1.69  
    1.70    SDL_RWseek (src, layer->hierarchy_file_offset, SEEK_SET);
    1.71 @@ -658,6 +664,8 @@
    1.72    }
    1.73  
    1.74    free_xcf_hierarchy (hierarchy);
    1.75 +  
    1.76 +  return 0;
    1.77  }
    1.78  
    1.79  SDL_Surface *IMG_LoadXCF_RW(SDL_RWops *src) {