summaryrefslogtreecommitdiffstats
path: root/ta
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-08 07:23:39 +0100
committerwm4 <wm4@nowhere>2017-01-08 07:32:44 +0100
commitd230194f62447f8569988f70aece43df86bca7a8 (patch)
treec6e82bdad6e1189ebd45b3d2aa49357b18d2fbdb /ta
parentf2a24ccfa5ad1c09a7a75316a4589b5676d3945c (diff)
downloadmpv-d230194f62447f8569988f70aece43df86bca7a8.tar.bz2
mpv-d230194f62447f8569988f70aece43df86bca7a8.tar.xz
ta: remove TA_FREEP NULL check
The NULL check triggers a gcc warning when passing the address of a variable to it. I was about to silence the warning with some equivalent code (that just happens to shut up gcc), but then I decided to remove the NULL check as I don't see a reason why we should allow this. We don't use it in the existing code anyway (all callers do something like TA_FREEP(&structptr->member), which is always non-NULL). Also fix some of the macro argument "quoting".
Diffstat (limited to 'ta')
-rw-r--r--ta/ta_talloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ta/ta_talloc.h b/ta/ta_talloc.h
index ce0ddaa4c9..f5eb35e17f 100644
--- a/ta/ta_talloc.h
+++ b/ta/ta_talloc.h
@@ -73,7 +73,7 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2,
// mpv specific stuff - should be made part of proper TA API
-#define TA_FREEP(pctx) do {if (pctx) {talloc_free(*pctx); (*pctx) = NULL;}} while(0)
+#define TA_FREEP(pctx) do {talloc_free(*(pctx)); *(pctx) = NULL;} while(0)
#define TA_EXPAND_ARGS(...) __VA_ARGS__