From d230194f62447f8569988f70aece43df86bca7a8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 8 Jan 2017 07:23:39 +0100 Subject: 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". --- ta/ta_talloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ta') 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__ -- cgit v1.2.3