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
This commit is contained in:
parent
0a13d383be
commit
eae1366b38
10
string.c
10
string.c
@ -7815,6 +7815,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str)
|
|||||||
VALUE buf = rb_str_buf_new(RSTRING_LEN(str));
|
VALUE buf = rb_str_buf_new(RSTRING_LEN(str));
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
rep = NULL;
|
rep = NULL;
|
||||||
|
replen = 0;
|
||||||
|
rep7bit_p = FALSE;
|
||||||
}
|
}
|
||||||
else if (!NIL_P(repl)) {
|
else if (!NIL_P(repl)) {
|
||||||
rep = RSTRING_PTR(repl);
|
rep = RSTRING_PTR(repl);
|
||||||
@ -7866,8 +7868,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str)
|
|||||||
for (; clen > 1; clen--) {
|
for (; clen > 1; clen--) {
|
||||||
ret = rb_enc_precise_mbclen(q, q + clen, enc);
|
ret = rb_enc_precise_mbclen(q, q + clen, enc);
|
||||||
if (MBCLEN_NEEDMORE_P(ret)) break;
|
if (MBCLEN_NEEDMORE_P(ret)) break;
|
||||||
else if (MBCLEN_INVALID_P(ret)) continue;
|
if (MBCLEN_INVALID_P(ret)) continue;
|
||||||
else UNREACHABLE;
|
UNREACHABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rep) {
|
if (rep) {
|
||||||
@ -7978,8 +7980,8 @@ rb_str_scrub(int argc, VALUE *argv, VALUE str)
|
|||||||
for (; clen > mbminlen; clen-=mbminlen) {
|
for (; clen > mbminlen; clen-=mbminlen) {
|
||||||
ret = rb_enc_precise_mbclen(q, q + clen, enc);
|
ret = rb_enc_precise_mbclen(q, q + clen, enc);
|
||||||
if (MBCLEN_NEEDMORE_P(ret)) break;
|
if (MBCLEN_NEEDMORE_P(ret)) break;
|
||||||
else if (MBCLEN_INVALID_P(ret)) continue;
|
if (MBCLEN_INVALID_P(ret)) continue;
|
||||||
else UNREACHABLE;
|
UNREACHABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rep) {
|
if (rep) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user