summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-22 01:58:47 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-22 01:58:47 +0000
commit2fd1525b0f17b986882140a7a337008befd31983 (patch)
tree5d25bd8b558ff706a97b04557b45b5c853dfd480 /string.c
parent2be65894e1c6aba3e1b58db8671ca36693c0b105 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 347937e383..3f3432fe4a 100644
--- a/string.c
+++ b/string.c
@@ -7035,7 +7035,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
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 repl, int sflag)
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;