From 94f458ed0464ed96e378d5b1f0456f4b78ff85fa Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 13 Dec 2017 15:49:12 +0000 Subject: [PATCH] fix some compiler warnings --- libvips/conversion/composite.cpp | 8 ++++++++ libvips/foreign/tiff2vips.c | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/libvips/conversion/composite.cpp b/libvips/conversion/composite.cpp index c1228d69..335a821b 100644 --- a/libvips/conversion/composite.cpp +++ b/libvips/conversion/composite.cpp @@ -265,6 +265,10 @@ vips_composite_base_blend( VipsCompositeBase *composite, */ for( int b = 0; b <= bands; b++ ) A[b] = p[b] / composite->max_band[b]; + /* Not necessary, but it stops a compiler warning. + */ + for( int b = bands + 1; b < MAX_BANDS + 1; b++ ) + A[b] = 0.0; aA = A[bands]; aB = B[bands]; @@ -666,8 +670,12 @@ vips_composite_base_blend3( VipsCompositeBase *composite, default: g_assert_not_reached(); + + /* Stop compiler warnings. + */ for( int b = 0; b < 3; b++ ) B[b] = 0; + f = A; } t1 = 1 - aB; diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c index d867932e..8330d3e9 100644 --- a/libvips/foreign/tiff2vips.c +++ b/libvips/foreign/tiff2vips.c @@ -2068,6 +2068,12 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) !tfget32( rtiff->tiff, TIFFTAG_TILELENGTH, &header->tile_height ) ) return( -1 ); + + /* Stop some compiler warnings. + */ + header->rows_per_strip = 0; + header->strip_size = 0; + header->number_of_strips = 0; } else { if( !tfget32( rtiff->tiff, @@ -2100,6 +2106,11 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) header->number_of_strips = header->height; header->read_scanlinewise = TRUE; } + + /* Stop some compiler warnings. + */ + header->tile_width = 0; + header->tile_height = 0; } return( 0 );