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:46 +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)

(cherry picked from commit 7da7b27eec58d1efc7012f002c45ddbdd61a5e79)

crypto/threads_win.c

index ba25d2719aadb388db938062c60ff3f08e7d8b03..0e6d77103ba8240d258f6a4eeaa94d4ea92a9618 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;
 }