1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

encoding.c: strdup macro

* encoding.c (enc_alias_internal): use strdup defined as macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-06-13 04:39:06 +00:00
parent 6379978d45
commit da5ac6f565
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Jun 13 13:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (enc_alias_internal): use strdup defined as macro.
Wed Jun 13 10:20:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need

View file

@ -461,6 +461,12 @@ rb_enc_unicode_p(rb_encoding *enc)
return name[0] == 'U' && name[1] == 'T' && name[2] == 'F' && name[4] != '7';
}
static st_data_t
enc_dup_name(st_data_t name)
{
return (st_data_t)strdup((const char *)name);
}
/*
* Returns copied alias name when the key is added for st_table,
* else returns NULL.
@ -469,7 +475,7 @@ static int
enc_alias_internal(const char *alias, int idx)
{
return st_insert2(enc_table.names, (st_data_t)alias, (st_data_t)idx,
(st_data_t(*)(st_data_t))strdup);
enc_dup_name);
}
static int