X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest_tile_decoder.c;h=e5b851e8fde1bdb3ac8afa614b65bf19f469e18d;hb=0782cd075d7e9678bf1cb448c1f3d048fabe4489;hp=96b5e8292eb1885a2f614dac09405790244a7f40;hpb=8d3ef0729cd787cdb9337d9b25e4862fcc847a0d;p=openjpeg.git diff --git a/tests/test_tile_decoder.c b/tests/test_tile_decoder.c index 96b5e829..e5b851e8 100644 --- a/tests/test_tile_decoder.c +++ b/tests/test_tile_decoder.c @@ -178,7 +178,7 @@ int main (int argc, char *argv[]) int da_y0=0; int da_x1=1000; int da_y1=1000; - char input_file[64]; + const char *input_file; /* should be test_tile_decoder 0 0 1000 1000 tte1.j2k */ if( argc == 6 ) @@ -187,7 +187,7 @@ int main (int argc, char *argv[]) da_y0=atoi(argv[2]); da_x1=atoi(argv[3]); da_y1=atoi(argv[4]); - strcpy(input_file,argv[5]); + input_file = argv[5]; } else @@ -196,14 +196,14 @@ int main (int argc, char *argv[]) da_y0=0; da_x1=1000; da_y1=1000; - strcpy(input_file,"test.j2k"); + input_file = "test.j2k"; } if (! l_data) { return EXIT_FAILURE; } - l_stream = opj_stream_create_default_file_stream_v3(input_file,OPJ_TRUE); + l_stream = opj_stream_create_default_file_stream(input_file,OPJ_TRUE); if (!l_stream){ free(l_data); fprintf(stderr, "ERROR -> failed to create the stream from the file\n"); @@ -244,7 +244,7 @@ int main (int argc, char *argv[]) { fprintf(stderr, "ERROR -> Not a valid JPEG2000 file!\n"); free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); return EXIT_FAILURE; } } @@ -259,7 +259,7 @@ int main (int argc, char *argv[]) { fprintf(stderr, "ERROR -> j2k_dump: failed to setup the decoder\n"); free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); return EXIT_FAILURE; } @@ -269,7 +269,7 @@ int main (int argc, char *argv[]) { fprintf(stderr, "ERROR -> j2k_to_image: failed to read the header\n"); free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); return EXIT_FAILURE; } @@ -277,7 +277,7 @@ int main (int argc, char *argv[]) if (!opj_set_decode_area(l_codec, l_image, da_x0, da_y0,da_x1, da_y1)){ fprintf(stderr, "ERROR -> j2k_to_image: failed to set the decoded area\n"); free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(l_image); return EXIT_FAILURE; @@ -298,7 +298,7 @@ int main (int argc, char *argv[]) &l_go_on)) { free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(l_image); return EXIT_FAILURE; @@ -312,7 +312,7 @@ int main (int argc, char *argv[]) if (! l_new_data) { free(l_new_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(l_image); return EXIT_FAILURE; @@ -324,7 +324,7 @@ int main (int argc, char *argv[]) if (! opj_decode_tile_data(l_codec,l_tile_index,l_data,l_data_size,l_stream)) { free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(l_image); return EXIT_FAILURE; @@ -336,7 +336,7 @@ int main (int argc, char *argv[]) if (! opj_end_decompress(l_codec,l_stream)) { free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(l_image); return EXIT_FAILURE; @@ -344,7 +344,7 @@ int main (int argc, char *argv[]) /* Free memory */ free(l_data); - opj_stream_destroy_v3(l_stream); + opj_stream_destroy(l_stream); opj_destroy_codec(l_codec); opj_image_destroy(l_image);