string.c: fix declaration-after-statement
* string.c (fstr_update_callback): move a variable declaration since ISO C90 forbids mixed declarations and code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
348903a628
commit
5a7ee1e117
3
string.c
3
string.c
@ -136,6 +136,8 @@ static int
|
|||||||
fstr_update_callback(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
|
fstr_update_callback(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
|
||||||
{
|
{
|
||||||
VALUE *fstr = (VALUE *)arg;
|
VALUE *fstr = (VALUE *)arg;
|
||||||
|
VALUE str = (VALUE)*key;
|
||||||
|
|
||||||
if (existing) {
|
if (existing) {
|
||||||
/* because of lazy sweep, str may be unmarked already and swept
|
/* because of lazy sweep, str may be unmarked already and swept
|
||||||
* at next time */
|
* at next time */
|
||||||
@ -143,7 +145,6 @@ fstr_update_callback(st_data_t *key, st_data_t *value, st_data_t arg, int existi
|
|||||||
return ST_STOP;
|
return ST_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE str = *key;
|
|
||||||
if (STR_SHARED_P(str)) {
|
if (STR_SHARED_P(str)) {
|
||||||
/* str should not be shared */
|
/* str should not be shared */
|
||||||
str = rb_enc_str_new(RSTRING_PTR(str), RSTRING_LEN(str), STR_ENC_GET(str));
|
str = rb_enc_str_new(RSTRING_PTR(str), RSTRING_LEN(str), STR_ENC_GET(str));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user