diff options
| author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2012-03-19 14:24:26 +0000 |
|---|---|---|
| committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2012-03-19 14:24:26 +0000 |
| commit | b9d271c1a8d24ed4f3c6fe4cdd04c659648487eb (patch) | |
| tree | 01e00f0c1421edffc40a8479e5d29316a50ecde6 | |
| parent | b3931741ef2bc248b7f2db5727e0613df9eb01a6 (diff) | |
[trunk] Fix invalid truncation from off_t to int (thanks to -Wconversion for report)
| -rw-r--r-- | applications/codec/index.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/applications/codec/index.c b/applications/codec/index.c index c2e46c00..c71730fe 100644 --- a/applications/codec/index.c +++ b/applications/codec/index.c @@ -121,7 +121,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) { } for (tileno = 0; tileno < cstr_info->tw * cstr_info->th; tileno++) { - int start_pos, end_ph_pos, end_pos; + OPJ_OFF_T start_pos, end_ph_pos, end_pos; double disto = 0; int max_numdecompos = 0; pack_nb = 0; @@ -161,7 +161,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) { end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos; end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos; disto = cstr_info->tile[tileno].packet[pack_nb].disto; - fprintf(stream, "%4d %6d %7d %5d %6d %6d %6d %6d %7d", + fprintf(stream, "%4d %6d %7d %5d %6d %6d %6" PRId64 " %6" PRId64 " %7" PRId64, pack_nb, tileno, layno, resno, compno, precno, start_pos, end_ph_pos, end_pos); if (disto_on) fprintf(stream, " %8e", disto); @@ -192,7 +192,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) { end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos; end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos; disto = cstr_info->tile[tileno].packet[pack_nb].disto; - fprintf(stream, "%4d %6d %5d %7d %6d %6d %9d %9d %7d", + fprintf(stream, "%4d %6d %5d %7d %6d %6d %9" PRId64 " %9" PRId64 " %7" PRId64, pack_nb, tileno, resno, layno, compno, precno, start_pos, end_ph_pos, end_pos); if (disto_on) fprintf(stream, " %8e", disto); @@ -237,7 +237,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) { end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos; end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos; disto = cstr_info->tile[tileno].packet[pack_nb].disto; - fprintf(stream, "%4d %6d %5d %6d %6d %7d %9d %9d %7d", + fprintf(stream, "%4d %6d %5d %6d %6d %7d %9" PRId64 " %9" PRId64 " %7" PRId64, pack_nb, tileno, resno, precno, compno, layno, start_pos, end_ph_pos, end_pos); if (disto_on) fprintf(stream, " %8e", disto); @@ -294,7 +294,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) { end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos; end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos; disto = cstr_info->tile[tileno].packet[pack_nb].disto; - fprintf(stream, "%4d %6d %6d %6d %5d %7d %9d %9d %7d", + fprintf(stream, "%4d %6d %6d %6d %5d %7d %9" PRId64 " %9" PRId64 " %7" PRId64, pack_nb, tileno, precno, compno, resno, layno, start_pos, end_ph_pos, end_pos); if (disto_on) fprintf(stream, " %8e", disto); @@ -352,7 +352,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) { end_ph_pos = cstr_info->tile[tileno].packet[pack_nb].end_ph_pos; end_pos = cstr_info->tile[tileno].packet[pack_nb].end_pos; disto = cstr_info->tile[tileno].packet[pack_nb].disto; - fprintf(stream, "%4d %6d %6d %6d %5d %7d %9d %9d %7d", + fprintf(stream, "%4d %6d %6d %6d %5d %7d %9" PRId64 " %9" PRId64 " %7" PRId64, pack_nb, tileno, compno, precno, resno, layno, start_pos, end_ph_pos, end_pos); if (disto_on) fprintf(stream, " %8e", disto); |
