]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix compiler warnings
authorDRC <dcommander@users.sourceforge.net>
Sat, 26 Feb 2011 21:20:46 +0000 (21:20 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sat, 26 Feb 2011 21:20:46 +0000 (21:20 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@463 632fc199-4ca6-4c93-a231-07263d6284db

jdcolor.c
jpgtest.c
turbojpegl.c

index e02ea4f9d39aaef0ad5ce9bd6144da470dce199b..bc73b3f4621ed45936b24cdbbf90d1a8d7138d97 100644 (file)
--- 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];
index 2cb37f35d7aacdbda6eec9f993f16e5e970ede44..0ec2a1534df12c13168b9006667a4d212e696e19 100644 (file)
--- 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(argc<minarg) usage(argv[0]);
index 39e9d393931c1f5377e58742c97a682238e832a5..010a072f295871bfbaf2c4f34d42b5ee0ca892f0 100644 (file)
@@ -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]);