aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-12-08 12:52:21 +0000
committerMarge Bot <[email protected]>2020-01-22 21:42:52 +0000
commitd60b8fd3cbafda64dee5ae3e4960f3887fcc337b (patch)
tree252c60babd003ad7f0160666fe929a90f54decad
parentac0219cc5b6afa6d0392a164b58e21ce95079930 (diff)
util/atomic: fix return type of p_atomic_add_return() fallback
Fixes: 385d13f26d2b69db9423 ("util/atomic: Add a _return variant of p_atomic_add") Reviewed-by: Ivan Briano <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3012> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3012>
-rw-r--r--src/util/u_atomic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h
index 1ad87c8feb1..db56835e9d4 100644
--- a/src/util/u_atomic.h
+++ b/src/util/u_atomic.h
@@ -216,7 +216,7 @@
sizeof(*v) == sizeof(uint64_t) ? atomic_add_64((uint64_t *)(v), (i)) : \
(assert(!"should not get here"), 0))
-#define p_atomic_add_return(v, i) (void) ( \
+#define p_atomic_add_return(v, i) (__typeof(*v)) ( \
sizeof(*v) == sizeof(uint8_t) ? atomic_add_8_nv ((uint8_t *)(v), (i)) : \
sizeof(*v) == sizeof(uint16_t) ? atomic_add_16_nv((uint16_t *)(v), (i)) : \
sizeof(*v) == sizeof(uint32_t) ? atomic_add_32_nv((uint32_t *)(v), (i)) : \