diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-10 13:02:31 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-10 13:02:31 +0900 |
commit | 4989987419c42b04fbf3b0634ddaeace49108689 (patch) | |
tree | 499d4cd9d1eaa06bc986f4e2067033ddd59d4593 /debug_counter.h | |
parent | a82252df4244c4e92331ade58fc795b448ced3fc (diff) |
Explicit conversion to boolean to suppress shorten-64-to-32 warnings
Diffstat (limited to 'debug_counter.h')
-rw-r--r-- | debug_counter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/debug_counter.h b/debug_counter.h index f6223fba85..5935087e08 100644 --- a/debug_counter.h +++ b/debug_counter.h @@ -398,14 +398,14 @@ VALUE rb_debug_counter_show(VALUE klass); #define RB_DEBUG_COUNTER_INC(type) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, 1) #define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !(cond))) -#define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, (cond)) +#define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !!(cond)) #define RB_DEBUG_COUNTER_ADD(type, num) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, (num), 1) #define RB_DEBUG_COUNTER_SETMAX(type, num) rb_debug_counter_max(RB_DEBUG_COUNTER_##type, (unsigned int)(num)) #else #define RB_DEBUG_COUNTER_INC(type) ((void)0) -#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (cond) -#define RB_DEBUG_COUNTER_INC_IF(type, cond) (cond) +#define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!!(cond)) +#define RB_DEBUG_COUNTER_INC_IF(type, cond) (!!(cond)) #define RB_DEBUG_COUNTER_ADD(type, num) ((void)0) #define RB_DEBUG_COUNTER_SETMAX(type, num) 0 #endif |