fix a used before set warning

This commit is contained in:
John Cupitt 2012-01-14 13:45:00 +00:00
parent b210d34192
commit 228784c52e
3 changed files with 13 additions and 6 deletions

6
TODO
View File

@ -1,3 +1,9 @@
- have this warning:
im_histspec.c: In function 'im_histspec':
im_histspec.c:101:6: warning: 'px' may be used uninitialized in this function
[-Wuninitialized]
im_histspec.c:79:6: note: 'px' was declared here:n ../his
- vips operation print could show operation flags as well, cf. "vips
im_subtract"

View File

@ -68,18 +68,18 @@
static int
match( IMAGE *in, IMAGE *ref, IMAGE *out )
{
const int inpx = in->Xsize * in->Ysize;
const int refpx = ref->Xsize * ref->Ysize;
const guint64 inpx = (guint64) in->Xsize * in->Ysize;
const guint64 refpx = (guint64) ref->Xsize * ref->Ysize;
const int bands = in->Bands;
unsigned int *inbuf; /* in and ref, padded to same size */
unsigned int *refbuf;
unsigned int *outbuf; /* Always output as uint */
int px; /* Number of pixels */
int max; /* px * bands */
guint64 px; /* Number of pixels */
guint64 max; /* px * bands */
int i, j;
guint64 i, j;
if( im_iocheck( in, out ) ||
im_iocheck( ref, out ) ||
@ -98,6 +98,8 @@ match( IMAGE *in, IMAGE *ref, IMAGE *out )
px = 256;
else if( inpx <= 65536 && refpx <= 65536 )
px = 65536;
else
px = IM_MAX( inpx, refpx );
max = px * bands;
/* Unpack to equal-sized buffers.

View File

@ -45,7 +45,6 @@
#include <unistd.h>
#endif /*HAVE_UNISTD_H*/
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>