[trunk] fix warnings when printing large integers

This commit is contained in:
Julien Malik 2011-12-01 10:50:14 +00:00
parent af9ad1580a
commit 440adddcde
4 changed files with 20 additions and 8 deletions

View File

@ -7,6 +7,7 @@ What's New for OpenJPEG
December 1, 2011 December 1, 2011
* [mickael] fix a warning about a recent commit (1104) * [mickael] fix a warning about a recent commit (1104)
* [jmalik] fix warnings when printing large integers
November 30, 2011 November 30, 2011
* [jmalik] implement Large File support in the library : * [jmalik] implement Large File support in the library :

View File

@ -383,7 +383,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
fprintf(stream, "%d\n", cstr_info->marknum); fprintf(stream, "%d\n", cstr_info->marknum);
fprintf(stream, "type\tstart_pos length\n"); fprintf(stream, "type\tstart_pos length\n");
for (x = 0; x < cstr_info->marknum; x++) for (x = 0; x < cstr_info->marknum; x++)
fprintf(stream, "%X\t%9d %9d\n", cstr_info->marker[x].type, cstr_info->marker[x].pos, cstr_info->marker[x].len); fprintf(stream, "%X\t%9" OPJ_OFF_F "d %9d\n", cstr_info->marker[x].type, cstr_info->marker[x].pos, cstr_info->marker[x].len);
} }
/* <<UniPG */ /* <<UniPG */
fclose(stream); fclose(stream);

View File

@ -7735,14 +7735,15 @@ void j2k_dump_MH_index(opj_j2k_v2_t* p_j2k, FILE* out_stream)
fprintf(out_stream, "Codestream index from main header: {\n"); fprintf(out_stream, "Codestream index from main header: {\n");
fprintf(out_stream, "\t Main header start position=%d\n\t Main header end position=%d\n", fprintf(out_stream, "\t Main header start position=%" OPJ_OFF_F "d\n"
"\t Main header end position=%" OPJ_OFF_F "d\n",
cstr_index->main_head_start, cstr_index->main_head_end); cstr_index->main_head_start, cstr_index->main_head_end);
fprintf(out_stream, "\t Marker list: {\n"); fprintf(out_stream, "\t Marker list: {\n");
if (cstr_index->marker){ if (cstr_index->marker){
for (it_marker=0; it_marker < cstr_index->marknum ; it_marker++){ for (it_marker=0; it_marker < cstr_index->marknum ; it_marker++){
fprintf(out_stream, "\t\t type=%#x, pos=%d, len=%d\n", fprintf(out_stream, "\t\t type=%#x, pos=%" OPJ_OFF_F "d, len=%d\n",
cstr_index->marker[it_marker].type, cstr_index->marker[it_marker].type,
cstr_index->marker[it_marker].pos, cstr_index->marker[it_marker].pos,
cstr_index->marker[it_marker].len ); cstr_index->marker[it_marker].len );
@ -7762,7 +7763,7 @@ void j2k_dump_MH_index(opj_j2k_v2_t* p_j2k, FILE* out_stream)
if (cstr_index->tile_index[it_tile].tp_index){ if (cstr_index->tile_index[it_tile].tp_index){
for (it_tile_part =0; it_tile_part < nb_of_tile_part; it_tile_part++){ for (it_tile_part =0; it_tile_part < nb_of_tile_part; it_tile_part++){
fprintf(out_stream, "\t\t\t tile-part[%d]: star_pos=%d, end_header=%d, end_pos=%d.\n", fprintf(out_stream, "\t\t\t tile-part[%d]: star_pos=%" OPJ_OFF_F "d, end_header=%" OPJ_OFF_F "d, end_pos=%" OPJ_OFF_F "d.\n",
it_tile_part, it_tile_part,
cstr_index->tile_index[it_tile].tp_index[it_tile_part].start_pos, cstr_index->tile_index[it_tile].tp_index[it_tile_part].start_pos,
cstr_index->tile_index[it_tile].tp_index[it_tile_part].end_header, cstr_index->tile_index[it_tile].tp_index[it_tile_part].end_header,
@ -7772,7 +7773,7 @@ void j2k_dump_MH_index(opj_j2k_v2_t* p_j2k, FILE* out_stream)
if (cstr_index->tile_index[it_tile].marker){ if (cstr_index->tile_index[it_tile].marker){
for (it_marker=0; it_marker < cstr_index->tile_index[it_tile].marknum ; it_marker++){ for (it_marker=0; it_marker < cstr_index->tile_index[it_tile].marknum ; it_marker++){
fprintf(out_stream, "\t\t type=%#x, pos=%d, len=%d\n", fprintf(out_stream, "\t\t type=%#x, pos=%" OPJ_OFF_F "d, len=%d\n",
cstr_index->tile_index[it_tile].marker[it_marker].type, cstr_index->tile_index[it_tile].marker[it_marker].type,
cstr_index->tile_index[it_tile].marker[it_marker].pos, cstr_index->tile_index[it_tile].marker[it_marker].pos,
cstr_index->tile_index[it_tile].marker[it_marker].len ); cstr_index->tile_index[it_tile].marker[it_marker].len );

View File

@ -76,7 +76,7 @@ typedef int opj_bool; /*FIXME it should be to follow the name of others OPJ_TYPE
#define OPJ_TRUE 1 #define OPJ_TRUE 1
#define OPJ_FALSE 0 #define OPJ_FALSE 0
// FIXME : should be better defined by configure/CMake test /* FIXME : should be better defined by configure/CMake test */
typedef unsigned int OPJ_UINT32; typedef unsigned int OPJ_UINT32;
typedef int OPJ_INT32; typedef int OPJ_INT32;
typedef unsigned short OPJ_UINT16; typedef unsigned short OPJ_UINT16;
@ -88,17 +88,27 @@ typedef double OPJ_FLOAT64;
typedef float OPJ_FLOAT32; typedef float OPJ_FLOAT32;
#if (defined(WIN32) || defined(WIN64)) && !defined(__MINGW32__) #if (defined(WIN32) || defined(WIN64)) && !defined(__MINGW32__)
typedef signed __int64 OPJ_INT64; typedef signed __int64 OPJ_INT64;
#define OPJ_INT64_F "I64"
typedef unsigned __int64 OPJ_UINT64; typedef unsigned __int64 OPJ_UINT64;
#define OPJ_UINT64_F "I64"
#else #else
typedef long long OPJ_INT64; typedef long long OPJ_INT64;
#define OPJ_INT64_F "ll"
typedef unsigned long long OPJ_UINT64; typedef unsigned long long OPJ_UINT64;
#define OPJ_UINT64_F "ll"
#endif #endif
/* 64-bit file and blob offset type */ /* 64-bit file offset type */
typedef OPJ_INT64 OPJ_OFF_T; typedef OPJ_INT64 OPJ_OFF_T;
#define OPJ_OFF_F OPJ_INT64_F
// Avoid compile-time warning because parameter is not used /* Avoid compile-time warning because parameter is not used */
#define OPJ_ARG_NOT_USED(x) (void)(x) #define OPJ_ARG_NOT_USED(x) (void)(x)
/* /*