Ticket #3472: patchptrdiff.diff

File patchptrdiff.diff, 15.7 KB (added by Carl Eugen Hoyos, 12 years ago)
  • libavcodec/dvdsubenc.c

    diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
    index 8130b74..11858c7 100644
    a b static int encode_dvd_subtitles(AVCodecContext *avctx,  
    383383    qq = outbuf;
    384384    bytestream_put_be16(&qq, q - outbuf);
    385385
    386     av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%td\n", q - outbuf);
     386    av_log(NULL, AV_LOG_DEBUG, "subtitle_packet size=%"PTRDIFF_SPECIFIER"\n", q - outbuf);
    387387    ret = q - outbuf;
    388388
    389389fail:
  • libavcodec/flac_parser.c

    diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c
    index ba1f060..87af368 100644
    a b static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,  
    599599        if (   av_fifo_space(fpc->fifo_buf) < read_end - read_start
    600600            && av_fifo_realloc2(fpc->fifo_buf, (read_end - read_start) + 2*av_fifo_size(fpc->fifo_buf)) < 0) {
    601601            av_log(avctx, AV_LOG_ERROR,
    602                    "couldn't reallocate buffer of size %td\n",
     602                   "couldn't reallocate buffer of size %"PTRDIFF_SPECIFIER"\n",
    603603                   (read_end - read_start) + av_fifo_size(fpc->fifo_buf));
    604604            goto handle_error;
    605605        }
  • libavcodec/h264_slice.c

    diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
    index ed3c8fe..48f2381 100644
    a b static int decode_slice(struct AVCodecContext *avctx, void *arg)  
    24072407                return 0;
    24082408            }
    24092409            if (h->cabac.bytestream > h->cabac.bytestream_end + 2 )
    2410                 av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %td\n", h->cabac.bytestream_end - h->cabac.bytestream);
     2410                av_log(h->avctx, AV_LOG_DEBUG, "bytestream overread %"PTRDIFF_SPECIFIER"\n", h->cabac.bytestream_end - h->cabac.bytestream);
    24112411            if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) {
    24122412                av_log(h->avctx, AV_LOG_ERROR,
    2413                        "error while decoding MB %d %d, bytestream %td\n",
     2413                       "error while decoding MB %d %d, bytestream %"PTRDIFF_SPECIFIER"\n",
    24142414                       h->mb_x, h->mb_y,
    24152415                       h->cabac.bytestream_end - h->cabac.bytestream);
    24162416                er_add_slice(h, h->resync_mb_x, h->resync_mb_y, h->mb_x,
  • libavcodec/jpeg2000dec.c

    diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
    index 5ae540e..fbfb7d1 100644
    a b static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,  
    782782                return ret;
    783783            if (ret > sizeof(cblk->data)) {
    784784                avpriv_request_sample(s->avctx,
    785                                       "Block with lengthinc greater than %zu",
     785                                      "Block with lengthinc greater than %"SIZE_SPECIFIER"",
    786786                                      sizeof(cblk->data));
    787787                return AVERROR_PATCHWELCOME;
    788788            }
  • libavcodec/libvpxenc.c

    diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
    index 869c8fe..bc0cf96 100644
    a b static av_cold void dump_enc_cfg(AVCodecContext *avctx,  
    158158           width, "g_lag_in_frames:",   cfg->g_lag_in_frames);
    159159    av_log(avctx, level, "rate control settings\n"
    160160           "  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n"
    161            "  %*s%d\n  %*s%p(%zu)\n  %*s%u\n",
     161           "  %*s%d\n  %*s%p(%"SIZE_SPECIFIER")\n  %*s%u\n",
    162162           width, "rc_dropframe_thresh:",   cfg->rc_dropframe_thresh,
    163163           width, "rc_resize_allowed:",     cfg->rc_resize_allowed,
    164164           width, "rc_resize_up_thresh:",   cfg->rc_resize_up_thresh,
    static av_cold int vpx_init(AVCodecContext *avctx,  
    373373        ctx->twopass_stats.buf = av_malloc(ctx->twopass_stats.sz);
    374374        if (!ctx->twopass_stats.buf) {
    375375            av_log(avctx, AV_LOG_ERROR,
    376                    "Stat buffer alloc (%zu bytes) failed\n",
     376                   "Stat buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n",
    377377                   ctx->twopass_stats.sz);
    378378            return AVERROR(ENOMEM);
    379379        }
    static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,  
    616616
    617617                if (!cx_frame->buf) {
    618618                    av_log(avctx, AV_LOG_ERROR,
    619                            "Data buffer alloc (%zu bytes) failed\n",
     619                           "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n",
    620620                           cx_frame->sz);
    621621                    av_free(cx_frame);
    622622                    return AVERROR(ENOMEM);
    static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,  
    626626                    cx_frame->buf_alpha = av_malloc(cx_frame->sz_alpha);
    627627                    if (!cx_frame->buf_alpha) {
    628628                        av_log(avctx, AV_LOG_ERROR,
    629                                "Data buffer alloc (%zu bytes) failed\n",
     629                               "Data buffer alloc (%"SIZE_SPECIFIER" bytes) failed\n",
    630630                               cx_frame->sz_alpha);
    631631                        av_free(cx_frame);
    632632                        return AVERROR(ENOMEM);
  • libavcodec/mjpegdec.c

    diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
    index 9f7d08f..d6e0fb5 100644
    a b int ff_mjpeg_find_marker(MJpegDecodeContext *s,  
    18151815        memset(s->buffer + *unescaped_buf_size, 0,
    18161816               FF_INPUT_BUFFER_PADDING_SIZE);
    18171817
    1818         av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %td bytes\n",
     1818        av_log(s->avctx, AV_LOG_DEBUG, "escaping removed %"PTRDIFF_SPECIFIER" bytes\n",
    18191819               (buf_end - *buf_ptr) - (dst - s->buffer));
    18201820    } else if (start_code == SOS && s->ls) {
    18211821        const uint8_t *src = *buf_ptr;
    int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,  
    18981898                   start_code, unescaped_buf_size, buf_size);
    18991899            return AVERROR_INVALIDDATA;
    19001900        }
    1901         av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%td\n",
     1901        av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n",
    19021902               start_code, buf_end - buf_ptr);
    19031903
    19041904        ret = init_get_bits8(&s->gb, unescaped_buf_ptr, unescaped_buf_size);
    the_end:  
    21832183    av_dict_copy(avpriv_frame_get_metadatap(data), s->exif_metadata, 0);
    21842184    av_dict_free(&s->exif_metadata);
    21852185
    2186     av_log(avctx, AV_LOG_DEBUG, "decode frame unused %td bytes\n",
     2186    av_log(avctx, AV_LOG_DEBUG, "decode frame unused %"PTRDIFF_SPECIFIER" bytes\n",
    21872187           buf_end - buf_ptr);
    21882188//  return buf_end - buf_ptr;
    21892189    return buf_ptr - buf;
  • libavcodec/mpeg12dec.c

    diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
    index b99af17..2071298 100644
    a b static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,  
    23912391        input_size = buf_end - buf_ptr;
    23922392
    23932393        if (avctx->debug & FF_DEBUG_STARTCODE)
    2394             av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %td left %d\n",
     2394            av_log(avctx, AV_LOG_DEBUG, "%3"PRIX32" at %"PTRDIFF_SPECIFIER" left %d\n",
    23952395                   start_code, buf_ptr - buf, input_size);
    23962396
    23972397        /* prepare data for next start code */
  • libavcodec/mpegvideo_enc.c

    diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
    index 79b2be6..83976d0 100644
    a b static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)  
    10451045        if (s->linesize & (STRIDE_ALIGN-1))
    10461046            direct = 0;
    10471047
    1048         av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
     1048        av_dlog(s->avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0],
    10491049                pic_arg->linesize[1], s->linesize, s->uvlinesize);
    10501050
    10511051        if (direct) {
  • libavcodec/wmadec.c

    diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
    index b1816b4..466c1a9 100644
    a b static int wma_decode_superframe(AVCodecContext *avctx, void *data,  
    927927        samples_offset += s->frame_len;
    928928    }
    929929
    930     av_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n",
     930    av_dlog(s->avctx, "%d %d %d %d outbytes:%"PTRDIFF_SPECIFIER" eaten:%d\n",
    931931            s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
    932932            (int8_t *)samples - (int8_t *)data, avctx->block_align);
    933933
  • libavcodec/zmbv.c

    diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
    index 71e8287..21a9e35 100644
    a b static int zmbv_decode_xor_8(ZmbvContext *c)  
    145145        prev += c->width * c->bh;
    146146    }
    147147    if (src - c->decomp_buf != c->decomp_len)
    148         av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
     148        av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n",
    149149               src-c->decomp_buf, c->decomp_len);
    150150    return 0;
    151151}
    static int zmbv_decode_xor_16(ZmbvContext *c)  
    219219        prev += c->width * c->bh;
    220220    }
    221221    if (src - c->decomp_buf != c->decomp_len)
    222         av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
     222        av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n",
    223223               src-c->decomp_buf, c->decomp_len);
    224224    return 0;
    225225}
    static int zmbv_decode_xor_32(ZmbvContext *c)  
    377377        prev   += c->width * c->bh;
    378378    }
    379379    if (src - c->decomp_buf != c->decomp_len)
    380         av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
     380        av_log(c->avctx, AV_LOG_ERROR, "Used %"PTRDIFF_SPECIFIER" of %i bytes\n",
    381381               src-c->decomp_buf, c->decomp_len);
    382382    return 0;
    383383}
  • libavformat/ape.c

    diff --git a/libavformat/ape.c b/libavformat/ape.c
    index b677ba9..d5a786a 100644
    a b static int ape_read_header(AVFormatContext * s)  
    264264    }
    265265    if (ape->seektablelength / sizeof(*ape->seektable) < ape->totalframes) {
    266266        av_log(s, AV_LOG_ERROR,
    267                "Number of seek entries is less than number of frames: %zu vs. %"PRIu32"\n",
     267               "Number of seek entries is less than number of frames: %"SIZE_SPECIFIER" vs. %"PRIu32"\n",
    268268               ape->seektablelength / sizeof(*ape->seektable), ape->totalframes);
    269269        return AVERROR_INVALIDDATA;
    270270    }
  • libavformat/id3v2.c

    diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
    index 8a8989b..e813ca3 100644
    a b static void read_geobtag(AVFormatContext *s, AVIOContext *pb, int taglen,  
    327327
    328328    geob_data = av_mallocz(sizeof(ID3v2ExtraMetaGEOB));
    329329    if (!geob_data) {
    330         av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n",
     330        av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n",
    331331               sizeof(ID3v2ExtraMetaGEOB));
    332332        return;
    333333    }
    334334
    335335    new_extra = av_mallocz(sizeof(ID3v2ExtraMeta));
    336336    if (!new_extra) {
    337         av_log(s, AV_LOG_ERROR, "Failed to alloc %zu bytes\n",
     337        av_log(s, AV_LOG_ERROR, "Failed to alloc %"SIZE_SPECIFIER" bytes\n",
    338338               sizeof(ID3v2ExtraMeta));
    339339        goto fail;
    340340    }
  • libavformat/mmsh.c

    diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
    index 482ece4..dac5d9f 100644
    a b static int read_data_packet(MMSHContext *mmsh, const int len)  
    119119    int res;
    120120    if (len > sizeof(mms->in_buffer)) {
    121121        av_log(NULL, AV_LOG_ERROR,
    122                "Data packet length %d exceeds the in_buffer size %zu\n",
     122               "Data packet length %d exceeds the in_buffer size %"SIZE_SPECIFIER"\n",
    123123               len, sizeof(mms->in_buffer));
    124124        return AVERROR(EIO);
    125125    }
    static int get_http_header_data(MMSHContext *mmsh)  
    194194            if (len) {
    195195                if (len > sizeof(mms->in_buffer)) {
    196196                    av_log(NULL, AV_LOG_ERROR,
    197                            "Other packet len = %d exceed the in_buffer size %zu\n",
     197                           "Other packet len = %d exceed the in_buffer size %"SIZE_SPECIFIER"\n",
    198198                           len, sizeof(mms->in_buffer));
    199199                    return AVERROR(EIO);
    200200                }
  • libavformat/mmst.c

    diff --git a/libavformat/mmst.c b/libavformat/mmst.c
    index ebef3ef..c851187 100644
    a b static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)  
    284284            if (length_remaining < 0
    285285                || length_remaining > sizeof(mms->in_buffer) - 12) {
    286286                av_log(NULL, AV_LOG_ERROR,
    287                        "Incoming packet length %d exceeds bufsize %zu\n",
     287                       "Incoming packet length %d exceeds bufsize %"SIZE_SPECIFIER"\n",
    288288                       length_remaining, sizeof(mms->in_buffer) - 12);
    289289                return AVERROR_INVALIDDATA;
    290290            }
    static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)  
    320320            if (length_remaining < 0
    321321                || length_remaining > sizeof(mms->in_buffer) - 8) {
    322322                av_log(NULL, AV_LOG_ERROR,
    323                        "Data length %d is invalid or too large (max=%zu)\n",
     323                       "Data length %d is invalid or too large (max=%"SIZE_SPECIFIER")\n",
    324324                       length_remaining, sizeof(mms->in_buffer));
    325325                return AVERROR_INVALIDDATA;
    326326            }
  • libavformat/oggparsevorbis.c

    diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
    index 57f0c6d..06536f6 100644
    a b int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,  
    169169
    170170    if (p != end)
    171171        av_log(as, AV_LOG_INFO,
    172                "%ti bytes of comment header remain\n", end - p);
     172               "%"PTRDIFF_SPECIFIER" bytes of comment header remain\n", end - p);
    173173    if (n > 0)
    174174        av_log(as, AV_LOG_INFO,
    175175               "truncated comment header, %i comments not found\n", n);
  • libavformat/rtpdec_xiph.c

    diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
    index 887a65e..43f72a2 100644
    a b parse_packed_headers(const uint8_t * packed_headers,  
    256256
    257257    if (packed_headers_end - packed_headers < 9) {
    258258        av_log(codec, AV_LOG_ERROR,
    259                "Invalid %td byte packed header.",
     259               "Invalid %"PTRDIFF_SPECIFIER" byte packed header.",
    260260               packed_headers_end - packed_headers);
    261261        return AVERROR_INVALIDDATA;
    262262    }
    parse_packed_headers(const uint8_t * packed_headers,  
    278278    if (packed_headers_end - packed_headers != length ||
    279279        length1 > length || length2 > length - length1) {
    280280        av_log(codec, AV_LOG_ERROR,
    281                "Bad packed header lengths (%d,%d,%td,%d)\n", length1,
     281               "Bad packed header lengths (%d,%d,%"PTRDIFF_SPECIFIER",%d)\n", length1,
    282282               length2, packed_headers_end - packed_headers, length);
    283283        return AVERROR_INVALIDDATA;
    284284    }
  • libavformat/sdp.c

    diff --git a/libavformat/sdp.c b/libavformat/sdp.c
    index ae29483..c53de90 100644
    a b static char *extradata2psets(AVCodecContext *c)  
    217217            sps_end = r1;
    218218        }
    219219        if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) {
    220             av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
     220            av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"!\n", MAX_PSET_SIZE - (p - psets), r1 - r);
    221221            av_free(psets);
    222222
    223223            return NULL;
  • libavutil/internal.h

    diff --git a/libavutil/internal.h b/libavutil/internal.h
    index 9c5546f..6e2aede 100644
    a b void avpriv_request_sample(void *avc,  
    213213
    214214#if HAVE_LIBC_MSVCRT
    215215#define avpriv_open ff_open
     216#define PTRDIFF_SPECIFIER "Id"
     217#define SIZE_SPECIFIER "Iu"
     218#else
     219#define PTRDIFF_SPECIFIER "td"
     220#define SIZE_SPECIFIER "zu"
    216221#endif
    217222
    218223/**