removed unused parameters warnings with the solution proposed by myself and Bob Fries...
authorMickael Savinaud <savmickael@users.noreply.github.com>
Wed, 10 Aug 2011 08:12:10 +0000 (08:12 +0000)
committerMickael Savinaud <savmickael@users.noreply.github.com>
Wed, 10 Aug 2011 08:12:10 +0000 (08:12 +0000)
CHANGES
applications/codec/j2k_dump.c
libopenjpeg/j2k.c
libopenjpeg/jp2.c
libopenjpeg/openjpeg.c
libopenjpeg/opj_includes.h
libopenjpeg/t1.c
libopenjpeg/tcd.c

diff --git a/CHANGES b/CHANGES
index 82c688045d7a4bab010cd6412c980d7f9678fa32..7a4740dc8e6fccad3156006215da9d28f486cb0b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@ What's New for OpenJPEG
 ! : changed
 + : added
 
+August 10, 2011
+! [mickael] removed unused parameters warnings with the solution proposed by myself and Bob Friesenhahn.
+
 August 9, 2011
 - [antonin] removed xcode project files (cmake and autotools are now the only supported build methods)
 
index b0f4404333af5626ba232dc715a5f086ebf78f78..02f8316c0d43724d5b237d44c742bf9c4f0f549c 100644 (file)
@@ -200,8 +200,10 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
        option_t long_option[]={
                {"ImgDir",REQ_ARG, NULL ,'y'},
        };
-
        const char optlist[] = "i:o:h";
+
+       OPJ_ARG_NOT_USED(indexfilename);
+
        totlen=sizeof(long_option);
        img_fol->set_out_format = 0;
        do {
index 0b09899a04b7ba68c8e692bf49e44bbe3fd5143c..0a58a81a5ae8bf22d8a4b22c1f3b2f7d65551109 100644 (file)
@@ -297,6 +297,9 @@ static int j2k_get_num_tp(opj_cp_t *cp,int pino,int tileno){
 /**    mem allocation for TLM marker*/
 int j2k_calculate_tp(opj_cp_t *cp,int img_numcomp,opj_image_t *image,opj_j2k_t *j2k ){
        int pino,tileno,totnum_tp=0;
+
+       OPJ_ARG_NOT_USED(img_numcomp);
+
        j2k->cur_totnum_tp = (int *) opj_malloc(cp->tw * cp->th * sizeof(int));
        for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
                int cur_totnum_tp = 0;
@@ -1848,8 +1851,9 @@ opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio,  opj_codestre
        opj_jpt_msg_header_t header;
        int position;
 
+       OPJ_ARG_NOT_USED(cstr_info);
+
        opj_common_ptr cinfo = j2k->cinfo;
-       
        j2k->cio = cio;
 
        /* create an empty image */
index 39d48a5fbe6c778fc39a8644278cf1aedf0ac9c5..9c9c476f0a4fb9864b7a5c9a4a521c065c01b7d6 100644 (file)
@@ -398,6 +398,9 @@ static opj_bool jp2_read_pclr(opj_jp2_t *jp2, opj_cio_t *cio,
        unsigned short i, j;
        unsigned char uc;
 
+       OPJ_ARG_NOT_USED(box);
+       OPJ_ARG_NOT_USED(jp2);
+
 /* Part 1, I.5.3.4: 'There shall be at most one Palette box inside
  * a JP2 Header box' :
 */
@@ -446,6 +449,9 @@ static opj_bool jp2_read_cmap(opj_jp2_t *jp2, opj_cio_t *cio,
        opj_jp2_cmap_comp_t *cmap;
        unsigned short i, nr_channels;
 
+       OPJ_ARG_NOT_USED(box);
+       OPJ_ARG_NOT_USED(jp2);
+
 /* Need nr_channels: */
        if(color->jp2_pclr == NULL) return OPJ_FALSE;
 
@@ -511,6 +517,9 @@ static opj_bool jp2_read_cdef(opj_jp2_t *jp2, opj_cio_t *cio,
        opj_jp2_cdef_info_t *info;
        unsigned short i, n;
 
+       OPJ_ARG_NOT_USED(box);
+       OPJ_ARG_NOT_USED(jp2);
+
 /* Part 1, I.5.3.6: 'The shall be at most one Channel Definition box
  * inside a JP2 Header box.' 
 */
index 790f2eeac6bc4c3fc6d6bf51d4f00e0d1009fcc7..00a910ec112e5a0d0486fd9971d8fa9be8e6f0e1 100644 (file)
 #ifndef OPJ_STATIC
 BOOL APIENTRY
 DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
+
+       OPJ_ARG_NOT_USED(lpReserved);
+       OPJ_ARG_NOT_USED(hModule);
+
        switch (ul_reason_for_call) {
                case DLL_PROCESS_ATTACH :
                        break;
index 53a0c4a7215b1f30b35da357123622138869122b..8da9dbdc0a39bcb5a4fe7f86739ba6d2ee95bfac 100644 (file)
@@ -104,6 +104,9 @@ static INLINE long lrintf(float f){
 }
 #endif
 
+// Avoid compile-time warning because parameter is not used
+#define OPJ_ARG_NOT_USED(x) (void)(x)
+
 #include "j2k_lib.h"
 #include "opj_malloc.h"
 #include "event.h"
index 002a82d4ef744e23ff9df2454ea8ffe773f0e67c..b3ede36ab199e85f3aae0452978f0de5d339cbaf 100644 (file)
@@ -382,9 +382,10 @@ static INLINE void t1_dec_sigpass_step_raw(
                int vsc)
 {
        int v, flag;
-       
        opj_raw_t *raw = t1->raw;       /* RAW component */
        
+       OPJ_ARG_NOT_USED(orient);
+       
        flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);
        if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {
                        if (raw_decode(raw)) {
@@ -823,9 +824,10 @@ static void t1_dec_clnpass_step_partial(
                int oneplushalf)
 {
        int v, flag;
-       
        opj_mqc_t *mqc = t1->mqc;       /* MQC component */
        
+       OPJ_ARG_NOT_USED(orient);
+       
        flag = *flagsp;
        mqc_setcurctx(mqc, t1_getctxno_sc(flag));
        v = mqc_decode(mqc) ^ t1_getspb(flag);
index 26548564025baf350b402670902d93279ab34262..fc25179a7bae6c82a0f6d0efaa7c0247915e4436 100644 (file)
@@ -676,6 +676,8 @@ void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
        opj_tcp_t *tcp;
        opj_tcd_tile_t *tile;
 
+       OPJ_ARG_NOT_USED(cstr_info);
+
        tcd->cp = cp;
        
        tcp = &(cp->tcps[cp->tileno[tileno]]);