]> git.imager.perl.org - imager.git/commitdiff
compiler warning cleanup
authorTony Cook <tony@develop=help.com>
Mon, 27 Aug 2007 13:59:23 +0000 (13:59 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 27 Aug 2007 13:59:23 +0000 (13:59 +0000)
ICO/imicon.c
Imager.xs
dynfilt/dt2.c
dynfilt/flines.c
dynfilt/mandelbrot.c
font.c
freetyp2.c
gif.c

index 2fc62deb7fe5bc7f76b84b91eb889387c291cf6e..c132f68a9eb62c4143d174c52f171435b117426e 100644 (file)
@@ -156,8 +156,9 @@ read_one_icon(ico_reader_t *file, int index, int masked) {
 
     for (y = 0; y < image->height; ++y) {
       int changed = 0;
-      int first;
-      int last;
+      int first = 0;
+      int last = 0;
+
       for (x = 0; x < image->width; ++x) {
        if (*inp++) {
          if (!changed) {
index c59815d6ce2f3017704e5ca09b1f6d9e264b8e78..9b6e65138394fbe597470c54f3646563ca86b685 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -3991,8 +3991,10 @@ i_glinf(im, l, r, y)
       PREINIT:
         i_fcolor *vals;
         int count, i;
-        i_fcolor zero = { 0 };
+        i_fcolor zero;
       PPCODE:
+       for (i = 0; i < MAXCHANNELS; ++i)
+         zero.channel[i] = 0;
         if (l < r) {
           vals = mymalloc((r-l) * sizeof(i_fcolor));
           for (i = 0; i < r-l; ++i)
index 9806cefeaad77386f32b3b844711d2b6be4489a6..d25de40dbbc1d7e73a1298268055ae2d514567dc 100644 (file)
@@ -14,15 +14,14 @@ void
 html_art(void *INP) {
   i_img *im;
   i_color rcolor;
-  int i,x,y;
-  int info[4];
+  int x,y;
   FILE *fp;
   char *fname;
 
   if ( !getSTR("fname",&fname) ) { fprintf(stderr,"Error: filename is missing\n"); return; } 
   if ( !getOBJ("image","Imager::ImgRaw",&im) ) { fprintf(stderr,"Error: image is missing\n"); return; }
   
-  printf("parameters: (im 0x%x,fname %s)\n",im,fname); 
+  printf("parameters: (im 0x%p,fname %s)\n",im,fname); 
 
   printf("image info:\n size (%d,%d)\n channels (%d)\n channel mask (%d)\n bytes (%d)\n",im->xsize,im->ysize,im->channels,im->ch_mask,im->bytes); 
 
index 95d982eb76c371980be78ecf86bfca7e4b80e439..79ac9a9da4ea9b71753b87b93ee2a3112e194a04 100644 (file)
@@ -23,8 +23,7 @@ void
 flines(void *INP) {
   i_img *im;
   i_color vl;
-  int i,bytes,x,y;
-  int idx;
+  int x,y;
   
   if ( !getOBJ("image","Imager::ImgRaw",&im) ) {
                fprintf(stderr,"Error: image is missing\n"); 
index 09d88fb94a159e9139bb3f840924a19bbbd2fb5a..fdab28ecebd591054fabd1d65eeccfe4f44576e0 100644 (file)
@@ -17,7 +17,6 @@ int
 mandel(float x, float y) {
   float xn, yn;
   float xo, yo;
-  float dist;
   int iter = 1;
   /*   Z(n+1) = Z(n) ^2 + c */
 
@@ -64,7 +63,7 @@ void mandlebrot(void *INP) {
   
   if ( !getOBJ("image","Imager::ImgRaw",&im) ) { fprintf(stderr,"Error: image is missing\n"); }
   
-  fprintf(stderr,"mandlebrot: parameters: (im 0x%x)\n",im);
+  fprintf(stderr,"mandlebrot: parameters: (im %p)\n",im);
   bytes=im->bytes;
 
   fprintf(stderr, "mandlebrot: image info:\n size (%d,%d)\n channels (%d)\n channel mask (%d)\n bytes (%d)\n",im->xsize,im->ysize,im->channels,im->ch_mask,im->bytes); 
diff --git a/font.c b/font.c
index b8f33a1033a6818ab7c4a1325477b4144617aabe..0ab6f912fa7e17933c6413abad1156257546a9a5 100644 (file)
--- a/font.c
+++ b/font.c
@@ -407,9 +407,7 @@ Interface to text rendering in a single color onto an image
 undef_int
 i_t1_text(i_img *im,int xb,int yb,const i_color *cl,int fontnum,float points,const char* str,int len,int align, int utf8, char const *flags) {
   GLYPH *glyph;
-  int xsize,ysize,x,y,ch;
-  i_color val;
-  unsigned char c,i;
+  int xsize,ysize,y;
   int mod_flags = t1_get_flags(flags);
   i_render r;
 
@@ -442,7 +440,7 @@ i_t1_text(i_img *im,int xb,int yb,const i_color *cl,int fontnum,float points,con
 
   i_render_init(&r, im, xsize);
   for(y=0;y<ysize;y++) {
-    i_render_color(&r, xb, yb+y, xsize, glyph->bits+y*xsize, cl);
+    i_render_color(&r, xb, yb+y, xsize, (unsigned char *)glyph->bits+y*xsize, cl);
   }
   i_render_done(&r);
     
@@ -1515,8 +1513,7 @@ static
 void
 i_tt_dump_raster_map2( i_img* im, TT_Raster_Map* bit, int xb, int yb, const i_color *cl, int smooth ) {
   unsigned char *bmap;
-  i_color val;
-  int c, i, ch, x, y;
+  int x, y;
   mm_log((1,"i_tt_dump_raster_map2(im 0x%x, bit 0x%X, xb %d, yb %d, cl 0x%X)\n",im,bit,xb,yb,cl));
   
   bmap = bit->bitmap;
@@ -1578,7 +1575,7 @@ Function to dump a raster onto a single channel image in color (internal)
 static
 void
 i_tt_dump_raster_map_channel( i_img* im, TT_Raster_Map*  bit, int xb, int yb, int channel, int smooth ) {
-  char *bmap;
+  unsigned char *bmap;
   i_color val;
   int c,x,y;
   int old_mask = im->ch_mask;
@@ -1586,7 +1583,7 @@ i_tt_dump_raster_map_channel( i_img* im, TT_Raster_Map*  bit, int xb, int yb, in
 
   mm_log((1,"i_tt_dump_raster_channel(im 0x%x, bit 0x%X, xb %d, yb %d, channel %d)\n",im,bit,xb,yb,channel));
   
-  bmap = (char *)bit->bitmap;
+  bmap = bit->bitmap;
   
   if ( smooth ) {
     for(y=0;y<bit->rows;y++) for(x=0;x<bit->width;x++) {
index e7625b9ada410a5e3f6d4503b53fa845d0efae22..d0409970eced396945be4a820cf1bcb3315202ee 100644 (file)
@@ -642,8 +642,6 @@ i_ft2_text(FT2_Fonthandle *handle, i_img *im, int tx, int ty, const i_color *cl,
   unsigned char map[256];
   char last_mode = ft_pixel_mode_none; 
   int last_grays = -1;
-  int ch;
-  i_color pel;
   int loadFlags = FT_LOAD_DEFAULT;
   i_render render;
 
diff --git a/gif.c b/gif.c
index 9d936602759beae8990d86191dbfc851d8ce501e..67df246cee1078c2951d8ae8514a5c549f96733f 100644 (file)
--- a/gif.c
+++ b/gif.c
@@ -530,7 +530,10 @@ i_img **i_readgif_multi_low(GifFileType *GifFile, int *count, int page) {
   int result_alloc = 0;
   int channels;
   int image_colors = 0;
-  i_color black = { 0 }; /* used to expand the palette if needed */
+  i_color black; /* used to expand the palette if needed */
+
+  for (i = 0; i < MAXCHANNELS; ++i)
+    black.channel[i] = 0;
   
   *count = 0;