From cba4e6062a02d5bf684e13a770be88aa1fec717e Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 1 Apr 2014 18:19:59 +0000 Subject: [PATCH] More correct printf format specifiers This avoids compiler warnings about argument and specifier type mismatch. --- libavcodec/g2meet.c | 4 ++-- libavcodec/h264_ps.c | 2 +- libavcodec/h264_refs.c | 6 ++++-- libavcodec/utvideodec.c | 2 +- libavcodec/wmaprodec.c | 2 +- libavcodec/xwddec.c | 4 +++- libavformat/mov.c | 2 +- libavformat/movenc.c | 7 +++++-- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index fe0c9297b1..a741b6f0f2 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -770,7 +770,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, break; } if (chunk_size < 2) { - av_log(avctx, AV_LOG_ERROR, "Invalid tile data size %d\n", + av_log(avctx, AV_LOG_ERROR, "Invalid tile data size %"PRIu32"\n", chunk_size); break; } @@ -821,7 +821,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, case CHUNK_CD: break; default: - av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02"PRIX32"\n", + av_log(avctx, AV_LOG_WARNING, "Skipping chunk type %02d\n", chunk_type); } diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index f3477c1823..183cc44ea3 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -495,7 +495,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h) if (h->avctx->debug & FF_DEBUG_PICT_INFO) { static const char csp[4][5] = { "Gray", "420", "422", "444" }; av_log(h->avctx, AV_LOG_DEBUG, - "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %d/%d\n", + "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %"PRId32"/%"PRId32"\n", sps_id, sps->profile_idc, sps->level_idc, sps->poc_type, sps->ref_frame_count, diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index 332866a2db..ffe1fcc0b0 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -25,6 +25,8 @@ * @author Michael Niedermayer */ +#include + #include "internal.h" #include "avcodec.h" #include "h264.h" @@ -497,7 +499,7 @@ static void print_short_term(H264Context *h) av_log(h->avctx, AV_LOG_DEBUG, "short term list:\n"); for (i = 0; i < h->short_ref_count; i++) { H264Picture *pic = h->short_ref[i]; - av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", + av_log(h->avctx, AV_LOG_DEBUG, "%"PRIu32" fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->f.data[0]); } } @@ -514,7 +516,7 @@ static void print_long_term(H264Context *h) for (i = 0; i < 16; i++) { H264Picture *pic = h->long_ref[i]; if (pic) { - av_log(h->avctx, AV_LOG_DEBUG, "%d fn:%d poc:%d %p\n", + av_log(h->avctx, AV_LOG_DEBUG, "%"PRIu32" fn:%d poc:%d %p\n", i, pic->frame_num, pic->poc, pic->f.data[0]); } } diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 41d5344815..f066e1feb8 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -487,7 +487,7 @@ static av_cold int decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d.%d.%d\n", avctx->extradata[3], avctx->extradata[2], avctx->extradata[1], avctx->extradata[0]); - av_log(avctx, AV_LOG_DEBUG, "Original format %X\n", + av_log(avctx, AV_LOG_DEBUG, "Original format %"PRIX32"\n", AV_RB32(avctx->extradata + 4)); c->frame_info_size = AV_RL32(avctx->extradata + 8); c->flags = AV_RL32(avctx->extradata + 12); diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 0a8ebc5f87..afe6ac2c95 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -239,7 +239,7 @@ typedef struct WMAProDecodeCtx { static av_cold void dump_context(WMAProDecodeCtx *s) { #define PRINT(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b); -#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %x\n", a, b); +#define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %"PRIx32"\n", a, b); PRINT("ed sample bit depth", s->bits_per_sample); PRINT_HEX("ed decode flags", s->decode_flags); diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index eede5e5f4f..f6ccb96988 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -83,7 +83,9 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_DEBUG, "vclass %"PRIu32", ncolors %"PRIu32", bpp %"PRIu32", be %"PRIu32", lsize %"PRIu32", xoffset %"PRIu32"\n", vclass, ncolors, bpp, be, lsize, xoffset); - av_log(avctx, AV_LOG_DEBUG, "red %0x, green %0x, blue %0x\n", rgb[0], rgb[1], rgb[2]); + av_log(avctx, AV_LOG_DEBUG, + "red %0"PRIx32", green %0"PRIx32", blue %0"PRIx32"\n", + rgb[0], rgb[1], rgb[2]); if (pixformat > XWD_Z_PIXMAP) { av_log(avctx, AV_LOG_ERROR, "invalid pixmap format\n"); diff --git a/libavformat/mov.c b/libavformat/mov.c index 5d0719c057..afd3fc6638 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1343,7 +1343,7 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st) uint32_t yuv = AV_RB32(src + i * 4); uint32_t rgba = yuv_to_rgba(yuv); - av_strlcatf(buf, sizeof(buf), "%06x%s", rgba, i != 15 ? ", " : ""); + av_strlcatf(buf, sizeof(buf), "%06"PRIx32"%s", rgba, i != 15 ? ", " : ""); } if (av_strlcat(buf, "\n", sizeof(buf)) >= sizeof(buf)) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 889f15c8e9..afc73cae63 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -22,6 +22,7 @@ */ #include +#include #include "movenc.h" #include "avformat.h" @@ -3216,8 +3217,10 @@ static int mov_create_dvd_sub_decoder_specific_info(MOVTrack *track, if (strncmp("palette:", cur, 8) == 0) { int i, count; count = sscanf(cur + 8, - "%06x, %06x, %06x, %06x, %06x, %06x, %06x, %06x, " - "%06x, %06x, %06x, %06x, %06x, %06x, %06x, %06x", + "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32", " + "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32", " + "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32", " + "%06"PRIx32", %06"PRIx32", %06"PRIx32", %06"PRIx32"", &palette[ 0], &palette[ 1], &palette[ 2], &palette[ 3], &palette[ 4], &palette[ 5], &palette[ 6], &palette[ 7], &palette[ 8], &palette[ 9], &palette[10], &palette[11],