ruby-changes:56447
From: Yusuke <ko1@a...>
Date: Sun, 14 Jul 2019 14:04:35 +0900 (JST)
Subject: [ruby-changes:56447] Yusuke Endoh: ba94404f70 (master): Add /* fall through */ comments
https://git.ruby-lang.org/ruby.git/commit/?id=ba94404f70 From ba94404f7021fae41a827e080be6d5dd0bbac8e4 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Sun, 14 Jul 2019 14:03:44 +0900 Subject: Add /* fall through */ comments to suppress some Coverity Scan warnings diff --git a/marshal.c b/marshal.c index 3396d89..8f4a0ae 100644 --- a/marshal.c +++ b/marshal.c @@ -370,12 +370,12 @@ load_mantissa(double d, const char *buf, long len) https://github.com/ruby/ruby/blob/trunk/marshal.c#L370 do { m = 0; switch (len) { - default: m = *buf++ & 0xff; + default: m = *buf++ & 0xff; /* fall through */ #if MANT_BITS > 24 - case 3: m = (m << 8) | (*buf++ & 0xff); + case 3: m = (m << 8) | (*buf++ & 0xff); /* fall through */ #endif #if MANT_BITS > 16 - case 2: m = (m << 8) | (*buf++ & 0xff); + case 2: m = (m << 8) | (*buf++ & 0xff); /* fall through */ #endif #if MANT_BITS > 8 case 1: m = (m << 8) | (*buf++ & 0xff); @@ -1799,6 +1799,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) https://github.com/ruby/ruby/blob/trunk/marshal.c#L1799 case 'L': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'X': case 'Y': if (bs & 1) --dst; + /* fall through */ default: bs = 0; break; } } diff --git a/sprintf.c b/sprintf.c index 53abbdd..471d655 100644 --- a/sprintf.c +++ b/sprintf.c @@ -677,6 +677,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) https://github.com/ruby/ruby/blob/trunk/sprintf.c#L677 case '\n': case '\0': p--; + /* fall through */ case '%': if (flags != FNONE) { rb_raise(rb_eArgError, "invalid format character - %%"); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/