]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix invalid cast in win32 stdatomic.h shim
authorOndřej Surý <ondrej@isc.org>
Wed, 15 Apr 2020 10:27:23 +0000 (12:27 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 15 Apr 2020 10:47:42 +0000 (12:47 +0200)
The InterlockedOr8() and InterlockedAnd8() first argument was cast
to (atomic_int_fast8_t) instead of (atomic_int_fast8_t *), this was
reported by MSVC as:

  warning C4024: '_InterlockedOr8': different types for formal and actual parameter 1
  warning C4024: '_InterlockedAnd8': different types for formal and actual parameter 1

lib/isc/win32/include/isc/stdatomic.h

index 8eacb011a94a222f6a09c91978ae0ff4938223df..0fccf4600cc68d29c1ecc527dc001e0303c8970a 100644 (file)
@@ -244,7 +244,7 @@ atomic_add_abort() {
        atomic_fetch_sub_explicit(obj, arg, memory_order_seq_cst)
 
 #define atomic_fetch_and_explicit8(obj, arg, order) \
-       InterlockedAnd8((atomic_int_fast8_t)obj, arg)
+       InterlockedAnd8((atomic_int_fast8_t *)obj, arg)
 
 #define atomic_fetch_and_explicit32(obj, arg, order)                         \
        (order == memory_order_relaxed                                       \
@@ -299,7 +299,7 @@ atomic_and_abort() {
        atomic_fetch_and_explicit(obj, arg, memory_order_seq_cst)
 
 #define atomic_fetch_or_explicit8(obj, arg, order) \
-       InterlockedOr8((atomic_int_fast8_t)obj, arg)
+       InterlockedOr8((atomic_int_fast8_t *)obj, arg)
 
 #define atomic_fetch_or_explicit32(obj, arg, order)                            \
        (order == memory_order_relaxed                                         \