ruby-changes:24003
From: nobu <ko1@a...>
Date: Wed, 13 Jun 2012 13:39:28 +0900 (JST)
Subject: [ruby-changes:24003] nobu:r36054 (trunk): encoding.c: strdup macro
nobu 2012-06-13 13:39:06 +0900 (Wed, 13 Jun 2012) New Revision: 36054 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36054 Log: encoding.c: strdup macro * encoding.c (enc_alias_internal): use strdup defined as macro. Modified files: trunk/ChangeLog trunk/encoding.c Index: encoding.c =================================================================== --- encoding.c (revision 36053) +++ encoding.c (revision 36054) @@ -461,6 +461,12 @@ 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 @@ 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 Index: ChangeLog =================================================================== --- ChangeLog (revision 36053) +++ ChangeLog (revision 36054) @@ -1,3 +1,7 @@ +Wed Jun 13 13:39:04 2012 Nobuyoshi Nakada <nobu@r...> + + * encoding.c (enc_alias_internal): use strdup defined as macro. + Wed Jun 13 10:20:27 2012 Nobuyoshi Nakada <nobu@r...> * process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/