1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/fiddle] Use "do { } while (0)" to ensure requiring ";"

2155ae5979
This commit is contained in:
Sutou Kouhei 2020-06-27 07:10:37 +09:00 committed by Nobuyoshi Nakada
parent 0faf6c8c0e
commit 50fbd00e76
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2020-06-28 02:03:20 +09:00

View file

@ -19,14 +19,14 @@ VALUE cFiddleFunction;
#define Check_Max_Args_Long(name, len) \
Check_Max_Args_(name, len, "l")
#define Check_Max_Args_(name, len, fmt) \
if ((size_t)(len) < MAX_ARGS) { \
/* OK */ \
} \
else { \
rb_raise(rb_eTypeError, \
name" is so large that it can cause integer overflow (%"fmt"d)", \
(len)); \
}
do { \
if ((size_t)(len) >= MAX_ARGS) { \
rb_raise(rb_eTypeError, \
"%s is so large " \
"that it can cause integer overflow (%"fmt"d)", \
(name), (len)); \
} \
} while (0)
static void
deallocate(void *p)