Remove some warnings when building

Update #442
This commit is contained in:
mayeut 2015-07-26 13:41:59 +02:00
parent db9b3400e5
commit e6cf1744d4
2 changed files with 10 additions and 7 deletions

View File

@ -194,12 +194,12 @@ static void convert_16u32s_C1R(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T
opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params) opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
{ {
png_structp png; png_structp png = NULL;
png_infop info; png_infop info = NULL;
double gamma; double gamma;
int bit_depth, interlace_type,compression_type, filter_type; int bit_depth, interlace_type,compression_type, filter_type;
OPJ_UINT32 i; OPJ_UINT32 i;
png_uint_32 width, height; png_uint_32 width, height = 0U;
int color_type; int color_type;
FILE *reader = NULL; FILE *reader = NULL;
OPJ_BYTE** rows = NULL; OPJ_BYTE** rows = NULL;
@ -395,12 +395,14 @@ int imagetopng(opj_image_t * image, const char *write_idf)
int *red, *green, *blue, *alpha; int *red, *green, *blue, *alpha;
unsigned char *row_buf, *d; unsigned char *row_buf, *d;
int has_alpha, width, height, nr_comp, color_type; int has_alpha, width, height, nr_comp, color_type;
int adjustR, adjustG, adjustB, adjustA, x, y, fails; int adjustR, adjustG, adjustB, adjustA, x, y;
int prec, ushift, dshift, is16, force16, force8; int prec, ushift, dshift, is16, force16, force8;
unsigned short mask = 0xffff; unsigned short mask;
png_color_8 sig_bit; png_color_8 sig_bit;
is16 = force16 = force8 = ushift = dshift = 0; fails = 1; volatile int fails = 1;
is16 = force16 = force8 = ushift = dshift = 0;
prec = (int)image->comps[0].prec; prec = (int)image->comps[0].prec;
nr_comp = (int)image->numcomps; nr_comp = (int)image->numcomps;
@ -474,6 +476,7 @@ int imagetopng(opj_image_t * image, const char *write_idf)
*/ */
png_set_compression_level(png, Z_BEST_COMPRESSION); png_set_compression_level(png, Z_BEST_COMPRESSION);
mask = 0xffff;
if(prec == 16) mask = 0xffff; if(prec == 16) mask = 0xffff;
else else
if(prec == 8) mask = 0x00ff; if(prec == 8) mask = 0x00ff;

View File

@ -601,7 +601,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
char signo; char signo;
int width,height,bitdepth,ncomp; int width,height,bitdepth,ncomp;
OPJ_UINT32 len; OPJ_UINT32 len;
OPJ_BOOL raw_signed; OPJ_BOOL raw_signed = OPJ_FALSE;
substr2 = strchr(opj_optarg,'@'); substr2 = strchr(opj_optarg,'@');
if (substr2 == NULL) { if (substr2 == NULL) {
len = (OPJ_UINT32) strlen(opj_optarg); len = (OPJ_UINT32) strlen(opj_optarg);