From eae1366b3867fe304b54c2adcc87fdd583990077 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 23 Apr 2013 02:58:48 +0000 Subject: string.c: suppress warnings * string.c (rb_str_scrub): suppress maybe-uninitialized and empty body in an else-statement. [ruby-dev:45975] [Feature #6752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index ce9cce03d1..7bb4d5bd90 100644 --- a/string.c +++ b/string.c @@ -7815,6 +7815,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str) VALUE buf = rb_str_buf_new(RSTRING_LEN(str)); if (rb_block_given_p()) { rep = NULL; + replen = 0; + rep7bit_p = FALSE; } else if (!NIL_P(repl)) { rep = RSTRING_PTR(repl); @@ -7866,8 +7868,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str) for (; clen > 1; clen--) { ret = rb_enc_precise_mbclen(q, q + clen, enc); if (MBCLEN_NEEDMORE_P(ret)) break; - else if (MBCLEN_INVALID_P(ret)) continue; - else UNREACHABLE; + if (MBCLEN_INVALID_P(ret)) continue; + UNREACHABLE; } } if (rep) { @@ -7978,8 +7980,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str) for (; clen > mbminlen; clen-=mbminlen) { ret = rb_enc_precise_mbclen(q, q + clen, enc); if (MBCLEN_NEEDMORE_P(ret)) break; - else if (MBCLEN_INVALID_P(ret)) continue; - else UNREACHABLE; + if (MBCLEN_INVALID_P(ret)) continue; + UNREACHABLE; } } if (rep) { -- cgit v1.2.3