Windows: Add type casting in CRYPTO_atomic_add to remove warning
authorKochise <david.koch@9online.fr>
Mon, 16 Mar 2020 19:04:04 +0000 (20:04 +0100)
committerTomas Mraz <tmraz@fedoraproject.org>
Fri, 17 Apr 2020 11:21:13 +0000 (13:21 +0200)
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11337)

crypto/threads_win.c

index 43bd0f5..4d95cd3 100644 (file)
@@ -155,7 +155,7 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
 
 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 {
-    *ret = InterlockedExchangeAdd(val, amount) + amount;
+    *ret = (int)InterlockedExchangeAdd((long volatile *)val, (long)amount) + amount;
     return 1;
 }