From 7b8fa4758c1a249f8a904c3e902d90222f9e5f89 Mon Sep 17 00:00:00 2001 From: Rod Widdowson Date: Wed, 29 Jan 2020 10:31:15 +0000 Subject: [PATCH] Windows: Fix type cast warning. Since at least SDK V6.1 HCRYPTPROV has been specified as ULONG_PTR this means that comparing or setting one with NULL causes a cast warning. Use an explicit cast from zero to that type. --- lib/hcrypto/rand-w32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hcrypto/rand-w32.c b/lib/hcrypto/rand-w32.c index f36903ae3..d7d91a367 100644 --- a/lib/hcrypto/rand-w32.c +++ b/lib/hcrypto/rand-w32.c @@ -41,15 +41,15 @@ #include "randi.h" -volatile static HCRYPTPROV g_cryptprovider = NULL; +volatile static HCRYPTPROV g_cryptprovider; static HCRYPTPROV _hc_CryptProvider(void) { BOOL rv; - HCRYPTPROV cryptprovider = NULL; + HCRYPTPROV cryptprovider = (HCRYPTPROV)0; - if (g_cryptprovider != NULL) + if (g_cryptprovider) goto out; rv = CryptAcquireContext(&cryptprovider, NULL,