diff options
author | Sutou Kouhei <kou@clear-code.com> | 2020-06-27 07:10:37 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-06-27 23:54:08 +0900 |
commit | 50fbd00e76f2a7a6ed17e73605fa69ce80cafb01 (patch) | |
tree | 668f0489a76b2346e6690e77048b5b0676570349 /ext/fiddle | |
parent | 0faf6c8c0e70b885f7275771a95b554e725f8b94 (diff) |
[ruby/fiddle] Use "do { } while (0)" to ensure requiring ";"
https://github.com/ruby/fiddle/commit/2155ae5979
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3265
Diffstat (limited to 'ext/fiddle')
-rw-r--r-- | ext/fiddle/function.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c index b624255f27..95648d3c96 100644 --- a/ext/fiddle/function.c +++ b/ext/fiddle/function.c @@ -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) |