solve some obvious warnings for WIN platform, increase number of warning reported...
[openjpeg.git] / applications / codec / j2k_dump.c
index 170c4324922c64d6726a22420c4e0622fea82d2d..b0f4404333af5626ba232dc715a5f086ebf78f78 100644 (file)
@@ -73,7 +73,7 @@ typedef struct img_folder{
 
 }img_fol_t;
 
-void decode_help_display() {
+void decode_help_display(void) {
        fprintf(stdout,"HELP for j2k_dump\n----\n\n");
        fprintf(stdout,"- the -h option displays this help information on screen\n\n");
 
@@ -196,7 +196,7 @@ char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_dparamet
 /* -------------------------------------------------------------------------- */
 int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,img_fol_t *img_fol, char *indexfilename) {
        /* parse the command line */
-       int totlen;
+       int totlen, c;
        option_t long_option[]={
                {"ImgDir",REQ_ARG, NULL ,'y'},
        };
@@ -204,8 +204,8 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
        const char optlist[] = "i:o:h";
        totlen=sizeof(long_option);
        img_fol->set_out_format = 0;
-       while (1) {
-               int c = getopt_long(argc, argv,optlist,long_option,totlen);
+       do {
+               c = getopt_long(argc, argv,optlist,long_option,totlen);
                if (c == -1)
                        break;
                switch (c) {
@@ -259,7 +259,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
                                fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, optarg);
                                break;
                }
-       }
+       }while(c != -1);
 
        /* check for possible errors */
        if(img_fol->set_imgdir==1){
@@ -412,7 +412,7 @@ int main(int argc, char *argv[])
                file_length = ftell(fsrc);
                fseek(fsrc, 0, SEEK_SET);
                src = (unsigned char *) malloc(file_length);
-               if (fread(src, 1, file_length, fsrc) != file_length)
+               if (fread(src, 1, file_length, fsrc) != (size_t)file_length)
                {
                        free(src);
                        fclose(fsrc);
@@ -463,7 +463,7 @@ int main(int argc, char *argv[])
 
                        /* Write the index to disk */
                        if (*indexfilename) {
-                               char bSuccess;
+                               opj_bool bSuccess;
                                bSuccess = write_index_file(&cstr_info, indexfilename);
                                if (bSuccess) {
                                        fprintf(stderr, "Failed to output index file\n");
@@ -514,7 +514,7 @@ int main(int argc, char *argv[])
 
                        /* Write the index to disk */
                        if (*indexfilename) {
-                               char bSuccess;
+                               opj_bool bSuccess;
                                bSuccess = write_index_file(&cstr_info, indexfilename);
                                if (bSuccess) {
                                        fprintf(stderr, "Failed to output index file\n");
@@ -556,7 +556,7 @@ int main(int argc, char *argv[])
 
                        /* Write the index to disk */
                        if (*indexfilename) {
-                               char bSuccess;
+                               opj_bool bSuccess;
                                bSuccess = write_index_file(&cstr_info, indexfilename);
                                if (bSuccess) {
                                        fprintf(stderr, "Failed to output index file\n");