avoid most compilter warnings produced by GCC 4.1
authorTony Cook <tony@develop=help.com>
Sun, 26 Nov 2006 10:49:52 +0000 (10:49 +0000)
committerTony Cook <tony@develop=help.com>
Sun, 26 Nov 2006 10:49:52 +0000 (10:49 +0000)
color.c
freetyp2.c
imexif.c
rgb.c
rotate.c
scale.im

diff --git a/color.c b/color.c
index 10376a35faa2f26a58bae0530d646d8a0e0bc881..9c9d195b9dee255111c8d9e68e999ce3a3d37549 100644 (file)
--- a/color.c
+++ b/color.c
@@ -33,7 +33,7 @@ Each value is scaled into the range 0 to 1.0.
 =cut
 */
 void i_rgb_to_hsvf(i_fcolor *color) {
-  double h, s, v;
+  double h = 0, s, v;
   double temp;
   double Cr, Cg, Cb;
 
@@ -74,7 +74,7 @@ Each value is scaled into the range 0 to 255.
 =cut
 */
 void i_rgb_to_hsv(i_color *color) {
-  double h, s, v;
+  double h = 0, s, v;
   double temp;
   double Cr, Cg, Cb;
 
index 4d30c5c06a7e289b6845376b34c9a2bdc86b2457..6fc3caabd643462e7a778399cb70bb959d2a0aa8 100644 (file)
@@ -327,7 +327,7 @@ i_ft2_bbox(FT2_Fonthandle *handle, double cheight, double cwidth,
   FT_Glyph_Metrics *gm;
   int start = 0;
   int loadFlags = FT_LOAD_DEFAULT;
-  int rightb;
+  int rightb = 0;
 
   mm_log((1, "i_ft2_bbox(handle %p, cheight %f, cwidth %f, text %p, len %d, bbox %p)\n",
          handle, cheight, cwidth, text, len, bbox));
index 9741f7a7c6fc7e05767152cd5121208e844d32f9..9e562f7f4f84ca07cef41bd9a26f8d7729a1eb1d 100644 (file)
--- a/imexif.c
+++ b/imexif.c
@@ -229,8 +229,10 @@ static int tiff_init(imtiff *tiff, unsigned char *base, size_t length);
 static int tiff_load_ifd(imtiff *tiff, unsigned long offset);
 static void tiff_final(imtiff *tiff);
 static void tiff_clear_ifd(imtiff *tiff);
+#if 0 /* currently unused, but that may change */
 static int tiff_get_bytes(imtiff *tiff, unsigned char *to, size_t offset, 
                          size_t count);
+#endif
 static int tiff_get_tag_double(imtiff *, int index, double *result);
 static int tiff_get_tag_int(imtiff *, int index, int *result);
 static unsigned tiff_get16(imtiff *, unsigned long offset);
@@ -1412,6 +1414,8 @@ tiff_get32(imtiff *tiff, unsigned long offset) {
       + 0x10000 * tiff->base[offset+1] + 0x1000000 * tiff->base[offset];
 }
 
+#if 0 /* currently unused, but that may change */
+
 /*
 =item tiff_get_bytes
 
@@ -1434,6 +1438,8 @@ tiff_get_bytes(imtiff *tiff, unsigned char *data, size_t offset,
   return 1;
 }
 
+#endif
+
 /*
 =item tiff_get16s
 
diff --git a/rgb.c b/rgb.c
index 737b5605f0e9e9c37d7e9d385461e270ff2f66e5..91c74cb8569773faed484c9e893d8483c5c8cab7 100644 (file)
--- a/rgb.c
+++ b/rgb.c
@@ -93,6 +93,7 @@ rgb_header_unpack(rgb_header *header, unsigned char *headbuf) {
   header->colormap    = (headbuf[100]<<24) + (headbuf[101]<<16)+(headbuf[102]<<8)+headbuf[103];
 }
 
+#if 0 /* this is currently unused */
 
 /*
 =item rgb_header_pack(header, headbuf)
@@ -146,7 +147,7 @@ rgb_dest_write(rgb_dest *s, unsigned char *buf, size_t pixels) {
   return -1;
 }
 
-
+#endif
 
 
 
@@ -295,7 +296,7 @@ i_readrgb_wiol(io_glue *ig, int length) {
     for(y=0; y<height; y++) {
       for(c=0; c<channels; c++) {
        unsigned long iidx = 0, oidx = 0, span = 0;
-       unsigned char cval;
+       unsigned char cval = 0;
        int rle = 0;
        int ci = height*c+y;
        int datalen = lengthtab[ci];
index e38fb04d75d595a30b384992aa4534180a08e6a7..6dee34fcfdd68b9364b015ae8fb469db8f5b8313 100644 (file)
--- a/rotate.c
+++ b/rotate.c
@@ -293,6 +293,9 @@ i_img *i_matrix_transform_bg(i_img *src, int xsize, int ysize, const double *mat
             sx = (x * matrix[0] + y * matrix[1] + matrix[2]) / sz;
             sy = (x * matrix[3] + y * matrix[4] + matrix[5]) / sz;
           }
+          else {
+            sx = sy = 0;
+          }
 
           /* anything outside these ranges is either a broken co-ordinate
              or outside the source */
@@ -393,6 +396,9 @@ i_img *i_matrix_transform_bg(i_img *src, int xsize, int ysize, const double *mat
           sx = (x * matrix[0] + y * matrix[1] + matrix[2]) / sz;
           sy = (x * matrix[3] + y * matrix[4] + matrix[5]) / sz;
         }
+        else {
+          sx = sy = 0;
+        }
         
         /* anything outside these ranges is either a broken co-ordinate
            or outside the source */
index 26ea7904131d85d185cc2a1afb5ddf1faa32a776..7f8ed769d0c7afa111a6b7ee3cd3449848918191 100644 (file)
--- a/scale.im
+++ b/scale.im
@@ -113,8 +113,8 @@ i_scale_mixing(i_img *src, int x_out, int y_out) {
   for (y = 0; y < y_out; ++y) {
     if (y_out == src->ysize) {
       /* no vertical scaling, just load it */
-      int x, ch;
 #ifdef IM_EIGHT_BIT
+      int x, ch;
       /* load and convert to doubles */
       IM_GLIN(src, 0, src->xsize, y, in_row);
       for (x = 0; x < src->xsize; ++x) {
@@ -155,8 +155,8 @@ i_scale_mixing(i_img *src, int x_out, int y_out) {
     }
     /* we've accumulated a vertically scaled row */
     if (x_out == src->xsize) {
-      int x, ch;
 #if IM_EIGHT_BIT
+      int x, ch;
       /* no need to scale, but we need to convert it */
       for (x = 0; x < x_out; ++x) {
         for (ch = 0; ch < result->channels; ++ch)