From 6a52f1a9df27215454b6ac9d9537d621882eb2c0 Mon Sep 17 00:00:00 2001 From: Antonin Descampe Date: Fri, 20 Jan 2006 16:53:05 +0000 Subject: [PATCH] fixed various minor warnings with gdcm patches --- ChangeLog | 3 +++ codec/convert.c | 49 ++++++++++++++++++++++---------------------- codec/image_to_j2k.c | 2 +- codec/j2k_to_image.c | 3 ++- libopenjpeg/dwt.c | 1 + libopenjpeg/event.c | 8 ++++---- libopenjpeg/jp2.c | 5 ++++- 7 files changed, 39 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index f82a475c..71b4eba8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ What's New for OpenJPEG ! : changed + : added +January 20, 2006 +* [Antonin Descampe] fixed various minor warnings with gdcm patches + January 19, 2006 * [Herve Drolon] fixed a bug in jp2_read_ihdr (need to allocate jp2->comps) diff --git a/codec/convert.c b/codec/convert.c index 5784c285..82e1da67 100644 --- a/codec/convert.c +++ b/codec/convert.c @@ -245,8 +245,8 @@ opj_image_t* bmptoimage(char *filename, opj_cparameters_t *parameters) { W = Info_h.biWidth; H = Info_h.biHeight; - // PAD = 4 - (3 * W) % 4; - // PAD = (PAD == 4) ? 0 : PAD; + /* PAD = 4 - (3 * W) % 4; */ + /* PAD = (PAD == 4) ? 0 : PAD; */ PAD = (3 * W) % 4 ? 4 - (3 * W) % 4 : 0; RGB = (unsigned char *) malloc((3 * W + PAD) * H * sizeof(unsigned char)); @@ -483,13 +483,13 @@ int imagetobmp(opj_image_t * image, char *outfile) { return 1; } - // w = int_ceildiv(image->x1 - image->x0, image->comps[0].dx); - // wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor), image->comps[0].dx); + /* w = int_ceildiv(image->x1 - image->x0, image->comps[0].dx); */ + /* wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor), image->comps[0].dx); */ w = image->comps[0].w; wr = int_ceildivpow2(image->comps[0].w, image->comps[0].factor); - // h = int_ceildiv(image->y1 - image->y0, image->comps[0].dy); - // hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[0].dy); + /* h = int_ceildiv(image->y1 - image->y0, image->comps[0].dy); */ + /* hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[0].dy); */ h = image->comps[0].h; hr = int_ceildivpow2(image->comps[0].h, image->comps[0].factor); @@ -531,11 +531,11 @@ int imagetobmp(opj_image_t * image, char *outfile) { for (i = 0; i < wr * hr; i++) { unsigned char R, G, B; /* a modifier */ - // R = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; + /* R = image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; */ R = image->comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; - // G = image->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; + /* G = image->comps[1].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; */ G = image->comps[1].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; - // B = image->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; + /* B = image->comps[2].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]; */ B = image->comps[2].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]; fprintf(fdest, "%c%c%c", B, G, R); @@ -552,13 +552,13 @@ int imagetobmp(opj_image_t * image, char *outfile) { <<-- <<-- <<-- <<-- */ fdest = fopen(outfile, "wb"); - // w = int_ceildiv(image->x1 - image->x0, image->comps[0].dx); - // wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor), image->comps[0].dx); + /* w = int_ceildiv(image->x1 - image->x0, image->comps[0].dx); */ + /* wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor), image->comps[0].dx); */ w = image->comps[0].w; wr = int_ceildivpow2(image->comps[0].w, image->comps[0].factor); - // h = int_ceildiv(image->y1 - image->y0, image->comps[0].dy); - // hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[0].dy); + /* h = int_ceildiv(image->y1 - image->y0, image->comps[0].dy); */ + /* hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[0].dy); */ h = image->comps[0].h; hr = int_ceildivpow2(image->comps[0].h, image->comps[0].factor); @@ -605,7 +605,7 @@ int imagetobmp(opj_image_t * image, char *outfile) { for (i = 0; i < wr * hr; i++) { /* a modifier !! */ - // fprintf(fdest, "%c", image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]); + /* fprintf(fdest, "%c", image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]); */ fprintf(fdest, "%c", image->comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]); /*if (((i + 1) % w == 0 && w % 2)) fprintf(fdest, "%c", 0); */ @@ -662,7 +662,7 @@ opj_image_t* pgxtoimage(char *filename, opj_cparameters_t *parameters) { int w, h, prec; int i, numcomps, max; OPJ_COLOR_SPACE color_space; - opj_image_cmptparm_t cmptparm; // maximum of 1 component + opj_image_cmptparm_t cmptparm; /* maximum of 1 component */ opj_image_t * image = NULL; char endian1,endian2,sign; @@ -797,13 +797,13 @@ int imagetopgx(opj_image_t * image, char *outfile) { fprintf(stderr, "ERROR -> failed to open %s for writing\n", name); return 1; } - // w = int_ceildiv(image->x1 - image->x0, comp->dx); - // wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor), comp->dx); + /* w = int_ceildiv(image->x1 - image->x0, comp->dx); */ + /* wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor), comp->dx); */ w = image->comps[compno].w; wr = int_ceildivpow2(image->comps[compno].w, image->comps[compno].factor); - // h = int_ceildiv(image->y1 - image->y0, comp->dy); - // hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), comp->dy); + /* h = int_ceildiv(image->y1 - image->y0, comp->dy); */ + /* hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), comp->dy); */ h = image->comps[compno].h; hr = int_ceildivpow2(image->comps[compno].h, image->comps[compno].factor); @@ -835,7 +835,6 @@ PNM IMAGE FORMAT <<-- <<-- <<-- <<-- */ opj_image_t* pnmtoimage(char *filename, opj_cparameters_t *parameters) { - int tdy = parameters->cp_tdy; int subsampling_dx = parameters->subsampling_dx; int subsampling_dy = parameters->subsampling_dy; @@ -955,7 +954,7 @@ opj_image_t* pnmtoimage(char *filename, opj_cparameters_t *parameters) { for (i = 0; i < w * h; i++) { for(compno = 0; compno < numcomps; compno++) { unsigned int index = 0; - fscanf(f, "%d", &index); + fscanf(f, "%u", &index); /* compno : 0 = GREY, (0, 1, 2) = (R, G, B) */ image->comps[compno].data[i] = index; } @@ -1006,12 +1005,12 @@ int imagetopnm(opj_image_t * image, char *outfile) { } w = int_ceildiv(image->x1 - image->x0, image->comps[0].dx); - // wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor),image->comps[0].dx); + /* wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor),image->comps[0].dx); */ wr = image->comps[0].w; wrr = int_ceildivpow2(image->comps[0].w, image->comps[0].factor); h = int_ceildiv(image->y1 - image->y0, image->comps[0].dy); - // hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[0].dy); + /* hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[0].dy); */ hr = image->comps[0].h; hrr = int_ceildivpow2(image->comps[0].h, image->comps[0].factor); @@ -1061,12 +1060,12 @@ int imagetopnm(opj_image_t * image, char *outfile) { } w = int_ceildiv(image->x1 - image->x0, image->comps[compno].dx); - // wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor),image->comps[compno].dx); + /* wr = int_ceildiv(int_ceildivpow2(image->x1 - image->x0,image->factor),image->comps[compno].dx); */ wr = image->comps[compno].w; wrr = int_ceildivpow2(image->comps[compno].w, image->comps[compno].factor); h = int_ceildiv(image->y1 - image->y0, image->comps[compno].dy); - // hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[compno].dy); + /* hr = int_ceildiv(int_ceildivpow2(image->y1 - image->y0,image->factor), image->comps[compno].dy); */ hr = image->comps[compno].h; hrr = int_ceildivpow2(image->comps[compno].h, image->comps[compno].factor); diff --git a/codec/image_to_j2k.c b/codec/image_to_j2k.c index 4cde28f3..5508a260 100644 --- a/codec/image_to_j2k.c +++ b/codec/image_to_j2k.c @@ -200,7 +200,7 @@ OPJ_PROG_ORDER give_progression(char progression[4]) { } int get_file_format(char *filename) { - int i; + unsigned int i; static const char *extension[] = {"pgx", "pnm", "pgm", "ppm", "bmp", "j2k", "jp2" }; static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, J2K_CFMT, JP2_CFMT }; char * ext = strrchr(filename, '.') + 1; diff --git a/codec/j2k_to_image.c b/codec/j2k_to_image.c index e45dcfe2..b62c1e33 100644 --- a/codec/j2k_to_image.c +++ b/codec/j2k_to_image.c @@ -87,7 +87,7 @@ void decode_help_display() { /* -------------------------------------------------------------------------- */ int get_file_format(char *filename) { - int i; + unsigned int i; static const char *extension[] = {"pgx", "pnm", "pgm", "ppm", "bmp", "j2k", "jp2", "jpt" }; static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, J2K_CFMT, JP2_CFMT, JPT_CFMT }; char * ext = strrchr(filename, '.') + 1; @@ -217,6 +217,7 @@ void warning_callback(const char *msg, void *client_data) { sample debug callback expecting no client object */ void info_callback(const char *msg, void *client_data) { + (void)client_data; fprintf(stdout, "[INFO] %s", msg); } diff --git a/libopenjpeg/dwt.c b/libopenjpeg/dwt.c index 5a36e14f..702bf6cf 100644 --- a/libopenjpeg/dwt.c +++ b/libopenjpeg/dwt.c @@ -577,6 +577,7 @@ void dwt_decode_real(opj_tcd_tilecomp_t * tilec, int stop) { /* Get gain of 9-7 wavelet transform. */ /* */ int dwt_getgain_real(int orient) { + (void)orient; return 0; } diff --git a/libopenjpeg/event.c b/libopenjpeg/event.c index d105cca2..248ef6e3 100644 --- a/libopenjpeg/event.c +++ b/libopenjpeg/event.c @@ -26,9 +26,9 @@ #include "opj_includes.h" -// ========================================================== -// Utility functions -// ========================================================== +/* ========================================================== + Utility functions + ==========================================================*/ #ifndef WIN32 static char* @@ -57,7 +57,7 @@ _itoa(int i, char *a, int r) { return a; } -#endif // !WIN32 +#endif /* !WIN32 */ /* ----------------------------------------------------------------------- */ diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index 0d66e63e..e224f4c6 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -42,7 +42,7 @@ Read box headers @return Returns true if successful, returns false otherwise */ static bool jp2_read_boxhdr(opj_common_ptr cinfo, opj_cio_t *cio, opj_jp2_box_t *box); -static void jp2_write_url(opj_cio_t *cio, char *Idx_file); +/*static void jp2_write_url(opj_cio_t *cio, char *Idx_file);*/ /** Read the IHDR box - Image Header box @param jp2 JP2 handle @@ -125,6 +125,7 @@ static bool jp2_read_boxhdr(opj_common_ptr cinfo, opj_cio_t *cio, opj_jp2_box_t return true; } +#if 0 static void jp2_write_url(opj_cio_t *cio, char *Idx_file) { unsigned int i; opj_jp2_box_t box; @@ -146,6 +147,7 @@ static void jp2_write_url(opj_cio_t *cio, char *Idx_file) { cio_write(cio, box.length, 4); /* L */ cio_seek(cio, box.init_pos + box.length); } +#endif static bool jp2_read_ihdr(opj_jp2_t *jp2, opj_cio_t *cio) { opj_jp2_box_t box; @@ -682,6 +684,7 @@ void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_ } bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, char *index) { + (void)image; /* JP2 encoding */ -- 2.40.0