summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-13 01:16:30 +0200
committerwm4 <wm4@nowhere>2013-10-13 01:16:30 +0200
commitc613d802bc5d87a7be031aaf97996d96bd8af909 (patch)
tree5f18f9ceaf51cb077861099def7dabe3422676f3 /video
parent8d5f800567d81665820d308b7f2d482c18c51e15 (diff)
downloadmpv-c613d802bc5d87a7be031aaf97996d96bd8af909.tar.bz2
mpv-c613d802bc5d87a7be031aaf97996d96bd8af909.tar.xz
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.)
Diffstat (limited to 'video')
-rw-r--r--video/mp_image.c6
-rw-r--r--video/mp_image_pool.c3
-rw-r--r--video/sws_utils.c3
3 files changed, 4 insertions, 8 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 4015f27d4a..3bc76b669e 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -62,11 +62,10 @@ struct m_refcount {
};
// Only for checking API usage
-static int m_refcount_destructor(void *ptr)
+static void m_refcount_destructor(void *ptr)
{
struct m_refcount *ref = ptr;
assert(ref->refcount == 0);
- return 0;
}
// Starts out with refcount==1, caller can set .arg and .free and .ext_*
@@ -165,11 +164,10 @@ void mp_image_setfmt(struct mp_image *mpi, unsigned int out_fmt)
mp_image_set_size(mpi, mpi->w, mpi->h);
}
-static int mp_image_destructor(void *ptr)
+static void mp_image_destructor(void *ptr)
{
mp_image_t *mpi = ptr;
m_refcount_unref(mpi->refcount);
- return 0;
}
static int mp_chroma_div_up(int size, int shift)
diff --git a/video/mp_image_pool.c b/video/mp_image_pool.c
index 733f2059b4..1ef08b5e2d 100644
--- a/video/mp_image_pool.c
+++ b/video/mp_image_pool.c
@@ -58,11 +58,10 @@ struct image_flags {
bool pool_alive; // the mp_image_pool references this
};
-static int image_pool_destructor(void *ptr)
+static void image_pool_destructor(void *ptr)
{
struct mp_image_pool *pool = ptr;
mp_image_pool_clear(pool);
- return 0;
}
struct mp_image_pool *mp_image_pool_new(int max_count)
diff --git a/video/sws_utils.c b/video/sws_utils.c
index bc9c408b3e..c90efe020c 100644
--- a/video/sws_utils.c
+++ b/video/sws_utils.c
@@ -150,13 +150,12 @@ static bool cache_valid(struct mp_sws_context *ctx)
ctx->saturation == old->saturation;
}
-static int free_mp_sws(void *p)
+static void free_mp_sws(void *p)
{
struct mp_sws_context *ctx = p;
sws_freeContext(ctx->sws);
sws_freeFilter(ctx->src_filter);
sws_freeFilter(ctx->dst_filter);
- return 0;
}
// You're supposed to set your scaling parameters on the returned context.