Fix compiler warnings

This commit is contained in:
DRC
2011-02-26 21:20:46 +00:00
parent a3845bd44b
commit 28db388687
3 changed files with 6 additions and 8 deletions

View File

@@ -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];

View File

@@ -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]);

View 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]);