summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-13 04:39:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-13 04:39:06 +0000
commitda5ac6f565b134e42bcde3cced31b13b8b7fd569 (patch)
treeabc5169c9ec377e6449bf2f574e69d471d3a914f /encoding.c
parent6379978d453a910ad672f3def32b869a6cfa108c (diff)
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
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c
index a0c860625a..38e28c837d 100644
--- a/encoding.c
+++ b/encoding.c
@@ -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