libndr: Use better and more clear check for empty flags
authorAndreas Schneider <asn@samba.org>
Mon, 1 Feb 2021 17:20:18 +0000 (18:20 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 1 Feb 2021 21:50:32 +0000 (21:50 +0000)
warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/ndr/libndr.h

index fd772b9b51020dadeaf162d9fd53e594d1ea5e63..25b68db34667603dedc237f3f82e173e5a9b59b0 100644 (file)
@@ -415,7 +415,7 @@ enum ndr_compression_alg {
 #define NDR_PULL_GET_MEM_CTX(ndr) (ndr->current_mem_ctx)
 
 #define NDR_PULL_SET_MEM_CTX(ndr, mem_ctx, flgs) do {\
-       if ( !(flgs) || (ndr->flags & flgs) ) {\
+       if ( (flgs == 0) || (ndr->flags & flgs) ) {\
                if (!(mem_ctx)) {\
                        return ndr_pull_error(ndr, NDR_ERR_ALLOC, "NDR_PULL_SET_MEM_CTX(NULL): %s\n", __location__); \
                }\