include: Use offsetof() instead of open coding it.

Michael Stefaniuc mstefani at winehq.org
Tue Mar 21 16:57:37 CDT 2017


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
 include/wintrust.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/wintrust.h b/include/wintrust.h
index 5da3720..20fb296 100644
--- a/include/wintrust.h
+++ b/include/wintrust.h
@@ -429,7 +429,7 @@ typedef struct _CRYPT_PROVUI_FUNCS {
 
 #include <poppack.h>
 
-#define WVT_OFFSETOF(t,f)     ((ULONG)((ULONG_PTR)(&((t*)0)->f)))
+#define WVT_OFFSETOF(t,f)     ((ULONG)(offsetof(t, f)))
 #define WVT_ISINSTRUCT(t,s,f) (WVT_OFFSETOF(t,f) + sizeof(((t*)0)->f) <= (s))
 #define WVT_IS_CBSTRUCT_GT_MEMBEROFFSET(t,s,f) WVT_ISINSTRUCT(t,s,f)
 
-- 
2.9.3




More information about the wine-patches mailing list