From 0691c9e0d316e847e11ded8167d9e0e6113a79d2 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Tue, 5 Dec 2017 08:55:42 +0100 Subject: [PATCH] Let's not duplicate those macros more than needed --- libretro-common/include/retro_miscellaneous.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 9baf2e0214..b29c5cdc54 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -78,14 +78,17 @@ #define BIT64_CLEAR_ALL(a) ((a) = 0) #define BIT128_SET(a, bit) ((a).data[(bit) >> 5] |= (1 << ((bit) & 31))) -#define BIT128_SET_PTR(a, bit) ((a)->data[(bit) >> 5] |= (1 << ((bit) & 31))) #define BIT128_CLEAR(a, bit) ((a).data[(bit) >> 5] &= ~(1 << ((bit) & 31))) #define BIT128_GET(a, bit) (((a).data[(bit) >> 5] >> ((bit) & 31)) & 1) -#define BIT128_GET_PTR(a, bit) (((a)->data[(bit) >> 5] >> ((bit) & 31)) & 1) #define BIT128_CLEAR_ALL(a) memset(&(a), 0, sizeof(a)) -#define BIT128_CLEAR_ALL_PTR(a) memset((a), 0, sizeof(retro_bits_t)) + +#define BIT128_SET_PTR(a, bit) BIT128_SET(*a, bit) +#define BIT128_CLEAR_PTR(a, bit) BIT128_CLEAR(*a, bit) +#define BIT128_GET_PTR(a, bit) BIT128_GET(*a, bit) +#define BIT128_CLEAR_ALL_PTR(a) BIT128_CLEAR_ALL(*a) /* Helper macros and struct to keep track of many booleans. */ +/* This struct has 256 bits, but the macros are named 128 due to some historical accident. */ typedef struct { uint32_t data[8];