[FFmpeg-cvslog] Adjust printf conversion specifiers to match variable signedness

Diego Biurrun git at videolan.org
Fri Mar 24 14:37:11 EET 2017


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Dec 15 10:50:18 2015 +0100| [1263b2039eb5aaf1522e9de9f07c787ab30a5f50] | committer: Diego Biurrun

Adjust printf conversion specifiers to match variable signedness

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1263b2039eb5aaf1522e9de9f07c787ab30a5f50
---

 libavcodec/dnxhddec.c      | 10 +++++-----
 libavcodec/dvdec.c         |  2 +-
 libavcodec/dxv.c           |  2 +-
 libavcodec/fraps.c         |  2 +-
 libavcodec/txd.c           |  4 ++--
 libavformat/mov.c          | 42 +++++++++++++++++++++---------------------
 libavformat/rtpdec_jpeg.c  |  2 +-
 libavformat/rtpdec_xiph.c  |  4 ++--
 libavformat/rtpenc.c       |  2 +-
 libswscale/tests/swscale.c |  2 +-
 10 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 50747ea..052f3d0 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -138,7 +138,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     ctx->height = AV_RB16(buf + 0x18);
     ctx->width  = AV_RB16(buf + 0x1a);
 
-    ff_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
+    ff_dlog(ctx->avctx, "width %u, height %u\n", ctx->width, ctx->height);
 
     if (buf[0x21] == 0x58) { /* 10 bit */
         ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 10;
@@ -185,7 +185,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     }
 
     if (buf_size < ctx->cid_table->coding_unit_size) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size (%d < %d).\n",
+        av_log(ctx->avctx, AV_LOG_ERROR, "incorrect frame size (%d < %u).\n",
                buf_size, ctx->cid_table->coding_unit_size);
         return AVERROR_INVALIDDATA;
     }
@@ -194,7 +194,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     ctx->mb_height = buf[0x16d];
 
     ff_dlog(ctx->avctx,
-            "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
+            "mb width %u, mb height %u\n", ctx->mb_width, ctx->mb_height);
 
     if ((ctx->height + 15) >> 4 == ctx->mb_height && frame->interlaced_frame)
         ctx->height <<= 1;
@@ -202,7 +202,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     if (ctx->mb_height > 68 ||
         (ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4) {
         av_log(ctx->avctx, AV_LOG_ERROR,
-               "mb height too big: %d\n", ctx->mb_height);
+               "mb height too big: %u\n", ctx->mb_height);
         return AVERROR_INVALIDDATA;
     }
 
@@ -442,7 +442,7 @@ decode_coding_unit:
 
     if ((avctx->width || avctx->height) &&
         (ctx->width != avctx->width || ctx->height != avctx->height)) {
-        av_log(avctx, AV_LOG_WARNING, "frame size changed: %dx%d -> %dx%d\n",
+        av_log(avctx, AV_LOG_WARNING, "frame size changed: %dx%d -> %ux%u\n",
                avctx->width, avctx->height, ctx->width, ctx->height);
         first_field = 1;
     }
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index eca3b86..777725d 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -102,7 +102,7 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
 
     /* get the AC coefficients until last_index is reached */
     for (;;) {
-        ff_dlog(NULL, "%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16),
+        ff_dlog(NULL, "%2d: bits=%04x index=%u\n", pos, SHOW_UBITS(re, gb, 16),
                 re_index);
         /* our own optimized GET_RL_VLC */
         index   = NEG_USR32(re_cache, TEX_VLC_BITS);
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 99327df..e96ab44 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -421,7 +421,7 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
 
     if (size != bytestream2_get_bytes_left(gbc)) {
         av_log(avctx, AV_LOG_ERROR,
-               "Incomplete or invalid file (header %d, left %d).\n",
+               "Incomplete or invalid file (header %d, left %u).\n",
                size, bytestream2_get_bytes_left(gbc));
         return AVERROR_INVALIDDATA;
     }
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index eb61c70..c4ec23e 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -164,7 +164,7 @@ static int decode_frame(AVCodecContext *avctx,
 
     if (version > 5) {
         av_log(avctx, AV_LOG_ERROR,
-               "This file is encoded with Fraps version %d. " \
+               "This file is encoded with Fraps version %u. "
                "This codec can only decode versions <= 5.\n", version);
         return AVERROR_PATCHWELCOME;
     }
diff --git a/libavcodec/txd.c b/libavcodec/txd.c
index 463223c..ac46608 100644
--- a/libavcodec/txd.c
+++ b/libavcodec/txd.c
@@ -56,7 +56,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     flags           = bytestream2_get_byte(&gb);
 
     if (version < 8 || version > 9) {
-        av_log(avctx, AV_LOG_ERROR, "texture data version %i is unsupported\n",
+        av_log(avctx, AV_LOG_ERROR, "texture data version %u is unsupported\n",
                                                                     version);
         return AVERROR_PATCHWELCOME;
     }
@@ -66,7 +66,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     } else if (depth == 16 || depth == 32) {
         avctx->pix_fmt = AV_PIX_FMT_RGBA;
     } else {
-        av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth);
+        av_log(avctx, AV_LOG_ERROR, "depth of %u is unsupported\n", depth);
         return AVERROR_PATCHWELCOME;
     }
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 34ab205..0d7ce3d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1935,7 +1935,7 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     entries = avio_rb32(pb);
 
-    av_log(c->fc, AV_LOG_TRACE, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
+    av_log(c->fc, AV_LOG_TRACE, "track[%u].stsc.entries = %u\n", c->fc->nb_streams - 1, entries);
 
     if (!entries)
         return 0;
@@ -2032,7 +2032,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     entries = avio_rb32(pb);
 
-    av_log(c->fc, AV_LOG_TRACE, "keyframe_count = %d\n", entries);
+    av_log(c->fc, AV_LOG_TRACE, "keyframe_count = %u\n", entries);
 
     if (!entries)
     {
@@ -2087,14 +2087,14 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     }
     entries = avio_rb32(pb);
 
-    av_log(c->fc, AV_LOG_TRACE, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
+    av_log(c->fc, AV_LOG_TRACE, "sample_size = %u sample_count = %u\n", sc->sample_size, entries);
 
     sc->sample_count = entries;
     if (sample_size)
         return 0;
 
     if (field_size != 4 && field_size != 8 && field_size != 16 && field_size != 32) {
-        av_log(c->fc, AV_LOG_ERROR, "Invalid sample field size %d\n", field_size);
+        av_log(c->fc, AV_LOG_ERROR, "Invalid sample field size %u\n", field_size);
         return AVERROR_INVALIDDATA;
     }
 
@@ -2155,7 +2155,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb24(pb); /* flags */
     entries = avio_rb32(pb);
 
-    av_log(c->fc, AV_LOG_TRACE, "track[%i].stts.entries = %i\n",
+    av_log(c->fc, AV_LOG_TRACE, "track[%u].stts.entries = %u\n",
             c->fc->nb_streams-1, entries);
 
     if (!entries)
@@ -2215,7 +2215,7 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_rb24(pb); /* flags */
     entries = avio_rb32(pb);
 
-    av_log(c->fc, AV_LOG_TRACE, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
+    av_log(c->fc, AV_LOG_TRACE, "track[%u].ctts.entries = %u\n", c->fc->nb_streams - 1, entries);
 
     av_freep(&sc->ctts_data);
 
@@ -2372,9 +2372,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                     e->size = sample_size;
                     e->min_distance = distance;
                     e->flags = keyframe ? AVINDEX_KEYFRAME : 0;
-                    av_log(mov->fc, AV_LOG_TRACE, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
-                            "size %d, distance %d, keyframe %d\n", st->index, current_sample,
-                            current_offset, current_dts, sample_size, distance, keyframe);
+                    av_log(mov->fc, AV_LOG_TRACE, "AVIndex stream %d, sample %u, offset %"PRIx64", dts %"PRId64", "
+                           "size %u, distance %u, keyframe %d\n", st->index, current_sample,
+                           current_offset, current_dts, sample_size, distance, keyframe);
                 }
 
                 current_offset += sample_size;
@@ -2421,7 +2421,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
             total += chunk_count * count;
         }
 
-        av_log(mov->fc, AV_LOG_TRACE, "chunk count %d\n", total);
+        av_log(mov->fc, AV_LOG_TRACE, "chunk count %u\n", total);
         if (total >= UINT_MAX / sizeof(*st->index_entries) - st->nb_index_entries)
             return;
         if (av_reallocp_array(&st->index_entries,
@@ -2466,7 +2466,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                 }
 
                 if (st->nb_index_entries >= total) {
-                    av_log(mov->fc, AV_LOG_ERROR, "wrong chunk count %d\n", total);
+                    av_log(mov->fc, AV_LOG_ERROR, "wrong chunk count %u\n", total);
                     return;
                 }
                 e = &st->index_entries[st->nb_index_entries++];
@@ -2475,9 +2475,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
                 e->size = size;
                 e->min_distance = 0;
                 e->flags = AVINDEX_KEYFRAME;
-                av_log(mov->fc, AV_LOG_TRACE, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
-                        "size %d, duration %d\n", st->index, i, current_offset, current_dts,
-                        size, samples);
+                av_log(mov->fc, AV_LOG_TRACE, "AVIndex stream %d, chunk %u, offset %"PRIx64", dts %"PRId64", "
+                       "size %u, duration %u\n", st->index, i, current_offset, current_dts,
+                       size, samples);
 
                 current_offset += size;
                 current_dts += samples;
@@ -2920,7 +2920,7 @@ static int mov_read_tfdt(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         }
     }
     if (!st) {
-        av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %d\n", frag->track_id);
+        av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %u\n", frag->track_id);
         return AVERROR_INVALIDDATA;
     }
     sc = st->priv_data;
@@ -2955,7 +2955,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         }
     }
     if (!st) {
-        av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %d\n", frag->track_id);
+        av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %u\n", frag->track_id);
         return AVERROR_INVALIDDATA;
     }
     sc = st->priv_data;
@@ -2964,7 +2964,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     avio_r8(pb); /* version */
     flags = avio_rb24(pb);
     entries = avio_rb32(pb);
-    av_log(c->fc, AV_LOG_TRACE, "flags 0x%x entries %d\n", flags, entries);
+    av_log(c->fc, AV_LOG_TRACE, "flags 0x%x entries %u\n", flags, entries);
 
     /* Always assume the presence of composition time offsets.
      * Without this assumption, for instance, we cannot deal with a track in fragmented movies that meet the following.
@@ -3018,9 +3018,9 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             distance = 0;
         av_add_index_entry(st, offset, dts, sample_size, distance,
                            keyframe ? AVINDEX_KEYFRAME : 0);
-        av_log(c->fc, AV_LOG_TRACE, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
-                "size %d, distance %d, keyframe %d\n", st->index, sc->sample_count+i,
-                offset, dts, sample_size, distance, keyframe);
+        av_log(c->fc, AV_LOG_TRACE, "AVIndex stream %d, sample %u, offset %"PRIx64", dts %"PRId64", "
+               "size %u, distance %d, keyframe %d\n", st->index, sc->sample_count+i,
+               offset, dts, sample_size, distance, keyframe);
         distance++;
         dts += sample_duration;
         offset += sample_size;
@@ -3146,7 +3146,7 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         av_log(c->fc, AV_LOG_WARNING, "multiple edit list entries, "
                "a/v desync might occur, patch welcome\n");
 
-    av_log(c->fc, AV_LOG_TRACE, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
+    av_log(c->fc, AV_LOG_TRACE, "track[%u].edit_count = %i\n", c->fc->nb_streams - 1, edit_count);
     return 0;
 }
 
diff --git a/libavformat/rtpdec_jpeg.c b/libavformat/rtpdec_jpeg.c
index bc86b15..2cf4113 100644
--- a/libavformat/rtpdec_jpeg.c
+++ b/libavformat/rtpdec_jpeg.c
@@ -230,7 +230,7 @@ static int jpeg_parse_packet(AVFormatContext *ctx, PayloadContext *jpeg,
     len -= 8;
 
     if (type > 1) {
-        av_log(ctx, AV_LOG_ERROR, "Unimplemented RTP/JPEG type %d\n", type);
+        av_log(ctx, AV_LOG_ERROR, "Unimplemented RTP/JPEG type %"PRIu8"\n", type);
         return AVERROR_PATCHWELCOME;
     }
 
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index 5ad6974..7821686 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -247,7 +247,7 @@ parse_packed_headers(AVFormatContext *s,
 
     if (num_packed != 1 || num_headers > 3) {
         av_log(s, AV_LOG_ERROR,
-               "Unimplemented number of headers: %d packed headers, %d headers\n",
+               "Unimplemented number of headers: %u packed headers, %u headers\n",
                num_packed, num_headers);
         return AVERROR_PATCHWELCOME;
     }
@@ -255,7 +255,7 @@ parse_packed_headers(AVFormatContext *s,
     if (packed_headers_end - packed_headers != length ||
         length1 > length || length2 > length - length1) {
         av_log(s, AV_LOG_ERROR,
-               "Bad packed header lengths (%d,%d,%td,%d)\n", length1,
+               "Bad packed header lengths (%u,%u,%td,%u)\n", length1,
                length2, packed_headers_end - packed_headers, length);
         return AVERROR_INVALIDDATA;
     }
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 2cae839..f43be2f 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -140,7 +140,7 @@ static int rtp_write_header(AVFormatContext *s1)
     } else
         s1->packet_size = s1->pb->max_packet_size;
     if (s1->packet_size <= 12) {
-        av_log(s1, AV_LOG_ERROR, "Max packet size %d too low\n", s1->packet_size);
+        av_log(s1, AV_LOG_ERROR, "Max packet size %u too low\n", s1->packet_size);
         return AVERROR(EIO);
     }
     s->buf = av_malloc(s1->packet_size);
diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index 309ef81..853a8a7 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -305,7 +305,7 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
 
         ret = sscanf(buf,
                      " %12s %dx%d -> %12s %dx%d flags=%d CRC=%x"
-                     " SSD=%"PRId64 ", %"PRId64 ", %"PRId64 ", %"PRId64 "\n",
+                     " SSD=%"PRIu64 ", %"PRIu64 ", %"PRIu64 ", %"PRIu64 "\n",
                      srcStr, &srcW, &srcH, dstStr, &dstW, &dstH,
                      &flags, &r.crc, &r.ssdY, &r.ssdU, &r.ssdV, &r.ssdA);
         if (ret != 12) {



More information about the ffmpeg-cvslog mailing list