ruby-changes:51281
From: normal <ko1@a...>
Date: Tue, 22 May 2018 10:58:54 +0900 (JST)
Subject: [ruby-changes:51281] normal:r63487 (trunk): string.c: MAYBE_UNUSED to suppress warnings for `old`
normal 2018-05-22 10:58:47 +0900 (Tue, 22 May 2018) New Revision: 63487 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63487 Log: string.c: MAYBE_UNUSED to suppress warnings for `old` Building with HAVE_MALLOC_USABLE_SIZE currently makes SIZED_REALLOC_N ignore the old size arg. Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 63486) +++ string.c (revision 63487) @@ -7035,7 +7035,7 @@ tr_trans(VALUE str, VALUE src, VALUE rep https://github.com/ruby/ruby/blob/trunk/string.c#L7035 if (enc != e1) may_modify = 1; } if ((offset = t - buf) + tlen > max) { - size_t old = max + termlen; + size_t MAYBE_UNUSED(old) = max + termlen; max = offset + tlen + (send - s); SIZED_REALLOC_N(buf, char, max + termlen, old); t = buf + offset; @@ -7108,7 +7108,7 @@ tr_trans(VALUE str, VALUE src, VALUE rep https://github.com/ruby/ruby/blob/trunk/string.c#L7108 if (enc != e1) may_modify = 1; } if ((offset = t - buf) + tlen > max) { - size_t old = max + termlen; + size_t MAYBE_UNUSED(old) = max + termlen; max = offset + tlen + (long)((send - s) * 1.2); SIZED_REALLOC_N(buf, char, max + termlen, old); t = buf + offset; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/