[trunk] Fix one remaining issue with C90 compat

This commit is contained in:
Mathieu Malaterre 2012-09-10 12:46:42 +00:00
parent 0452ebdfcd
commit 4a845f3d04
4 changed files with 16 additions and 16 deletions

View File

@ -73,14 +73,14 @@ char * read_xmlfile( const char filename[], long *fsize);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
FILE *fp;
char *xmldata, type[]="xml ";
long fsize, boxsize;
if( argc<3){ if( argc<3){
fprintf( stderr, "USAGE: ./addXMLinJP2 modifing.jp2 adding.xml\n"); fprintf( stderr, "USAGE: ./addXMLinJP2 modifing.jp2 adding.xml\n");
return -1; return -1;
} }
FILE *fp;
char *xmldata, type[]="xml ";
long fsize, boxsize;
fp = open_jp2file( argv[1]); fp = open_jp2file( argv[1]);
if( !fp) if( !fp)
@ -111,14 +111,14 @@ FILE * open_jp2file( const char filename[])
fprintf( stderr, "Original JP2 %s not found\n", filename); fprintf( stderr, "Original JP2 %s not found\n", filename);
return NULL; return NULL;
} }
// Check resource is a JP family file. /* Check resource is a JP family file. */
if( fseek( fp, 0, SEEK_SET)==-1){ if( fseek( fp, 0, SEEK_SET)==-1){
fclose(fp); fclose(fp);
fprintf( stderr, "Original JP2 %s broken (fseek error)\n", filename); fprintf( stderr, "Original JP2 %s broken (fseek error)\n", filename);
return NULL; return NULL;
} }
data = (char *)malloc( 12); // size of header data = (char *)malloc( 12); /* size of header */
if( fread( data, 12, 1, fp) != 1){ if( fread( data, 12, 1, fp) != 1){
free( data); free( data);
fclose(fp); fclose(fp);
@ -142,7 +142,7 @@ char * read_xmlfile( const char filename[], long *fsize)
FILE *fp; FILE *fp;
char *data; char *data;
// fprintf( stderr, "open %s\n", filename); /* fprintf( stderr, "open %s\n", filename);*/
if(!(fp = fopen( filename, "r"))){ if(!(fp = fopen( filename, "r"))){
fprintf( stderr, "XML file %s not found\n", filename); fprintf( stderr, "XML file %s not found\n", filename);
return NULL; return NULL;

View File

@ -295,7 +295,7 @@ int main(int argc, char **argv)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
//end main /*end main*/

View File

@ -26,7 +26,7 @@
#define USE_OPJ_DEPRECATED #define USE_OPJ_DEPRECATED
/* set this macro to enable profiling for the given test */ /* set this macro to enable profiling for the given test */
/* warning : in order to be effective, openjpeg must have been built with profiling enabled !! */ /* warning : in order to be effective, openjpeg must have been built with profiling enabled !! */
//#define _PROFILE /*#define _PROFILE*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -249,7 +249,7 @@ int main (int argc, char *argv[])
l_param.cp_reduce = 0; l_param.cp_reduce = 0;
/* to decode only a part of the image data */ /* to decode only a part of the image data */
//opj_restrict_decoding(&l_param,0,0,1000,1000); /*opj_restrict_decoding(&l_param,0,0,1000,1000);*/
switch(l_param.decod_format) { switch(l_param.decod_format) {
@ -382,8 +382,8 @@ int main (int argc, char *argv[])
opj_destroy_codec(l_codec); opj_destroy_codec(l_codec);
opj_image_destroy(l_image); opj_image_destroy(l_image);
// Print profiling /* Print profiling*/
//PROFPRINT(); /*PROFPRINT();*/
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -147,7 +147,7 @@ int main (int argc, char *argv[])
fprintf(stdout, "Encoding random values -> keep in mind that this is very hard to compress\n"); fprintf(stdout, "Encoding random values -> keep in mind that this is very hard to compress\n");
for (i=0;i<l_data_size;++i) { for (i=0;i<l_data_size;++i) {
l_data[i] = i; //rand(); l_data[i] = i; /*rand();*/
} }
opj_set_default_encoder_parameters(&l_param); opj_set_default_encoder_parameters(&l_param);
@ -240,7 +240,7 @@ int main (int argc, char *argv[])
++l_current_param_ptr; ++l_current_param_ptr;
} }
// should we do j2k or jp2 ? /* should we do j2k or jp2 ?*/
len = strlen( output_file ); len = strlen( output_file );
if( strcmp( output_file + len - 4, ".jp2" ) == 0 ) if( strcmp( output_file + len - 4, ".jp2" ) == 0 )
{ {
@ -324,8 +324,8 @@ int main (int argc, char *argv[])
free(l_data); free(l_data);
// Print profiling /* Print profiling*/
//PROFPRINT(); /*PROFPRINT();*/
return 0; return 0;
} }