Permalink
Browse files

avoid most compilter warnings produced by GCC 4.1

  • Loading branch information...
Tony Cook
Tony Cook committed Nov 26, 2006
1 parent b07bc64 commit e4bf9335cc2b884d905065b18d37f2014035ae4c
Showing with 20 additions and 7 deletions.
  1. +2 −2 color.c
  2. +1 −1 freetyp2.c
  3. +6 −0 imexif.c
  4. +3 −2 rgb.c
  5. +6 −0 rotate.c
  6. +2 −2 scale.im
View
@@ -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;
View
@@ -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));
View
@@ -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
View
5 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];
View
@@ -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 */
View
@@ -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)

0 comments on commit e4bf933

Please sign in to comment.