diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c index 59af469b..6cfa663c 100644 --- a/src/bin/jp2/convert.c +++ b/src/bin/jp2/convert.c @@ -2921,7 +2921,7 @@ opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw return rawtoimage_common(filename, parameters, raw_cp, OPJ_TRUE); } -int imagetoraw_common(opj_image_t * image, const char *outfile, opj_bool big_endian) +static int imagetoraw_common(opj_image_t * image, const char *outfile, opj_bool big_endian) { FILE *rawFile = NULL; size_t res; diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c index 4c1cbd83..1824c03e 100644 --- a/src/bin/jp2/opj_compress.c +++ b/src/bin/jp2/opj_compress.c @@ -84,8 +84,8 @@ typedef struct img_folder{ float *rates; }img_fol_t; -void encode_help_display(void) { - fprintf(stdout,"HELP for image_to_j2k\n----\n\n"); +static void encode_help_display(void) { + fprintf(stdout,"HELP for opj_compress\n----\n\n"); fprintf(stdout,"- the -h option displays this help information on screen\n\n"); /* UniPG>> */ @@ -325,7 +325,7 @@ void encode_help_display(void) { fprintf(stdout,"TotalDisto\n\n"); } -OPJ_PROG_ORDER give_progression(char progression[4]) { +static OPJ_PROG_ORDER give_progression(const char progression[4]) { if(strncmp(progression, "LRCP", 4) == 0) { return LRCP; } @@ -345,7 +345,7 @@ OPJ_PROG_ORDER give_progression(char progression[4]) { return PROG_UNKNOWN; } -unsigned int get_num_images(char *imgdirpath){ +static unsigned int get_num_images(char *imgdirpath){ DIR *dir; struct dirent* content; unsigned int num_images = 0; @@ -367,7 +367,7 @@ unsigned int get_num_images(char *imgdirpath){ return num_images; } -int load_images(dircnt_t *dirptr, char *imgdirpath){ +static int load_images(dircnt_t *dirptr, char *imgdirpath){ DIR *dir; struct dirent* content; int i = 0; @@ -392,7 +392,7 @@ int load_images(dircnt_t *dirptr, char *imgdirpath){ return 0; } -int get_file_format(char *filename) { +static int get_file_format(char *filename) { unsigned int i; static const char *extension[] = { "pgx", "pnm", "pgm", "ppm", "pbm", "pam", "bmp", "tif", "raw", "rawl", "tga", "png", "j2k", "jp2", "j2c", "jpc" @@ -412,14 +412,14 @@ int get_file_format(char *filename) { return -1; } -char * get_file_name(char *name){ +static char * get_file_name(char *name){ char *fname; fname= (char*)malloc(OPJ_PATH_LEN*sizeof(char)); fname= strtok(name,"."); return fname; } -char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_cparameters_t *parameters){ +static char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_cparameters_t *parameters){ char image_filename[OPJ_PATH_LEN], infilename[OPJ_PATH_LEN],outfilename[OPJ_PATH_LEN],temp_ofname[OPJ_PATH_LEN]; char *temp_p, temp1[OPJ_PATH_LEN]=""; @@ -462,7 +462,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres){ return 2; } -void cinema_parameters(opj_cparameters_t *parameters){ +static void cinema_parameters(opj_cparameters_t *parameters){ parameters->tile_size_on = OPJ_FALSE; parameters->cp_tdx=1; parameters->cp_tdy=1; @@ -495,7 +495,7 @@ void cinema_parameters(opj_cparameters_t *parameters){ } -void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol){ +static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol){ int i; float temp_rate; @@ -580,7 +580,7 @@ void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_ /* ------------------------------------------------------------------------------------ */ -int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, +static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, img_fol_t *img_fol, raw_cparameters_t *raw_cp, char *indexfilename) { int i, j, totlen, c; opj_option_t long_option[]={ @@ -1535,21 +1535,21 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, /** sample error callback expecting a FILE* client object */ -void error_file_callback(const char *msg, void *client_data) { +static void error_file_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_file_callback(const char *msg, void *client_data) { +static void warning_file_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting a FILE* client object */ -void info_file_callback(const char *msg, void *client_data) { +static void info_file_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[INFO] %s", msg); } @@ -1557,28 +1557,28 @@ void info_file_callback(const char *msg, void *client_data) { /** sample error debug callback expecting no client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[ERROR] %s", msg); } /** sample warning debug callback expecting no client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); } /* -------------------------------------------------------------------------- */ /** - * IMAGE_TO_J2K MAIN + * OPJ_COMPRESS MAIN */ /* -------------------------------------------------------------------------- */ int main(int argc, char **argv) { diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c index 7edb3c9b..ac5e79c3 100644 --- a/src/bin/jp2/opj_decompress.c +++ b/src/bin/jp2/opj_decompress.c @@ -97,8 +97,8 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i int parse_DA_values( char* inArg, unsigned int *DA_x0, unsigned int *DA_y0, unsigned int *DA_x1, unsigned int *DA_y1); /* -------------------------------------------------------------------------- */ -void decode_help_display(void) { - fprintf(stdout,"HELP for j2k_to_image\n----\n\n"); +static void decode_help_display(void) { + fprintf(stdout,"HELP for opj_decompress\n----\n\n"); fprintf(stdout,"- the -h option displays this help information on screen\n\n"); /* UniPG>> */ @@ -648,28 +648,28 @@ int parse_DA_values( char* inArg, unsigned int *DA_x0, unsigned int *DA_y0, unsi /** sample error callback expecting a FILE* client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); } /* -------------------------------------------------------------------------- */ /** - * J2K_TO_IMAGE MAIN + * OPJ_DECOMPRESS MAIN */ /* -------------------------------------------------------------------------- */ int main(int argc, char **argv) @@ -802,7 +802,7 @@ int main(int argc, char **argv) /* Read the main header of the codestream and if necessary the JP2 boxes*/ if(! opj_read_header(l_stream, l_codec, &image)){ - fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n"); + fprintf(stderr, "ERROR -> opj_decompress: failed to read the header\n"); opj_stream_destroy(l_stream); fclose(fsrc); opj_destroy_codec(l_codec); @@ -814,7 +814,7 @@ int main(int argc, char **argv) /* Optional if you want decode the entire image */ if (!opj_set_decode_area(l_codec, image, parameters.DA_x0, parameters.DA_y0, parameters.DA_x1, parameters.DA_y1)){ - fprintf(stderr, "ERROR -> j2k_to_image: failed to set the decoded area\n"); + fprintf(stderr, "ERROR -> opj_decompress: failed to set the decoded area\n"); opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(image); @@ -824,7 +824,7 @@ int main(int argc, char **argv) /* Get the decoded image */ if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) { - fprintf(stderr,"ERROR -> j2k_to_image: failed to decode image!\n"); + fprintf(stderr,"ERROR -> opj_decompress: failed to decode image!\n"); opj_destroy_codec(l_codec); opj_stream_destroy(l_stream); opj_image_destroy(image); @@ -836,7 +836,7 @@ int main(int argc, char **argv) /* It is just here to illustrate how to use the resolution after set parameters */ /*if (!opj_set_decoded_resolution_factor(l_codec, 5)) { - fprintf(stderr, "ERROR -> j2k_to_image: failed to set the resolution factor tile!\n"); + fprintf(stderr, "ERROR -> opj_decompress: failed to set the resolution factor tile!\n"); opj_destroy_codec(l_codec); opj_stream_destroy(l_stream); opj_image_destroy(image); @@ -845,7 +845,7 @@ int main(int argc, char **argv) }*/ if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) { - fprintf(stderr, "ERROR -> j2k_to_image: failed to decode tile!\n"); + fprintf(stderr, "ERROR -> opj_decompress: failed to decode tile!\n"); opj_destroy_codec(l_codec); opj_stream_destroy(l_stream); opj_image_destroy(image); diff --git a/src/bin/jp2/opj_dump.c b/src/bin/jp2/opj_dump.c index 6c63c2ca..ca801d5a 100644 --- a/src/bin/jp2/opj_dump.c +++ b/src/bin/jp2/opj_dump.c @@ -84,8 +84,8 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i int parse_DA_values( char* inArg, unsigned int *DA_x0, unsigned int *DA_y0, unsigned int *DA_x1, unsigned int *DA_y1); /* -------------------------------------------------------------------------- */ -void decode_help_display(void) { - fprintf(stdout,"HELP for j2k_dump\n----\n\n"); +static void decode_help_display(void) { + fprintf(stdout,"HELP for opj_dump\n----\n\n"); fprintf(stdout,"- the -h option displays this help information on screen\n\n"); /* UniPG>> */ @@ -374,28 +374,28 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i /** sample error debug callback expecting no client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[ERROR] %s", msg); } /** sample warning debug callback expecting no client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); } /* -------------------------------------------------------------------------- */ /** - * J2K_DUMP MAIN + * OPJ_DUMP MAIN */ /* -------------------------------------------------------------------------- */ int main(int argc, char *argv[]) @@ -533,7 +533,7 @@ int main(int argc, char *argv[]) /* Setup the decoder decoding parameters using user parameters */ if ( !opj_setup_decoder(l_codec, ¶meters) ){ - fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n"); + fprintf(stderr, "ERROR -> opj_dump: failed to setup the decoder\n"); opj_stream_destroy(l_stream); fclose(fsrc); opj_destroy_codec(l_codec); @@ -543,7 +543,7 @@ int main(int argc, char *argv[]) /* Read the main header of the codestream and if necessary the JP2 boxes*/ if(! opj_read_header(l_stream, l_codec, &image)){ - fprintf(stderr, "ERROR -> j2k_dump: failed to read the header\n"); + fprintf(stderr, "ERROR -> opj_dump: failed to read the header\n"); opj_stream_destroy(l_stream); fclose(fsrc); opj_destroy_codec(l_codec); diff --git a/src/bin/jpip/opj_jpip_compress.c b/src/bin/jpip/opj_jpip_compress.c index 6c5fd05f..2ff3809e 100644 --- a/src/bin/jpip/opj_jpip_compress.c +++ b/src/bin/jpip/opj_jpip_compress.c @@ -86,7 +86,7 @@ typedef struct img_folder{ float *rates; }img_fol_t; -void encode_help_display(void) { +static void encode_help_display(void) { fprintf(stdout,"HELP for image_to_j2k\n----\n\n"); fprintf(stdout,"- the -h option displays this help information on screen\n\n"); @@ -327,7 +327,7 @@ void encode_help_display(void) { fprintf(stdout,"TotalDisto\n\n"); } -OPJ_PROG_ORDER give_progression(char progression[4]) { +static OPJ_PROG_ORDER give_progression(const char progression[4]) { if(strncmp(progression, "LRCP", 4) == 0) { return LRCP; } @@ -347,7 +347,7 @@ OPJ_PROG_ORDER give_progression(char progression[4]) { return PROG_UNKNOWN; } -unsigned int get_num_images(char *imgdirpath){ +static unsigned int get_num_images(char *imgdirpath){ DIR *dir; struct dirent* content; unsigned int num_images = 0; @@ -369,7 +369,7 @@ unsigned int get_num_images(char *imgdirpath){ return num_images; } -int load_images(dircnt_t *dirptr, char *imgdirpath){ +static int load_images(dircnt_t *dirptr, char *imgdirpath){ DIR *dir; struct dirent* content; int i = 0; @@ -394,7 +394,7 @@ int load_images(dircnt_t *dirptr, char *imgdirpath){ return 0; } -int get_file_format(char *filename) { +static int get_file_format(char *filename) { unsigned int i; static const char *extension[] = { "pgx", "pnm", "pgm", "ppm", "pbm", "pam", "bmp", "tif", "raw", "rawl", "tga", "png", "j2k", "jp2", "j2c", "jpc" @@ -414,14 +414,14 @@ int get_file_format(char *filename) { return -1; } -char * get_file_name(char *name){ +static char * get_file_name(char *name){ char *fname; fname= (char*)opj_malloc(OPJ_PATH_LEN*sizeof(char)); fname= strtok(name,"."); return fname; } -char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_cparameters_t *parameters){ +static char get_next_file(int imageno,dircnt_t *dirptr,img_fol_t *img_fol, opj_cparameters_t *parameters){ char image_filename[OPJ_PATH_LEN], infilename[OPJ_PATH_LEN],outfilename[OPJ_PATH_LEN],temp_ofname[OPJ_PATH_LEN]; char *temp_p, temp1[OPJ_PATH_LEN]=""; @@ -464,7 +464,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres){ return 2; } -void cinema_parameters(opj_cparameters_t *parameters){ +static void cinema_parameters(opj_cparameters_t *parameters){ parameters->tile_size_on = OPJ_FALSE; parameters->cp_tdx=1; parameters->cp_tdy=1; @@ -497,7 +497,7 @@ void cinema_parameters(opj_cparameters_t *parameters){ } -void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol){ +static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_fol_t *img_fol){ int i; float temp_rate; @@ -582,7 +582,7 @@ void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *image, img_ /* ------------------------------------------------------------------------------------ */ -int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, +static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, img_fol_t *img_fol, raw_cparameters_t *raw_cp, char *indexfilename) { int i, j, totlen, c; opj_option_t long_option[]={ @@ -1537,21 +1537,21 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, /** sample error callback expecting a FILE* client object */ -void error_file_callback(const char *msg, void *client_data) { +static void error_file_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_file_callback(const char *msg, void *client_data) { +static void warning_file_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting a FILE* client object */ -void info_file_callback(const char *msg, void *client_data) { +static void info_file_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[INFO] %s", msg); } @@ -1559,21 +1559,21 @@ void info_file_callback(const char *msg, void *client_data) { /** sample error debug callback expecting no client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[ERROR] %s", msg); } /** sample warning debug callback expecting no client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); } diff --git a/src/bin/mj2/opj_mj2_compress.c b/src/bin/mj2/opj_mj2_compress.c index fbf25fe3..73ddcbe8 100644 --- a/src/bin/mj2/opj_mj2_compress.c +++ b/src/bin/mj2/opj_mj2_compress.c @@ -50,21 +50,21 @@ Size of memory first allocated for MOOV box /** sample error callback expecting a FILE* client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting a FILE* client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[INFO] %s", msg); } @@ -72,7 +72,7 @@ void info_callback(const char *msg, void *client_data) { /* -------------------------------------------------------------------------- */ -void help_display() +static void help_display() { fprintf(stdout,"HELP for frames_to_mj2\n----\n\n"); fprintf(stdout,"- the -h option displays this help information on screen\n\n"); @@ -197,7 +197,7 @@ void help_display() fprintf(stdout,"TotalDisto\n\n"); } -OPJ_PROG_ORDER give_progression(char progression[5]) +static OPJ_PROG_ORDER give_progression(const char progression[5]) { if (progression[0] == 'L' && progression[1] == 'R' && progression[2] == 'C' && progression[3] == 'P') { diff --git a/src/bin/mj2/opj_mj2_decompress.c b/src/bin/mj2/opj_mj2_decompress.c index d4258ef1..ee312f61 100644 --- a/src/bin/mj2/opj_mj2_decompress.c +++ b/src/bin/mj2/opj_mj2_decompress.c @@ -50,21 +50,21 @@ /** sample error callback expecting a FILE* client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting a FILE* client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[INFO] %s", msg); } diff --git a/src/bin/mj2/opj_mj2_wrap.c b/src/bin/mj2/opj_mj2_wrap.c index efc08d3d..f0404f89 100644 --- a/src/bin/mj2/opj_mj2_wrap.c +++ b/src/bin/mj2/opj_mj2_wrap.c @@ -183,21 +183,21 @@ fin: /** sample error callback expecting a FILE* client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting a FILE* client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[INFO] %s", msg); } diff --git a/src/lib/openjp2/function_list.h b/src/lib/openjp2/function_list.h index 0e27d75a..17a50051 100644 --- a/src/lib/openjp2/function_list.h +++ b/src/lib/openjp2/function_list.h @@ -73,7 +73,7 @@ typedef struct opj_procedure_list * * @return the newly created validation list. */ -opj_procedure_list_t * opj_procedure_list_create(); +opj_procedure_list_t * opj_procedure_list_create(void); /** * Destroys a validation list. diff --git a/src/lib/openjp2/mct.h b/src/lib/openjp2/mct.h index 7758f0c3..5a87a78f 100644 --- a/src/lib/openjp2/mct.h +++ b/src/lib/openjp2/mct.h @@ -134,11 +134,11 @@ void opj_calculate_norms( OPJ_FLOAT64 * pNorms, /** FIXME DOC */ -const OPJ_FLOAT64 * opj_mct_get_mct_norms (); +const OPJ_FLOAT64 * opj_mct_get_mct_norms (void); /** FIXME DOC */ -const OPJ_FLOAT64 * opj_mct_get_mct_norms_real (); +const OPJ_FLOAT64 * opj_mct_get_mct_norms_real (void); /* ----------------------------------------------------------------------- */ /*@}*/ diff --git a/src/lib/openjp2/openjpeg.c b/src/lib/openjp2/openjpeg.c index e5055534..b0f4be39 100644 --- a/src/lib/openjp2/openjpeg.c +++ b/src/lib/openjp2/openjpeg.c @@ -199,13 +199,13 @@ opj_bool OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec, /* ---------------------------------------------------------------------- */ -OPJ_SIZE_T opj_read_from_file (void * p_buffer, OPJ_SIZE_T p_nb_bytes, FILE * p_file) +static OPJ_SIZE_T opj_read_from_file (void * p_buffer, OPJ_SIZE_T p_nb_bytes, FILE * p_file) { OPJ_SIZE_T l_nb_read = fread(p_buffer,1,p_nb_bytes,p_file); return l_nb_read ? l_nb_read : -1; } -OPJ_UINT64 opj_get_data_length_from_file (FILE * p_file) +static OPJ_UINT64 opj_get_data_length_from_file (FILE * p_file) { OPJ_OFF_T file_length = 0; @@ -216,12 +216,12 @@ OPJ_UINT64 opj_get_data_length_from_file (FILE * p_file) return file_length; } -OPJ_SIZE_T opj_write_from_file (void * p_buffer, OPJ_SIZE_T p_nb_bytes, FILE * p_file) +static OPJ_SIZE_T opj_write_from_file (void * p_buffer, OPJ_SIZE_T p_nb_bytes, FILE * p_file) { return fwrite(p_buffer,1,p_nb_bytes,p_file); } -OPJ_OFF_T opj_skip_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data) +static OPJ_OFF_T opj_skip_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data) { if (OPJ_FSEEK(p_user_data,p_nb_bytes,SEEK_CUR)) { return -1; @@ -230,7 +230,7 @@ OPJ_OFF_T opj_skip_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data) return p_nb_bytes; } -opj_bool opj_seek_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data) +static opj_bool opj_seek_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data) { if (OPJ_FSEEK(p_user_data,p_nb_bytes,SEEK_SET)) { return OPJ_FALSE; diff --git a/src/lib/openjp2/t1.h b/src/lib/openjp2/t1.h index ab6c626d..09fbe0f6 100644 --- a/src/lib/openjp2/t1.h +++ b/src/lib/openjp2/t1.h @@ -143,7 +143,7 @@ opj_bool opj_t1_decode_cblks( opj_t1_t* t1, * and initializes the look-up tables of the Tier-1 coder/decoder * @return a new T1 handle if successful, returns NULL otherwise */ -opj_t1_t* opj_t1_create(); +opj_t1_t* opj_t1_create(void); /** * Destroys a previously created T1 handle diff --git a/src/lib/openjp3d/bio.h b/src/lib/openjp3d/bio.h index 47010d46..2c91342f 100755 --- a/src/lib/openjp3d/bio.h +++ b/src/lib/openjp3d/bio.h @@ -63,7 +63,7 @@ typedef struct opj_bio { Create a new BIO handle @return Returns a new BIO handle if successful, returns NULL otherwise */ -opj_bio_t* bio_create(); +opj_bio_t* bio_create(void); /** Destroy a previously created BIO handle @param bio BIO handle to destroy diff --git a/src/lib/openjp3d/cio.c b/src/lib/openjp3d/cio.c index 4ac64fd3..4e99c847 100755 --- a/src/lib/openjp3d/cio.c +++ b/src/lib/openjp3d/cio.c @@ -122,7 +122,7 @@ unsigned char *cio_getbp(opj_cio_t *cio) { /* * Write a byte. */ -bool cio_byteout(opj_cio_t *cio, unsigned char v) { +static bool cio_byteout(opj_cio_t *cio, unsigned char v) { if (cio->bp >= cio->end) { opj_event_msg(cio->cinfo, EVT_ERROR, "write error\n"); return false; @@ -134,7 +134,7 @@ bool cio_byteout(opj_cio_t *cio, unsigned char v) { /* * Read a byte. */ -unsigned char cio_bytein(opj_cio_t *cio) { +static unsigned char cio_bytein(opj_cio_t *cio) { if (cio->bp >= cio->end) { opj_event_msg(cio->cinfo, EVT_ERROR, "read error\n"); return 0; diff --git a/src/lib/openjp3d/jp3d.c b/src/lib/openjp3d/jp3d.c index 5ab5d94b..593cda82 100755 --- a/src/lib/openjp3d/jp3d.c +++ b/src/lib/openjp3d/jp3d.c @@ -316,7 +316,7 @@ static void j3d_read_nlt(opj_j3d_t *j3d); /* ----------------------------------------------------------------------- */ -void j3d_dump_volume(FILE *fd, opj_volume_t * vol) { +static void j3d_dump_volume(FILE *fd, opj_volume_t * vol) { int compno; fprintf(fd, "volume {\n"); fprintf(fd, " x0=%d, y0=%d, z0=%d, x1=%d, y1=%d, z1=%d\n", vol->x0, vol->y0, vol->z0,vol->x1, vol->y1, vol->z1); @@ -332,7 +332,7 @@ void j3d_dump_volume(FILE *fd, opj_volume_t * vol) { fprintf(fd, "}\n"); } -void j3d_dump_cp(FILE *fd, opj_volume_t * vol, opj_cp_t * cp) { +static void j3d_dump_cp(FILE *fd, opj_volume_t * vol, opj_cp_t * cp) { int tileno, compno, layno, bandno, resno, numbands; fprintf(fd, "coding parameters {\n"); fprintf(fd, " tx0=%d, ty0=%d, tz0=%d\n", cp->tx0, cp->ty0, cp->tz0); diff --git a/src/lib/openjp3d/jp3d_lib.h b/src/lib/openjp3d/jp3d_lib.h index a2fb05ba..dae43275 100755 --- a/src/lib/openjp3d/jp3d_lib.h +++ b/src/lib/openjp3d/jp3d_lib.h @@ -43,7 +43,7 @@ The functions in JP3D_LIB.C are internal utilities mainly used for memory manage Difference in successive opj_clock() calls tells you the elapsed time @return Returns time in seconds */ -double opj_clock(); +double opj_clock(void); /** Allocate a memory block with elements initialized to 0 diff --git a/src/lib/openjp3d/mqc.h b/src/lib/openjp3d/mqc.h index 90253356..023bf415 100755 --- a/src/lib/openjp3d/mqc.h +++ b/src/lib/openjp3d/mqc.h @@ -78,7 +78,7 @@ typedef struct opj_mqc { Create a new MQC handle @return Returns a new MQC handle if successful, returns NULL otherwise */ -opj_mqc_t* mqc_create(); +opj_mqc_t* mqc_create(void); /** Destroy a previously created MQC handle @param mqc MQC handle to destroy diff --git a/src/lib/openjp3d/openjp3d.h b/src/lib/openjp3d/openjp3d.h index d7ac42da..44fe1f70 100755 --- a/src/lib/openjp3d/openjp3d.h +++ b/src/lib/openjp3d/openjp3d.h @@ -560,7 +560,7 @@ extern "C" { ========================================================== */ -OPJ_API const char * OPJ_CALLCONV opj_version(); +OPJ_API const char * OPJ_CALLCONV opj_version(void); /* ========================================================== diff --git a/src/lib/openjp3d/raw.h b/src/lib/openjp3d/raw.h index c26546ad..55e889da 100755 --- a/src/lib/openjp3d/raw.h +++ b/src/lib/openjp3d/raw.h @@ -66,7 +66,7 @@ typedef struct opj_raw { Create a new RAW handle @return Returns a new RAW handle if successful, returns NULL otherwise */ -opj_raw_t* raw_create(); +opj_raw_t* raw_create(void); /** Destroy a previously created RAW handle @param raw RAW handle to destroy diff --git a/src/lib/openjp3d/tcd.c b/src/lib/openjp3d/tcd.c index 88b1bcf6..84c1ed1e 100755 --- a/src/lib/openjp3d/tcd.c +++ b/src/lib/openjp3d/tcd.c @@ -82,7 +82,7 @@ void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_volume_t * vol) { fprintf(fd, "}\n"); } -void tilec_dump(FILE *fd, opj_tcd_tilecomp_t *tilec) { +static void tilec_dump(FILE *fd, opj_tcd_tilecomp_t *tilec) { int i=0,k; int datalen; diff --git a/src/lib/openmj2/jpt.c b/src/lib/openmj2/jpt.c index a2566ea8..89b7565e 100644 --- a/src/lib/openmj2/jpt.c +++ b/src/lib/openmj2/jpt.c @@ -34,7 +34,7 @@ * Store information (7 bits) in value * */ -unsigned int jpt_read_VBAS_info(opj_cio_t *cio, unsigned int value) { +static unsigned int jpt_read_VBAS_info(opj_cio_t *cio, unsigned int value) { unsigned char elmt; elmt = cio_read(cio, 1); @@ -69,7 +69,7 @@ void jpt_init_msg_header(opj_jpt_msg_header_t * header) { * Only parameters always present in message header * */ -void jpt_reinit_msg_header(opj_jpt_msg_header_t * header) { +static void jpt_reinit_msg_header(opj_jpt_msg_header_t * header) { header->Id = 0; /* In-class Identifier */ header->last_byte = 0; /* Last byte information */ header->Msg_offset = 0; /* Message offset */ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e01834a6..9e53f366 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -50,6 +50,8 @@ add_test(tte2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 3 2048 2048 1024 1024 add_test(tte3 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 2048 2048 1024 1024 8 1 tte3.j2k) add_test(tte4 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 256 256 128 128 8 0 tte4.j2k) add_test(tte5 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 512 512 256 256 8 0 tte5.j2k) +#add_test(tte6 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 8192 8192 512 512 8 0 tte6.j2k) +#add_test(tte7 ${EXECUTABLE_OUTPUT_PATH}/test_tile_encoder 1 32768 32768 512 512 8 0 tte7.jp2) add_executable(test_tile_decoder test_tile_decoder.c) target_link_libraries(test_tile_decoder ${OPENJPEG_LIBRARY_NAME}) @@ -60,6 +62,10 @@ add_test(ttd1 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 1024 1024 tte1.j2k set_property(TEST ttd1 APPEND PROPERTY DEPENDS tte1) add_test(ttd2 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 1024 1024 tte2.jp2) set_property(TEST ttd2 APPEND PROPERTY DEPENDS tte2) +#add_test(ttd6 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 512 512 tte6.j2k) +#set_property(TEST ttd6 APPEND PROPERTY DEPENDS tte6) +#add_test(ttd7 ${EXECUTABLE_OUTPUT_PATH}/test_tile_decoder 0 0 512 512 tte7.jp2) +#set_property(TEST ttd7 APPEND PROPERTY DEPENDS tte7) # No image send to the dashboard if lib PNG is not available. if(NOT HAVE_LIBPNG) diff --git a/tests/compareRAWimages.c b/tests/compareRAWimages.c index 0421bebf..53e423b8 100644 --- a/tests/compareRAWimages.c +++ b/tests/compareRAWimages.c @@ -62,7 +62,7 @@ void compareRAWimages_help_display(void) { /******************************************************************************* * Parse command line *******************************************************************************/ -int parse_cmdline_cmp(int argc, char **argv, test_cmp_parameters* param) +static int parse_cmdline_cmp(int argc, char **argv, test_cmp_parameters* param) { int sizemembasefile, sizememtestfile; int index; diff --git a/tests/compare_dump_files.c b/tests/compare_dump_files.c index e503d120..fa477495 100644 --- a/tests/compare_dump_files.c +++ b/tests/compare_dump_files.c @@ -50,7 +50,7 @@ typedef struct test_cmp_parameters /******************************************************************************* * Command line help function *******************************************************************************/ -void compare_dump_files_help_display(void) { +static void compare_dump_files_help_display(void) { fprintf(stdout,"\nList of parameters for the compare_dump_files function \n"); fprintf(stdout,"\n"); fprintf(stdout," -b \t REQUIRED \t filename to the reference/baseline dump file \n"); @@ -60,7 +60,7 @@ void compare_dump_files_help_display(void) { /******************************************************************************* * Parse command line *******************************************************************************/ -int parse_cmdline_cmp(int argc, char **argv, test_cmp_parameters* param) +static int parse_cmdline_cmp(int argc, char **argv, test_cmp_parameters* param) { int sizemembasefile, sizememtestfile; int index; diff --git a/tests/j2k_random_tile_access.c b/tests/j2k_random_tile_access.c index d8b70f15..6fb7e26a 100644 --- a/tests/j2k_random_tile_access.c +++ b/tests/j2k_random_tile_access.c @@ -48,7 +48,7 @@ #include "format_defs.h" /* -------------------------------------------------------------------------- */ -int get_file_format(const char *filename) { +static int get_file_format(const char *filename) { unsigned int i; static const char *extension[] = {"pgx", "pnm", "pgm", "ppm", "bmp","tif", "raw", "tga", "png", "j2k", "jp2", "jpt", "j2c", "jpc" }; static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, TIF_DFMT, RAW_DFMT, TGA_DFMT, PNG_DFMT, J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT }; @@ -72,21 +72,21 @@ int get_file_format(const char *filename) { /** sample error callback expecting a FILE* client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); } diff --git a/tests/test_tile_decoder.c b/tests/test_tile_decoder.c index 8ff7ad28..6691cd4e 100644 --- a/tests/test_tile_decoder.c +++ b/tests/test_tile_decoder.c @@ -139,35 +139,35 @@ static int infile_format(const char *fname) /** sample error callback expecting a FILE* client object */ -void error_callback_file(const char *msg, void *client_data) { +static void error_callback_file(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback_file(const char *msg, void *client_data) { +static void warning_callback_file(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample error debug callback expecting no client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[ERROR] %s", msg); } /** sample warning debug callback expecting no client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); } diff --git a/tests/test_tile_encoder.c b/tests/test_tile_encoder.c index 160391b0..a405d86e 100644 --- a/tests/test_tile_encoder.c +++ b/tests/test_tile_encoder.c @@ -38,35 +38,35 @@ /** sample error callback expecting a FILE* client object */ -void error_callback_file(const char *msg, void *client_data) { +static void error_callback_file(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[ERROR] %s", msg); } /** sample warning callback expecting a FILE* client object */ -void warning_callback_file(const char *msg, void *client_data) { +static void warning_callback_file(const char *msg, void *client_data) { FILE *stream = (FILE*)client_data; fprintf(stream, "[WARNING] %s", msg); } /** sample error debug callback expecting no client object */ -void error_callback(const char *msg, void *client_data) { +static void error_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[ERROR] %s", msg); } /** sample warning debug callback expecting no client object */ -void warning_callback(const char *msg, void *client_data) { +static void warning_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[WARNING] %s", msg); } /** sample debug callback expecting no client object */ -void info_callback(const char *msg, void *client_data) { +static void info_callback(const char *msg, void *client_data) { (void)client_data; fprintf(stdout, "[INFO] %s", msg); }