From: David Disseldorp Date: Mon, 23 Jan 2012 20:18:20 +0000 (-0800) Subject: lib: use differing NTSTATUS and WERROR struct members X-Git-Tag: tevent-0.9.15~273 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af6bf7714d8eb4cd3ac4e9f9ab674326e74c6a49;p=thirdparty%2Fsamba.git lib: use differing NTSTATUS and WERROR struct members This allows the compiler to catch uses of incorrectly typed arguments for [NT_STATUS|W_ERROR]_IS_OK() and [NT_STATUS|W_ERROR]_EQUAL(). I.e. WERROR werr; werr = my_fn(); /* XXX returns WERROR type */ if (NT_STATUS_EQUAL(werr, NT_STATUS_OBJECT_NAME_COLLISION)) { --- diff --git a/libcli/util/werror.h b/libcli/util/werror.h index b49097443ec..4c14b7f2b20 100644 --- a/libcli/util/werror.h +++ b/libcli/util/werror.h @@ -30,9 +30,9 @@ */ #if defined(HAVE_IMMEDIATE_STRUCTURES) -typedef struct {uint32_t v;} WERROR; +typedef struct {uint32_t w;} WERROR; #define W_ERROR(x) ((WERROR) { x }) -#define W_ERROR_V(x) ((x).v) +#define W_ERROR_V(x) ((x).w) #else typedef uint32_t WERROR; #define W_ERROR(x) (x)