From 3458ef619547cf89cfe7f600f4e36f786d5b3f2d Mon Sep 17 00:00:00 2001 From: Khairul Kasmiran Date: Sun, 7 Jan 2018 14:46:35 +0800 Subject: [PATCH] Renamed R_BIT_SWAP to R_BIT_TOGGLE --- libr/include/r_types.h | 2 +- libr/util/str.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libr/include/r_types.h b/libr/include/r_types.h index 1806f81e5d..81f00be2d3 100644 --- a/libr/include/r_types.h +++ b/libr/include/r_types.h @@ -276,7 +276,7 @@ static inline void *r_new_copy(int size, void *data) { #define R_BIT_SET(x,y) (((ut8*)x)[y>>4] |= (1<<(y&0xf))) #define R_BIT_UNSET(x,y) (((ut8*)x)[y>>4] &= ~(1<<(y&0xf))) -#define R_BIT_SWAP(x, y) ( R_BIT_CHK (x, y) ? \ +#define R_BIT_TOGGLE(x, y) ( R_BIT_CHK (x, y) ? \ R_BIT_UNSET (x, y): R_BIT_SET (x, y)) //#define R_BIT_CHK(x,y) ((((const ut8*)x)[y>>4] & (1<<(y&0xf)))) diff --git a/libr/util/str.c b/libr/util/str.c index 47f62dccb6..67b710e48b 100644 --- a/libr/util/str.c +++ b/libr/util/str.c @@ -2007,7 +2007,7 @@ R_API const char *r_str_firstbut (const char *s, char ch, const char *but) { isbut = strchr (but, *p); if (isbut) { idx = (int)(size_t)(isbut - but); - _b = R_BIT_SWAP(b, idx); + _b = R_BIT_TOGGLE (b, idx); continue; } if (*p == ch && !_b) { @@ -2033,7 +2033,7 @@ R_API const char *r_str_lastbut (const char *s, char ch, const char *but) { isbut = strchr (but, *p); if (isbut) { idx = (int)(size_t)(isbut - but); - _b = R_BIT_SWAP(b, idx); + _b = R_BIT_TOGGLE (b, idx); continue; } if (*p == ch && !_b) {