From 235e8ff389da4f7dd7eb935f432d49255fcc4dfc Mon Sep 17 00:00:00 2001 From: dcommander Date: Sat, 26 Feb 2011 21:20:46 +0000 Subject: Fix compiler warnings git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@463 632fc199-4ca6-4c93-a231-07263d6284db --- jdcolor.c | 1 - jpgtest.c | 11 ++++++----- turbojpegl.c | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/jdcolor.c b/jdcolor.c index e02ea4f..bc73b3f 100644 --- a/jdcolor.c +++ b/jdcolor.c @@ -223,7 +223,6 @@ gray_rgb_convert (j_decompress_ptr cinfo, { register JSAMPROW inptr, outptr; JSAMPLE *maxinptr; - register JDIMENSION col; JDIMENSION num_cols = cinfo->output_width; int rindex = rgb_red[cinfo->out_color_space]; int gindex = rgb_green[cinfo->out_color_space]; diff --git a/jpgtest.c b/jpgtest.c index 2cb37f3..0ec2a15 100644 --- a/jpgtest.c +++ b/jpgtest.c @@ -92,9 +92,9 @@ int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf, if((hnd=tjInitDecompress())==NULL) _throwtj("executing tjInitDecompress()"); + bufsize=(yuv==YUVDECODE? yuvsize:pitch*h); if(rgbbuf==NULL) { - bufsize=(yuv==YUVDECODE? yuvsize:pitch*h); if((rgbbuf=(unsigned char *)malloc(bufsize)) == NULL) _throwunix("allocating image buffer"); rgbbufalloc=1; @@ -216,16 +216,17 @@ void dotest(unsigned char *srcbuf, int w, int h, int jpegsub, int qual, char *filename) { char tempstr[1024]; - FILE *outfile=NULL; tjhandle hnd; + FILE *outfile=NULL; tjhandle hnd=NULL; unsigned char **jpegbuf=NULL, *rgbbuf=NULL; double start, elapsed; - int jpgbufsize=0, i, j, tilesizex, tilesizey, numtilesx, numtilesy, ITER; + int jpgbufsize=0, i, j, tilesizex=w, tilesizey=h, numtilesx=1, numtilesy=1, + ITER; unsigned long *comptilesize=NULL; int flags=(forcemmx?TJ_FORCEMMX:0)|(forcesse?TJ_FORCESSE:0) |(forcesse2?TJ_FORCESSE2:0)|(forcesse3?TJ_FORCESSE3:0) |(fastupsample?TJ_FASTUPSAMPLE:0); int ps=_ps[pf], tilen; - int pitch=w*ps, yuvsize; + int pitch=w*ps, yuvsize=0; flags |= _flags[pf]; if(bu) flags |= TJ_BOTTOMUP; @@ -478,7 +479,7 @@ void usage(char *progname) int main(int argc, char *argv[]) { unsigned char *bmpbuf=NULL; int w, h, i; - int qual, hiqual=-1; char *temp; + int qual=-1, hiqual=-1; char *temp; int minarg=2; if(argcnum_components; i++) { - jpeg_component_info *compptr=&dinfo->comp_info[i]; if((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL) _throw("Memory allocation failed in tjDecompress()"); for(row=0; rownum_components; i++) { - jpeg_component_info *compptr=&dinfo->comp_info[i]; for(j=0; j