From c613d802bc5d87a7be031aaf97996d96bd8af909 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 13 Oct 2013 01:16:30 +0200 Subject: talloc: change talloc destructor signature Change talloc destructor so that they can never signal failure, and don't return a status code. This makes our talloc copy even more incompatible to upstream talloc, but on the other hand this is preparation for getting rid of talloc entirely. (The talloc replacement in the next commit won't allow the talloc_free equivalent to fail, and the destructor return value would be useless. But I don't want to change any mpv code either; the idea is that the talloc replacement commit can be reverted for some time in order to test whether the talloc replacement introduced a regression.) --- demux/demux.c | 6 ++---- demux/demux_lavf.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'demux') diff --git a/demux/demux.c b/demux/demux.c index 4fb121e29e..ba632218ec 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -116,12 +116,11 @@ static void ds_free_packs(struct demux_stream *ds) ds->eof = 0; } -static int packet_destroy(void *ptr) +static void packet_destroy(void *ptr) { struct demux_packet *dp = ptr; talloc_free(dp->avpacket); free(dp->allocation); - return 0; } static struct demux_packet *create_packet(size_t len) @@ -193,10 +192,9 @@ void free_demux_packet(struct demux_packet *dp) talloc_free(dp); } -static int destroy_avpacket(void *pkt) +static void destroy_avpacket(void *pkt) { av_free_packet(pkt); - return 0; } struct demux_packet *demux_copy_packet(struct demux_packet *dp) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 1e071f20e2..9b8881fc8a 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -717,10 +717,9 @@ static void seek_reset(demuxer_t *demux) priv->num_packets = 0; } -static int destroy_avpacket(void *pkt) +static void destroy_avpacket(void *pkt) { av_free_packet(pkt); - return 0; } static int read_more_av_packets(demuxer_t *demux) -- cgit v1.2.3