PR #21083 opened by mkver URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21083 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21083.patch
Possible since 222127418bbdee3247eb9c02bb8cf31991e32241. >From b2c09609e48e5cb650a0e3c96614717c88673a1e Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Wed, 3 Dec 2025 00:41:00 +0100 Subject: [PATCH] libavutil/internal: Remove {SIZE,PTRDIFF}_SPECIFIER Possible since 222127418bbdee3247eb9c02bb8cf31991e32241. Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/alsdec.c | 4 ++-- libavcodec/av1dec.c | 2 +- libavcodec/cbs.c | 2 +- libavcodec/cbs_apv.c | 2 +- libavcodec/cbs_av1.c | 8 ++++---- libavcodec/cbs_vp9.c | 2 +- libavcodec/d3d12va_encode.c | 2 +- libavcodec/d3d12va_encode_av1.c | 2 +- libavcodec/decode.c | 6 +++--- libavcodec/dnxhddec.c | 2 +- libavcodec/dvdsubenc.c | 2 +- libavcodec/g2meet.c | 2 +- libavcodec/h264_ps.c | 2 +- libavcodec/h264_slice.c | 4 ++-- libavcodec/hapenc.c | 2 +- libavcodec/hq_hqa.c | 4 ++-- libavcodec/jpeg2000dec.c | 6 +++--- libavcodec/libaomenc.c | 10 +++++----- libavcodec/libilbc.c | 3 +-- libavcodec/libvpxenc.c | 6 +++--- libavcodec/mjpegdec.c | 6 +++--- libavcodec/mjpegenc_common.c | 2 +- libavcodec/mpeg12dec.c | 2 +- libavcodec/mpeg12enc.c | 2 +- libavcodec/mpegpicture.c | 2 +- libavcodec/mpegvideo_enc.c | 2 +- libavcodec/mscc.c | 2 +- libavcodec/vulkan_av1.c | 2 +- libavcodec/vulkan_encode_av1.c | 2 +- libavcodec/vulkan_encode_h264.c | 2 +- libavcodec/vulkan_encode_h265.c | 2 +- libavcodec/vulkan_h264.c | 2 +- libavcodec/vulkan_hevc.c | 2 +- libavcodec/vulkan_vp9.c | 2 +- libavcodec/zmbv.c | 8 ++++---- libavfilter/af_ashowinfo.c | 2 +- libavfilter/f_graphmonitor.c | 2 +- libavfilter/vf_avgblur_opencl.c | 2 +- libavfilter/vf_convolution_opencl.c | 4 ++-- libavfilter/vf_lcevc.c | 4 ++-- libavfilter/vf_neighbor_opencl.c | 3 +-- libavfilter/vf_program_opencl.c | 3 +-- libavfilter/vf_showinfo.c | 12 +++++------- libavfilter/vf_unsharp_opencl.c | 3 +-- libavformat/ape.c | 2 +- libavformat/dump.c | 9 +++------ libavformat/framecrcenc.c | 2 +- libavformat/hashenc.c | 2 +- libavformat/http.c | 2 +- libavformat/id3v2.c | 2 +- libavformat/mmsh.c | 4 ++-- libavformat/mmst.c | 4 ++-- libavformat/mpjpegdec.c | 2 +- libavformat/oggparsevorbis.c | 2 +- libavformat/rtpdec_xiph.c | 4 ++-- libavformat/sdp.c | 2 +- libavformat/supenc.c | 4 ++-- libavutil/hwcontext_opencl.c | 2 +- libavutil/hwcontext_vulkan.c | 2 +- libavutil/internal.h | 3 --- libavutil/tests/channel_layout.c | 3 +-- libavutil/tests/imgutils.c | 4 ++-- libavutil/tests/side_data_array.c | 2 +- libavutil/vulkan.c | 2 +- 64 files changed, 97 insertions(+), 110 deletions(-) diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index fc55aa2687..09c1b8db9e 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1343,13 +1343,13 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd, if (ch[dep].time_diff_sign) { t = -t; if (begin < t) { - av_log(ctx->avctx, AV_LOG_ERROR, "begin %"PTRDIFF_SPECIFIER" smaller than time diff index %d.\n", begin, t); + av_log(ctx->avctx, AV_LOG_ERROR, "begin %td smaller than time diff index %d.\n", begin, t); return AVERROR_INVALIDDATA; } begin -= t; } else { if (end < t) { - av_log(ctx->avctx, AV_LOG_ERROR, "end %"PTRDIFF_SPECIFIER" smaller than time diff index %d.\n", end, t); + av_log(ctx->avctx, AV_LOG_ERROR, "end %td smaller than time diff index %d.\n", end, t); return AVERROR_INVALIDDATA; } end -= t; diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index d4ceb5ef09..1dffc7c1b9 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1450,7 +1450,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) break; default: av_log(avctx, AV_LOG_DEBUG, - "Unknown obu type: %d (%"SIZE_SPECIFIER" bits).\n", + "Unknown obu type: %d (%zu bits).\n", unit->type, unit->data_size); } diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index cea6e6db21..41c8184434 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -376,7 +376,7 @@ static int cbs_write_unit_data(CodedBitstreamContext *ctx, if (ret < 0) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Unable to allocate a " "sufficiently large write buffer (last attempt " - "%"SIZE_SPECIFIER" bytes).\n", ctx->write_buffer_size); + "%zu bytes).\n", ctx->write_buffer_size); return ret; } } diff --git a/libavcodec/cbs_apv.c b/libavcodec/cbs_apv.c index 7a06244c69..be52c2e511 100644 --- a/libavcodec/cbs_apv.c +++ b/libavcodec/cbs_apv.c @@ -201,7 +201,7 @@ static int cbs_apv_split_fragment(CodedBitstreamContext *ctx, if (size < 8) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid PBU: " - "fragment too short (%"SIZE_SPECIFIER" bytes).\n", + "fragment too short (%zu bytes).\n", size); err = AVERROR_INVALIDDATA; goto fail; diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 75601c934b..d05352c738 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -714,7 +714,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, if (INT_MAX / 8 < size) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid fragment: " - "too large (%"SIZE_SPECIFIER" bytes).\n", size); + "too large (%zu bytes).\n", size); err = AVERROR_INVALIDDATA; goto fail; } @@ -765,7 +765,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, if (obu_header.obu_has_size_field) { if (get_bits_left(&gbc) < 8) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU: fragment " - "too short (%"SIZE_SPECIFIER" bytes).\n", size); + "too short (%zu bytes).\n", size); err = AVERROR_INVALIDDATA; goto fail; } @@ -782,7 +782,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, if (size < obu_length) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU length: " - "%"PRIu64", but only %"SIZE_SPECIFIER" bytes remaining in fragment.\n", + "%"PRIu64", but only %zu bytes remaining in fragment.\n", obu_length, size); err = AVERROR_INVALIDDATA; goto fail; @@ -868,7 +868,7 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx, } else { if (unit->data_size < 1 + obu->header.obu_extension_flag) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU length: " - "unit too short (%"SIZE_SPECIFIER").\n", unit->data_size); + "unit too short (%zu).\n", unit->data_size); return AVERROR_INVALIDDATA; } obu->obu_size = unit->data_size - 1 - obu->header.obu_extension_flag; diff --git a/libavcodec/cbs_vp9.c b/libavcodec/cbs_vp9.c index 9e9b37e527..37015f5c77 100644 --- a/libavcodec/cbs_vp9.c +++ b/libavcodec/cbs_vp9.c @@ -415,7 +415,7 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx, } if (pos + index_size != frag->data_size) { av_log(ctx->log_ctx, AV_LOG_WARNING, "Extra padding at " - "end of superframe: %"SIZE_SPECIFIER" bytes.\n", + "end of superframe: %zu bytes.\n", frag->data_size - (pos + index_size)); } diff --git a/libavcodec/d3d12va_encode.c b/libavcodec/d3d12va_encode.c index d28447c3c9..5a82a42c5f 100644 --- a/libavcodec/d3d12va_encode.c +++ b/libavcodec/d3d12va_encode.c @@ -707,7 +707,7 @@ static int d3d12va_encode_get_coded_data(AVCodecContext *avctx, goto end; total_size += pic->header_size; - av_log(avctx, AV_LOG_DEBUG, "Output buffer size %"SIZE_SPECIFIER"\n", total_size); + av_log(avctx, AV_LOG_DEBUG, "Output buffer size %zu\n", total_size); hr = ID3D12Resource_Map(pic->output_buffer, 0, NULL, (void **)&mapped_data); if (FAILED(hr)) { diff --git a/libavcodec/d3d12va_encode_av1.c b/libavcodec/d3d12va_encode_av1.c index e7a115a2ee..34e803db98 100644 --- a/libavcodec/d3d12va_encode_av1.c +++ b/libavcodec/d3d12va_encode_av1.c @@ -406,7 +406,7 @@ static int d3d12va_encode_av1_get_coded_data(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, "Tile group extra size: %d bytes.\n", tile_group_extra_size); total_size += (pic->header_size + tile_group_extra_size + av1_pic_hd_size); - av_log(avctx, AV_LOG_DEBUG, "Output buffer size %"SIZE_SPECIFIER"\n", total_size); + av_log(avctx, AV_LOG_DEBUG, "Output buffer size %zu\n", total_size); hr = ID3D12Resource_Map(pic->output_buffer, 0, NULL, (void **)&mapped_data); if (FAILED(hr)) { diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 7089114e98..f0646901c8 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -747,8 +747,8 @@ static int apply_cropping(AVCodecContext *avctx, AVFrame *frame) (frame->crop_top + frame->crop_bottom) >= frame->height) { av_log(avctx, AV_LOG_WARNING, "Invalid cropping information set by a decoder: " - "%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER" " - "(frame size %dx%d). This is a bug, please report it\n", + "%zu/%zu/%zu/%zu (frame size %dx%d). " + "This is a bug, please report it\n", frame->crop_left, frame->crop_right, frame->crop_top, frame->crop_bottom, frame->width, frame->height); frame->crop_left = 0; @@ -2270,7 +2270,7 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx) return 1; } else if (pal) { av_log(logctx, AV_LOG_ERROR, - "Palette size %"SIZE_SPECIFIER" is wrong\n", size); + "Palette size %zu is wrong\n", size); } return 0; } diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index fe0809a5f5..7ec61f9ebd 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -333,7 +333,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, if (ctx->mb_height > FF_ARRAY_ELEMS(ctx->mb_scan_index)) { av_log(ctx->avctx, AV_LOG_ERROR, - "mb_height too big (%d > %"SIZE_SPECIFIER").\n", ctx->mb_height, FF_ARRAY_ELEMS(ctx->mb_scan_index)); + "mb_height too big (%d > %zu).\n", ctx->mb_height, FF_ARRAY_ELEMS(ctx->mb_scan_index)); return AVERROR_INVALIDDATA; } diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c index 00bab35988..2a5463b8d8 100644 --- a/libavcodec/dvdsubenc.c +++ b/libavcodec/dvdsubenc.c @@ -411,7 +411,7 @@ static int dvdsub_encode(AVCodecContext *avctx, qq = outbuf; bytestream_put_be16(&qq, q - outbuf); - av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%"PTRDIFF_SPECIFIER"\n", q - outbuf); + av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%td\n", q - outbuf); ret = q - outbuf; fail: diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index f952a06f12..a4900641e7 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -890,7 +890,7 @@ static int epic_jb_decode_tile(G2MContext *c, int tile_x, int tile_y, } if (src_size < els_dsize) { - av_log(avctx, AV_LOG_ERROR, "ePIC: data too short, needed %"SIZE_SPECIFIER", got %"SIZE_SPECIFIER"\n", + av_log(avctx, AV_LOG_ERROR, "ePIC: data too short, needed %zu, got %zu\n", els_dsize, src_size); return AVERROR_INVALIDDATA; } diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 3a3cad7de7..ac204172cb 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -715,7 +715,7 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct pps->data_size = get_bits_bytesize(gb, 1); if (pps->data_size > sizeof(pps->data)) { av_log(avctx, AV_LOG_DEBUG, "Truncating likely oversized PPS " - "(%"SIZE_SPECIFIER" > %"SIZE_SPECIFIER")\n", + "(%zu > %zu)\n", pps->data_size, sizeof(pps->data)); pps->data_size = sizeof(pps->data); } diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 7e53e38cca..d91f04fa67 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -2639,10 +2639,10 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg) goto finish; } if (sl->cabac.bytestream > sl->cabac.bytestream_end + 2 ) - av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %"PTRDIFF_SPECIFIER"\n", sl->cabac.bytestream_end - sl->cabac.bytestream); + av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %td\n", sl->cabac.bytestream_end - sl->cabac.bytestream); if (ret < 0 || sl->cabac.bytestream > sl->cabac.bytestream_end + 4) { av_log(h->avctx, AV_LOG_ERROR, - "error while decoding MB %d %d, bytestream %"PTRDIFF_SPECIFIER"\n", + "error while decoding MB %d %d, bytestream %td\n", sl->mb_x, sl->mb_y, sl->cabac.bytestream_end - sl->cabac.bytestream); er_add_slice(sl, sl->resync_mb_x, sl->resync_mb_y, sl->mb_x, diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index a0b199906d..6882b1e563 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -121,7 +121,7 @@ static int hap_compress_frame(AVCodecContext *avctx, uint8_t *dst) /* If there is no gain from snappy, just use the raw texture. */ if (chunk->compressed_size >= chunk->uncompressed_size) { av_log(avctx, AV_LOG_VERBOSE, - "Snappy buffer bigger than uncompressed (%"SIZE_SPECIFIER" >= %"SIZE_SPECIFIER" bytes).\n", + "Snappy buffer bigger than uncompressed (%zu >= %zu bytes).\n", chunk->compressed_size, chunk->uncompressed_size); memcpy(chunk_dst, chunk_src, chunk->uncompressed_size); chunk->compressor = HAP_COMP_NONE; diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c index c813b923b6..61242678b2 100644 --- a/libavcodec/hq_hqa.c +++ b/libavcodec/hq_hqa.c @@ -177,7 +177,7 @@ static int hq_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, slice_off[slice] >= slice_off[slice + 1] || slice_off[slice + 1] > data_size) { av_log(ctx->avctx, AV_LOG_ERROR, - "Invalid slice size %"SIZE_SPECIFIER".\n", data_size); + "Invalid slice size %zu.\n", data_size); break; } init_get_bits(&gb, src + slice_off[slice], @@ -304,7 +304,7 @@ static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, s slice_off[slice] >= slice_off[slice + 1] || slice_off[slice + 1] > data_size) { av_log(ctx->avctx, AV_LOG_ERROR, - "Invalid slice size %"SIZE_SPECIFIER".\n", data_size); + "Invalid slice size %zu.\n", data_size); break; } init_get_bits(&gb, src + slice_off[slice], diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 5d1502fabb..de1a73b92b 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1476,7 +1476,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, } if (tmp_length > cblk->data_allocated) { avpriv_request_sample(s->avctx, - "Block with lengthinc greater than %"SIZE_SPECIFIER"", + "Block with lengthinc greater than %zu", cblk->data_allocated); return AVERROR_PATCHWELCOME; } @@ -2071,7 +2071,7 @@ static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *cod return AVERROR_INVALIDDATA; } if (FFABS(cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp) > 0) { - av_log(s->avctx, AV_LOG_WARNING, "Mid mismatch %"PTRDIFF_SPECIFIER" in pass %d of %d\n", + av_log(s->avctx, AV_LOG_WARNING, "Mid mismatch %td in pass %d of %d\n", cblk->data + cblk->data_start[term_cnt + 1] - 2 - t1->mqc.bp, pass_cnt, cblk->npasses); } @@ -2088,7 +2088,7 @@ static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *cod } if (cblk->data + cblk->length - 2 > t1->mqc.bp) { - av_log(s->avctx, AV_LOG_WARNING, "End mismatch %"PTRDIFF_SPECIFIER"\n", + av_log(s->avctx, AV_LOG_WARNING, "End mismatch %td\n", cblk->data + cblk->length - 2 - t1->mqc.bp); } diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 1e5db4ad8c..be319d0f3c 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -240,7 +240,7 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx, width, "g_pass:", cfg->g_pass, width, "g_lag_in_frames:", cfg->g_lag_in_frames); av_log(avctx, level, "rate control settings\n" - " %*s%u\n %*s%d\n %*s%p(%"SIZE_SPECIFIER")\n %*s%u\n", + " %*s%u\n %*s%d\n %*s%p(%zu)\n %*s%u\n", width, "rc_dropframe_thresh:", cfg->rc_dropframe_thresh, width, "rc_end_usage:", cfg->rc_end_usage, width, "rc_twopass_stats_in:", cfg->rc_twopass_stats_in.buf, cfg->rc_twopass_stats_in.sz, @@ -896,7 +896,7 @@ static av_cold int aom_init(AVCodecContext *avctx, ret = av_reallocp(&ctx->twopass_stats.buf, ctx->twopass_stats.sz); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, - "Stat buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", + "Stat buffer alloc (%zu bytes) failed\n", ctx->twopass_stats.sz); ctx->twopass_stats.sz = 0; return ret; @@ -1091,7 +1091,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, int ret = ff_get_encode_buffer(avctx, pkt, cx_frame->sz, 0); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, - "Error getting output packet of size %"SIZE_SPECIFIER".\n", cx_frame->sz); + "Error getting output packet of size %zu.\n", cx_frame->sz); return ret; } memcpy(pkt->data, cx_frame->buf, pkt->size); @@ -1190,7 +1190,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out) if (!cx_frame->buf) { av_log(avctx, AV_LOG_ERROR, - "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", + "Data buffer alloc (%zu bytes) failed\n", cx_frame->sz); av_freep(&cx_frame); return AVERROR(ENOMEM); @@ -1352,7 +1352,7 @@ static int aom_encode(AVCodecContext *avctx, AVPacket *pkt, avctx->stats_out = av_malloc(b64_size); if (!avctx->stats_out) { - av_log(avctx, AV_LOG_ERROR, "Stat buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", + av_log(avctx, AV_LOG_ERROR, "Stat buffer alloc (%zu bytes) failed\n", b64_size); return AVERROR(ENOMEM); } diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index f496f16db9..9a43e566f5 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -99,8 +99,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, #if LIBILBC_VERSION_MAJOR < 3 av_log(avctx, AV_LOG_ERROR, "iLBC frame too short (%u, should be %u)\n", #else - av_log(avctx, AV_LOG_ERROR, "iLBC frame too short (%u, should be " - "%"SIZE_SPECIFIER")\n", + av_log(avctx, AV_LOG_ERROR, "iLBC frame too short (%u, should be %zu)\n", #endif buf_size, s->decoder.no_of_bytes); return AVERROR_INVALIDDATA; diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 05c34a6857..ef529abcab 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -242,7 +242,7 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx, width, "g_lag_in_frames:", cfg->g_lag_in_frames); av_log(avctx, level, "rate control settings\n" " %*s%u\n %*s%u\n %*s%u\n %*s%u\n" - " %*s%d\n %*s%p(%"SIZE_SPECIFIER")\n %*s%u\n", + " %*s%d\n %*s%p(%zu)\n %*s%u\n", width, "rc_dropframe_thresh:", cfg->rc_dropframe_thresh, width, "rc_resize_allowed:", cfg->rc_resize_allowed, width, "rc_resize_up_thresh:", cfg->rc_resize_up_thresh, @@ -1117,7 +1117,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, ret = av_reallocp(&ctx->twopass_stats.buf, ctx->twopass_stats.sz); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, - "Stat buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", + "Stat buffer alloc (%zu bytes) failed\n", ctx->twopass_stats.sz); ctx->twopass_stats.sz = 0; return ret; @@ -1423,7 +1423,7 @@ static int queue_frames(AVCodecContext *avctx, struct vpx_codec_ctx *encoder, if (!cx_frame->buf) { av_log(avctx, AV_LOG_ERROR, - "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n", + "Data buffer alloc (%zu bytes) failed\n", cx_frame->sz); av_freep(&cx_frame); return AVERROR(ENOMEM); diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index fb39c4e9fd..4d7cdfde12 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2281,7 +2281,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s, memset(s->buffer + *unescaped_buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); - av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %"PTRDIFF_SPECIFIER" bytes\n", + av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %td bytes\n", (buf_end - *buf_ptr) - (dst - s->buffer)); } else if (start_code == SOS && s->ls) { const uint8_t *src = *buf_ptr; @@ -2389,7 +2389,7 @@ redo_for_pal8: start_code, unescaped_buf_size, buf_size); return AVERROR_INVALIDDATA; } - av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n", + av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%td\n", start_code, buf_end - buf_ptr); ret = init_get_bits8(&s->gb, unescaped_buf_ptr, unescaped_buf_size); @@ -2859,7 +2859,7 @@ the_end: } the_end_no_picture: - av_log(avctx, AV_LOG_DEBUG, "decode frame unused %"PTRDIFF_SPECIFIER" bytes\n", + av_log(avctx, AV_LOG_DEBUG, "decode frame unused %td bytes\n", buf_end - buf_ptr); return buf_ptr - buf; } diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index 21b3b19b93..5effbdbc32 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_common.c @@ -145,7 +145,7 @@ int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame, return 0; if (sd->size > ICC_MAX_CHUNKS * ICC_CHUNK_SIZE) { - av_log(avctx, AV_LOG_ERROR, "Cannot store %"SIZE_SPECIFIER" byte ICC " + av_log(avctx, AV_LOG_ERROR, "Cannot store %zu byte ICC " "profile: too large for JPEG\n", sd->size); return AVERROR_INVALIDDATA; diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 1caa8279bd..4c83bcfa90 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2269,7 +2269,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, input_size = buf_end - buf_ptr; if (avctx->debug & FF_DEBUG_STARTCODE) - av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %"PTRDIFF_SPECIFIER" left %d\n", + av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %td left %d\n", start_code, buf_ptr - buf, input_size); /* prepare data for next start code */ diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 4b9d186396..3baadbcfeb 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -481,7 +481,7 @@ static int mpeg1_encode_picture_header(MPVMainEncContext *const m) put_bits(&s->pb, 8, 0xff); // marker_bits } else { av_log(s->c.avctx, AV_LOG_WARNING, - "Closed Caption size (%"SIZE_SPECIFIER") can not exceed " + "Closed Caption size (%zu) can not exceed " "93 bytes and must be a multiple of 3\n", side_data->size); } } diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c index 6e96389c34..3f32fe8773 100644 --- a/libavcodec/mpegpicture.c +++ b/libavcodec/mpegpicture.c @@ -186,7 +186,7 @@ int ff_mpv_pic_check_linesize(void *logctx, const AVFrame *f, if ((linesize && linesize != f->linesize[0]) || (uvlinesize && uvlinesize != f->linesize[1])) { av_log(logctx, AV_LOG_ERROR, "Stride change unsupported: " - "linesize=%"PTRDIFF_SPECIFIER"/%d uvlinesize=%"PTRDIFF_SPECIFIER"/%d)\n", + "linesize=%td/%d uvlinesize=%td/%d)\n", linesize, f->linesize[0], uvlinesize, f->linesize[1]); return AVERROR_PATCHWELCOME; diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index e1f9623d65..a4f78c25db 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1365,7 +1365,7 @@ static int load_input_picture(MPVMainEncContext *const m, const AVFrame *pic_arg if (s->c.linesize & (STRIDE_ALIGN-1)) direct = 0; - ff_dlog(s->c.avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0], + ff_dlog(s->c.avctx, "%d %d %td %td\n", pic_arg->linesize[0], pic_arg->linesize[1], s->c.linesize, s->c.uvlinesize); pic = av_refstruct_pool_get(s->c.picture_pool); diff --git a/libavcodec/mscc.c b/libavcodec/mscc.c index 708e84a8e1..ba48fc08d9 100644 --- a/libavcodec/mscc.c +++ b/libavcodec/mscc.c @@ -188,7 +188,7 @@ inflate_error: s->pal[j] = 0xFF000000 | AV_RL32(pal + j * 4); } else if (pal) { av_log(avctx, AV_LOG_ERROR, - "Palette size %"SIZE_SPECIFIER" is wrong\n", size); + "Palette size %zu is wrong\n", size); } memcpy(frame->data[1], s->pal, AVPALETTE_SIZE); } diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c index 788e3cca78..3a52d1f33a 100644 --- a/libavcodec/vulkan_av1.c +++ b/libavcodec/vulkan_av1.c @@ -634,7 +634,7 @@ static int vk_av1_end_frame(AVCodecContext *avctx) rav[i] = ap->ref_src[i]->f; } - av_log(avctx, AV_LOG_DEBUG, "Decoding frame, %"SIZE_SPECIFIER" bytes, %i tiles\n", + av_log(avctx, AV_LOG_DEBUG, "Decoding frame, %zu bytes, %i tiles\n", vp->slices_size, ap->av1_pic_info.tileCount); return ff_vk_decode_frame(avctx, pic->f, vp, rav, rvp); diff --git a/libavcodec/vulkan_encode_av1.c b/libavcodec/vulkan_encode_av1.c index 42ba30b302..c280f37a91 100644 --- a/libavcodec/vulkan_encode_av1.c +++ b/libavcodec/vulkan_encode_av1.c @@ -1021,7 +1021,7 @@ static int init_base_units(AVCodecContext *avctx) if (!data) return AVERROR(ENOMEM); } else { - av_log(avctx, AV_LOG_ERROR, "Unable to get feedback for AV1 sequence header = %"SIZE_SPECIFIER"\n", + av_log(avctx, AV_LOG_ERROR, "Unable to get feedback for AV1 sequence header = %zu\n", data_size); return err; } diff --git a/libavcodec/vulkan_encode_h264.c b/libavcodec/vulkan_encode_h264.c index 942e911fb7..0327ccba0b 100644 --- a/libavcodec/vulkan_encode_h264.c +++ b/libavcodec/vulkan_encode_h264.c @@ -1147,7 +1147,7 @@ static int init_base_units(AVCodecContext *avctx) if (!data) return AVERROR(ENOMEM); } else { - av_log(avctx, AV_LOG_ERROR, "Unable to get feedback for H.264 units = %"SIZE_SPECIFIER"\n", data_size); + av_log(avctx, AV_LOG_ERROR, "Unable to get feedback for H.264 units = %zu\n", data_size); return err; } diff --git a/libavcodec/vulkan_encode_h265.c b/libavcodec/vulkan_encode_h265.c index c30b7e8f93..9cd33abfe3 100644 --- a/libavcodec/vulkan_encode_h265.c +++ b/libavcodec/vulkan_encode_h265.c @@ -1316,7 +1316,7 @@ static int init_base_units(AVCodecContext *avctx) if (!data) return AVERROR(ENOMEM); } else { - av_log(avctx, AV_LOG_ERROR, "Unable to get feedback for H.265 units = %"SIZE_SPECIFIER"\n", data_size); + av_log(avctx, AV_LOG_ERROR, "Unable to get feedback for H.265 units = %zu\n", data_size); return err; } diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c index bcc5c99b4b..8293f7ece9 100644 --- a/libavcodec/vulkan_h264.c +++ b/libavcodec/vulkan_h264.c @@ -556,7 +556,7 @@ static int vk_h264_end_frame(AVCodecContext *avctx) rav[i] = hp->ref_src[i]->f; } - av_log(avctx, AV_LOG_DEBUG, "Decoding frame, %"SIZE_SPECIFIER" bytes, %i slices\n", + av_log(avctx, AV_LOG_DEBUG, "Decoding frame, %zu bytes, %i slices\n", vp->slices_size, hp->h264_pic_info.sliceCount); return ff_vk_decode_frame(avctx, pic->f, vp, rav, rvp); diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c index 5e15c6b931..f609c4301f 100644 --- a/libavcodec/vulkan_hevc.c +++ b/libavcodec/vulkan_hevc.c @@ -921,7 +921,7 @@ static int vk_hevc_end_frame(AVCodecContext *avctx) rvp[i] = &rfhp->vp; } - av_log(avctx, AV_LOG_DEBUG, "Decoding frame, %"SIZE_SPECIFIER" bytes, %i slices\n", + av_log(avctx, AV_LOG_DEBUG, "Decoding frame, %zu bytes, %i slices\n", vp->slices_size, hp->h265_pic_info.sliceSegmentCount); return ff_vk_decode_frame(avctx, pic->f, vp, rav, rvp); diff --git a/libavcodec/vulkan_vp9.c b/libavcodec/vulkan_vp9.c index 7b852a29a5..5b592c1443 100644 --- a/libavcodec/vulkan_vp9.c +++ b/libavcodec/vulkan_vp9.c @@ -336,7 +336,7 @@ static int vk_vp9_end_frame(AVCodecContext *avctx) rav[i] = ap->ref_src[i]->tf.f; } - av_log(avctx, AV_LOG_VERBOSE, "Decoding frame, %"SIZE_SPECIFIER" bytes\n", + av_log(avctx, AV_LOG_VERBOSE, "Decoding frame, %zu bytes\n", vp->slices_size); return ff_vk_decode_frame(avctx, pic->tf.f, vp, rav, rvp); diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 2c09ccbd73..f0bffd8966 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -150,7 +150,7 @@ static int zmbv_decode_xor_8(ZmbvContext *c) prev += c->width * c->bh; } if (src - c->decomp_buf != c->decomp_len) - av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", + av_log(c->avctx, AV_LOG_ERROR, "Used %td of %i bytes\n", src-c->decomp_buf, c->decomp_len); return 0; } @@ -226,7 +226,7 @@ static int zmbv_decode_xor_16(ZmbvContext *c) prev += c->width * c->bh; } if (src - c->decomp_buf != c->decomp_len) - av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", + av_log(c->avctx, AV_LOG_ERROR, "Used %td of %i bytes\n", src-c->decomp_buf, c->decomp_len); return 0; } @@ -311,7 +311,7 @@ static int zmbv_decode_xor_24(ZmbvContext *c) prev += stride * c->bh; } if (src - c->decomp_buf != c->decomp_len) - av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", + av_log(c->avctx, AV_LOG_ERROR, "Used %td of %i bytes\n", src-c->decomp_buf, c->decomp_len); return 0; } @@ -388,7 +388,7 @@ static int zmbv_decode_xor_32(ZmbvContext *c) prev += c->width * c->bh; } if (src - c->decomp_buf != c->decomp_len) - av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n", + av_log(c->avctx, AV_LOG_ERROR, "Used %td of %i bytes\n", src-c->decomp_buf, c->decomp_len); return 0; } diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c index 57f1ebf535..ebcd5c996f 100644 --- a/libavfilter/af_ashowinfo.c +++ b/libavfilter/af_ashowinfo.c @@ -168,7 +168,7 @@ static void dump_audio_service_type(AVFilterContext *ctx, AVFrameSideData *sd) static void dump_unknown(AVFilterContext *ctx, AVFrameSideData *sd) { av_log(ctx, AV_LOG_INFO, "unknown side data type: %d, size " - "%"SIZE_SPECIFIER" bytes", sd->type, sd->size); + "%zu bytes", sd->type, sd->size); } static int filter_frame(AVFilterLink *inlink, AVFrame *buf) diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c index 20cdcce79d..95c34593d2 100644 --- a/libavfilter/f_graphmonitor.c +++ b/libavfilter/f_graphmonitor.c @@ -304,7 +304,7 @@ static int draw_items(AVFilterContext *ctx, len = snprintf(buffer, sizeof(buffer)-1, " | queue: "); drawtext(out, xpos, ypos, buffer, len, s->white); xpos += len * 8; - len = snprintf(buffer, sizeof(buffer)-1, "%"SIZE_SPECIFIER, frames); + len = snprintf(buffer, sizeof(buffer)-1, "%zu", frames); drawtext(out, xpos, ypos, buffer, len, frames > 0 ? frames >= 10 ? frames >= 50 ? s->red : s->yellow : s->green : s->white); xpos += len * 8; } diff --git a/libavfilter/vf_avgblur_opencl.c b/libavfilter/vf_avgblur_opencl.c index 790a51ea80..2bd7a899d5 100644 --- a/libavfilter/vf_avgblur_opencl.c +++ b/libavfilter/vf_avgblur_opencl.c @@ -222,7 +222,7 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) goto fail; av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + "(%zux%zu).\n", p, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel_horiz, 2, NULL, diff --git a/libavfilter/vf_convolution_opencl.c b/libavfilter/vf_convolution_opencl.c index c866022a12..99ef186038 100644 --- a/libavfilter/vf_convolution_opencl.c +++ b/libavfilter/vf_convolution_opencl.c @@ -235,7 +235,7 @@ static int convolution_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) goto fail; av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + "(%zux%zu).\n", p, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL, @@ -264,7 +264,7 @@ static int convolution_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) goto fail; av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + "(%zux%zu).\n", p, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL, diff --git a/libavfilter/vf_lcevc.c b/libavfilter/vf_lcevc.c index 60fab41fcb..575bbd75fa 100644 --- a/libavfilter/vf_lcevc.c +++ b/libavfilter/vf_lcevc.c @@ -110,7 +110,7 @@ static int alloc_base_frame(AVFilterLink *inlink, const AVFrame *in, desc.matrixCoefficients = (LCEVC_MatrixCoefficients)in->colorspace; desc.transferCharacteristics = (LCEVC_TransferCharacteristics)in->color_trc; av_log(ctx, AV_LOG_DEBUG, "in PTS %"PRId64", %dx%d, " - "%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER", " + "%zu/%zu/%zu/%zu, " "SAR %d:%d\n", in->pts, in->width, in->height, in->crop_top, in->crop_bottom, in->crop_left, in->crop_right, @@ -234,7 +234,7 @@ static int generate_output(AVFilterLink *inlink, AVFrame *out) out->height = outlink->h = desc.height + out->crop_top + out->crop_bottom; av_log(ctx, AV_LOG_DEBUG, "out PTS %"PRId64", %dx%d, " - "%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER"/%"SIZE_SPECIFIER", " + "%zu/%zu/%zu/%zu, " "SAR %d:%d, " "hasEnhancement %d, enhanced %d\n", out->pts, out->width, out->height, diff --git a/libavfilter/vf_neighbor_opencl.c b/libavfilter/vf_neighbor_opencl.c index 38a1b7821e..0b8d7fc998 100644 --- a/libavfilter/vf_neighbor_opencl.c +++ b/libavfilter/vf_neighbor_opencl.c @@ -182,8 +182,7 @@ static int neighbor_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) if (err < 0) goto fail; - av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d (%zux%zu).\n", p, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL, diff --git a/libavfilter/vf_program_opencl.c b/libavfilter/vf_program_opencl.c index c0c10045db..0bb8b6e98f 100644 --- a/libavfilter/vf_program_opencl.c +++ b/libavfilter/vf_program_opencl.c @@ -145,8 +145,7 @@ static int program_opencl_run(AVFilterContext *avctx) if (err < 0) goto fail; - av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d (%zux%zu).\n", plane, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL, diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index a85e894ae5..4ac3d45dc0 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -87,8 +87,7 @@ static void dump_spherical(AVFilterContext *ctx, AVFrame *frame, const AVFrameSi size_t l, t, r, b; av_spherical_tile_bounds(spherical, frame->width, frame->height, &l, &t, &r, &b); - av_log(ctx, AV_LOG_INFO, - "[%"SIZE_SPECIFIER", %"SIZE_SPECIFIER", %"SIZE_SPECIFIER", %"SIZE_SPECIFIER"] ", + av_log(ctx, AV_LOG_INFO, "[%zu, %zu, %zu, %zu] ", l, t, r, b); } else if (spherical->projection == AV_SPHERICAL_CUBEMAP) { av_log(ctx, AV_LOG_INFO, "[pad %"PRIu32"] ", spherical->padding); @@ -426,8 +425,8 @@ static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSi ShowInfoContext *s = ctx->priv; if (sd->size < AV_UUID_LEN) { - av_log(ctx, AV_LOG_ERROR, "invalid data(%"SIZE_SPECIFIER" < " - "UUID(%d-bytes))\n", sd->size, AV_UUID_LEN); + av_log(ctx, AV_LOG_ERROR, "invalid data (%zu < UUID(%d-bytes))\n", + sd->size, AV_UUID_LEN); return; } @@ -874,11 +873,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) break; default: if (name) - av_log(ctx, AV_LOG_INFO, - "(%"SIZE_SPECIFIER" bytes)", sd->size); + av_log(ctx, AV_LOG_INFO, "(%zu bytes)", sd->size); else av_log(ctx, AV_LOG_WARNING, "unknown side data type %d " - "(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size); + "(%zu bytes)", sd->type, sd->size); break; } diff --git a/libavfilter/vf_unsharp_opencl.c b/libavfilter/vf_unsharp_opencl.c index 15853e8db3..8a0db7d975 100644 --- a/libavfilter/vf_unsharp_opencl.c +++ b/libavfilter/vf_unsharp_opencl.c @@ -269,8 +269,7 @@ static int unsharp_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) local_work[0] = 16; local_work[1] = 16; - av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d " - "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n", + av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d (%zux%zu).\n", p, global_work[0], global_work[1]); cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel, 2, NULL, diff --git a/libavformat/ape.c b/libavformat/ape.c index 7e6bf12961..d2fd62902c 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -247,7 +247,7 @@ static int ape_read_header(AVFormatContext * s) } if (ape->seektablelength / sizeof(uint32_t) < ape->totalframes) { av_log(s, AV_LOG_ERROR, - "Number of seek entries is less than number of frames: %"SIZE_SPECIFIER" vs. %"PRIu32"\n", + "Number of seek entries is less than number of frames: %zu vs. %"PRIu32"\n", ape->seektablelength / sizeof(uint32_t), ape->totalframes); return AVERROR_INVALIDDATA; } diff --git a/libavformat/dump.c b/libavformat/dump.c index 2948189432..734a6e0bbf 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -402,9 +402,7 @@ static void dump_spherical(void *ctx, int w, int h, size_t l, t, r, b; av_spherical_tile_bounds(spherical, w, h, &l, &t, &r, &b); - av_log(ctx, log_level, - "[%"SIZE_SPECIFIER", %"SIZE_SPECIFIER", %"SIZE_SPECIFIER", %"SIZE_SPECIFIER"] ", - l, t, r, b); + av_log(ctx, log_level, "[%zu, %zu, %zu, %zu] ", l, t, r, b); } else if (spherical->projection == AV_SPHERICAL_CUBEMAP) { av_log(ctx, log_level, "[pad %"PRIu32"] ", spherical->padding); } @@ -536,11 +534,10 @@ static void dump_sidedata(void *ctx, const AVPacketSideData *side_data, int nb_s break; default: if (name) - av_log(ctx, log_level, - "(%"SIZE_SPECIFIER" bytes)", sd->size); + av_log(ctx, log_level, "(%zu bytes)", sd->size); else av_log(ctx, log_level, "unknown side data type %d " - "(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size); + "(%zu bytes)", sd->type, sd->size); break; } diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c index 8c35a2122c..25c59132e9 100644 --- a/libavformat/framecrcenc.c +++ b/libavformat/framecrcenc.c @@ -170,7 +170,7 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) side_data_crc = 0; } - av_strlcatf(buf, sizeof(buf), ", %s, %8"SIZE_SPECIFIER", 0x%08"PRIx32, + av_strlcatf(buf, sizeof(buf), ", %s, %8zu, 0x%08"PRIx32, av_packet_side_data_name(sd->type), sd->size, side_data_crc); } } diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index e4e3244246..b108eca41b 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -306,7 +306,7 @@ static int framehash_write_packet(struct AVFormatContext *s, AVPacket *pkt) } else av_hash_update(c->hashes[0], pkt->side_data[i].data, pkt->side_data[i].size); snprintf(buf, sizeof(buf) - (AV_HASH_MAX_SIZE * 2 + 1), - ", %8"SIZE_SPECIFIER", ", pkt->side_data[i].size); + ", %8zu, ", pkt->side_data[i].size); len = strlen(buf); av_hash_final_hex(c->hashes[0], buf + len, sizeof(buf) - len); avio_write(s->pb, buf, strlen(buf)); diff --git a/libavformat/http.c b/libavformat/http.c index c4e6292a95..bd25a45636 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -625,7 +625,7 @@ static int http_write_reply(URLContext* h, int status_code) message_len = snprintf(message, sizeof(message), "HTTP/1.1 %03d %s\r\n" "Content-Type: %s\r\n" - "Content-Length: %"SIZE_SPECIFIER"\r\n" + "Content-Length: %zu\r\n" "%s" "\r\n" "%03d %s\r\n", diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 3ce2fadce8..9d4a9802a9 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -485,7 +485,7 @@ static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen, new_extra = av_mallocz(sizeof(ID3v2ExtraMeta)); if (!new_extra) { - av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n", + av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n", sizeof(ID3v2ExtraMeta)); return; } diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c index aeadb12dab..ddeeafa423 100644 --- a/libavformat/mmsh.c +++ b/libavformat/mmsh.c @@ -118,7 +118,7 @@ static int read_data_packet(MMSHContext *mmsh, const int len) int res; if (len > sizeof(mms->in_buffer)) { av_log(NULL, AV_LOG_ERROR, - "Data packet length %d exceeds the in_buffer size %"SIZE_SPECIFIER"\n", + "Data packet length %d exceeds the in_buffer size %zu\n", len, sizeof(mms->in_buffer)); return AVERROR(EIO); } @@ -193,7 +193,7 @@ static int get_http_header_data(MMSHContext *mmsh) if (len) { if (len > sizeof(mms->in_buffer)) { av_log(NULL, AV_LOG_ERROR, - "Other packet len = %d exceed the in_buffer size %"SIZE_SPECIFIER"\n", + "Other packet len = %d exceed the in_buffer size %zu\n", len, sizeof(mms->in_buffer)); return AVERROR(EIO); } diff --git a/libavformat/mmst.c b/libavformat/mmst.c index e68606086e..59d3f9726e 100644 --- a/libavformat/mmst.c +++ b/libavformat/mmst.c @@ -284,7 +284,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst) if (length_remaining < 0 || length_remaining > sizeof(mms->in_buffer) - 12) { av_log(mms->mms_hd, AV_LOG_ERROR, - "Incoming packet length %d exceeds bufsize %"SIZE_SPECIFIER"\n", + "Incoming packet length %d exceeds bufsize %zu\n", length_remaining, sizeof(mms->in_buffer) - 12); return AVERROR_INVALIDDATA; } @@ -320,7 +320,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst) if (length_remaining < 0 || length_remaining > sizeof(mms->in_buffer) - 8) { av_log(mms->mms_hd, AV_LOG_ERROR, - "Data length %d is invalid or too large (max=%"SIZE_SPECIFIER")\n", + "Data length %d is invalid or too large (max=%zu)\n", length_remaining, sizeof(mms->in_buffer)); return AVERROR_INVALIDDATA; } diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index 125b17585e..3b47bccf9d 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -193,7 +193,7 @@ static int parse_multipart_header(AVIOContext *pb, if (log_ctx) av_log(log_ctx, AV_LOG_ERROR, - "Expected boundary '%s' not found, instead found a line of %"SIZE_SPECIFIER" bytes\n", + "Expected boundary '%s' not found, instead found a line of %zu bytes\n", expected_boundary, strlen(line)); diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 7c4f7624f8..ed81a431f6 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -184,7 +184,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, if (p != end) av_log(as, AV_LOG_INFO, - "%"PTRDIFF_SPECIFIER" bytes of comment header remain\n", end - p); + "%td bytes of comment header remain\n", end - p); if (n > 0) av_log(as, AV_LOG_INFO, "truncated comment header, %i comments not found\n", n); diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c index 95f4bdf3a1..23924f2363 100644 --- a/libavformat/rtpdec_xiph.c +++ b/libavformat/rtpdec_xiph.c @@ -234,7 +234,7 @@ parse_packed_headers(AVFormatContext *s, if (packed_headers_end - packed_headers < 9) { av_log(s, AV_LOG_ERROR, - "Invalid %"PTRDIFF_SPECIFIER" byte packed header.", + "Invalid %td byte packed header.", packed_headers_end - packed_headers); return AVERROR_INVALIDDATA; } @@ -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,%"PTRDIFF_SPECIFIER",%u)\n", length1, + "Bad packed header lengths (%d,%d,%td,%u)\n", length1, length2, packed_headers_end - packed_headers, length); return AVERROR_INVALIDDATA; } diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 21ada5d1ce..f6798f4bd9 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -235,7 +235,7 @@ static int extradata2psets(AVFormatContext *s, const AVCodecParameters *par, sps_end = r1; } if (!av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r)) { - av_log(s, AV_LOG_ERROR, "Cannot Base64-encode %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"!\n", + av_log(s, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r); fail_in_loop: av_free(psets); diff --git a/libavformat/supenc.c b/libavformat/supenc.c index ebdfc7c939..c664723bc4 100644 --- a/libavformat/supenc.c +++ b/libavformat/supenc.c @@ -47,7 +47,7 @@ static int sup_write_packet(AVFormatContext *s, AVPacket *pkt) size_t len = AV_RB16(data + 1) + 3; if (len > size) { - av_log(s, AV_LOG_ERROR, "Not enough data, skipping %"SIZE_SPECIFIER" bytes\n", + av_log(s, AV_LOG_ERROR, "Not enough data, skipping %zu bytes\n", size); return AVERROR_INVALIDDATA; } @@ -64,7 +64,7 @@ static int sup_write_packet(AVFormatContext *s, AVPacket *pkt) } if (size > 0) { - av_log(s, AV_LOG_ERROR, "Skipping %"SIZE_SPECIFIER" bytes after last segment in frame\n", + av_log(s, AV_LOG_ERROR, "Skipping %zu bytes after last segment in frame\n", size); return AVERROR_INVALIDDATA; } diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 46424eb52a..03f46238b2 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -2747,7 +2747,7 @@ static int opencl_map_from_drm_arm(AVHWFramesContext *dst_fc, AVFrame *dst, &fd, desc->objects[i].size, &cle); if (!mapping->object_buffers[i]) { av_log(dst_fc, AV_LOG_ERROR, "Failed to create CL buffer " - "from object %d (fd %d, size %"SIZE_SPECIFIER") of DRM frame: %d.\n", + "from object %d (fd %d, size %zu) of DRM frame: %d.\n", i, fd, desc->objects[i].size, cle); err = AVERROR(EIO); goto fail; diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 89bf39bb3f..ebbb175b6e 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -1890,7 +1890,7 @@ static int vulkan_device_init(AVHWDeviceContext *ctx) av_log(ctx, AV_LOG_VERBOSE, "Alignments:\n"); av_log(ctx, AV_LOG_VERBOSE, " optimalBufferCopyRowPitchAlignment: %"PRIu64"\n", p->props.properties.limits.optimalBufferCopyRowPitchAlignment); - av_log(ctx, AV_LOG_VERBOSE, " minMemoryMapAlignment: %"SIZE_SPECIFIER"\n", + av_log(ctx, AV_LOG_VERBOSE, " minMemoryMapAlignment: %zu\n", p->props.properties.limits.minMemoryMapAlignment); av_log(ctx, AV_LOG_VERBOSE, " nonCoherentAtomSize: %"PRIu64"\n", p->props.properties.limits.nonCoherentAtomSize); diff --git a/libavutil/internal.h b/libavutil/internal.h index 10ec26e9a0..2a85170795 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -115,9 +115,6 @@ void avpriv_report_missing_feature(void *avc, void avpriv_request_sample(void *avc, const char *msg, ...) av_printf_format(2, 3); -#define PTRDIFF_SPECIFIER "td" -#define SIZE_SPECIFIER "zu" - #ifdef DEBUG # define ff_dlog(ctx, ...) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__) #else diff --git a/libavutil/tests/channel_layout.c b/libavutil/tests/channel_layout.c index e79e4c3611..9185547eaa 100644 --- a/libavutil/tests/channel_layout.c +++ b/libavutil/tests/channel_layout.c @@ -25,7 +25,6 @@ #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" #include "libavutil/error.h" -#include "libavutil/internal.h" #include "libavutil/macros.h" #include "libavutil/mem.h" @@ -41,7 +40,7 @@ func_name ## _bprint(BPRINT_ARGS ## ARG_ORDER((bp), __VA_ARGS__)); \ if (strlen((bp)->str) != (bp)->len) { \ printf("strlen of AVBPrint-string returned by "#func_name"_bprint" \ - " differs from AVBPrint.len: %"SIZE_SPECIFIER" vs. %u\n", \ + " differs from AVBPrint.len: %zu vs. %u\n", \ strlen((bp)->str), (bp)->len); \ break; \ } \ diff --git a/libavutil/tests/imgutils.c b/libavutil/tests/imgutils.c index cd363145ad..39684795d4 100644 --- a/libavutil/tests/imgutils.c +++ b/libavutil/tests/imgutils.c @@ -44,13 +44,13 @@ static int check_image_fill(enum AVPixelFormat pix_fmt, int w, int h) { // Test the output of av_image_fill_plane_sizes() printf(", plane_sizes:"); for (i = 0; i < 4; i++) - printf(" %5"SIZE_SPECIFIER, sizes[i]); + printf(" %5zu", sizes[i]); // Test the output of av_image_fill_pointers() for (i = 0; i < 3 && data[i + 1]; i++) offsets[i] = data[i + 1] - data[i]; printf(", plane_offsets:"); for (i = 0; i < 3; i++) - printf(" %5"PTRDIFF_SPECIFIER, offsets[i]); + printf(" %5td", offsets[i]); printf(", total_size: %d", total_size); return 0; diff --git a/libavutil/tests/side_data_array.c b/libavutil/tests/side_data_array.c index 633e9ee681..fcc6f5e8d0 100644 --- a/libavutil/tests/side_data_array.c +++ b/libavutil/tests/side_data_array.c @@ -27,7 +27,7 @@ static void print_entries(const AVFrameSideData **sd, const int nb_sd) for (int i = 0; i < nb_sd; i++) { const AVFrameSideData *entry = sd[i]; - printf("sd %d (size %"SIZE_SPECIFIER"), %s", + printf("sd %d (size %zu), %s", i, entry->size, av_frame_side_data_name(entry->type)); if (entry->type != AV_FRAME_DATA_SEI_UNREGISTERED) { diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index c3d8c1d0d9..3015a536c2 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -1066,7 +1066,7 @@ int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, .pNext = &ded_req, }; - av_log(s, AV_LOG_DEBUG, "Creating a buffer of %"SIZE_SPECIFIER" bytes, " + av_log(s, AV_LOG_DEBUG, "Creating a buffer of %zu bytes, " "usage: 0x%x, flags: 0x%x\n", size, usage, flags); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
