mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
2be65894e1
commit
2fd1525b0f
1 changed files with 2 additions and 2 deletions
4
string.c
4
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue