зеркало из https://github.com/github/ruby.git
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:
Родитель
6379978d45
Коммит
da5ac6f565
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче