diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2011-02-26 21:20:46 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2011-02-26 21:20:46 +0000 |
commit | 235e8ff389da4f7dd7eb935f432d49255fcc4dfc (patch) | |
tree | 3ea469f2d8f777b6244ed6d8f6f4433376940944 | |
parent | bdcae8aa6dc00fe9e8b2f7a45d2b2ffbacf09fd2 (diff) |
Fix compiler warnings
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@463 632fc199-4ca6-4c93-a231-07263d6284db
-rw-r--r-- | jdcolor.c | 1 | ||||
-rw-r--r-- | jpgtest.c | 11 | ||||
-rw-r--r-- | turbojpegl.c | 2 |
3 files changed, 6 insertions, 8 deletions
@@ -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]; @@ -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(argc<minarg) usage(argv[0]); diff --git a/turbojpegl.c b/turbojpegl.c index 39e9d39..010a072 100644 --- a/turbojpegl.c +++ b/turbojpegl.c @@ -558,7 +558,6 @@ DLLEXPORT int DLLCALL tjDecompress(tjhandle h, ptr=_tmpbuf; for(i=0; i<dinfo->num_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; row<th[i]; row++) @@ -634,7 +633,6 @@ DLLEXPORT int DLLCALL tjDecompress(tjhandle h, int j; for(i=0; i<dinfo->num_components; i++) { - jpeg_component_info *compptr=&dinfo->comp_info[i]; for(j=0; j<min(th[i], ch[i]-crow[i]); j++) { memcpy(outbuf[i][crow[i]+j], tmpbuf[i][j], cw[i]); |