From 4c76c7c4b63ca7c47e9b19253f737b3548843cae Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Jun 2010 16:53:56 -0700 Subject: STR2CSTR with StringValuePtr for Ruby 1.9.2 STR2CSTR has been deprecated for a while now, and is completely removed in Ruby 1.9.2-preview3 --- ext/rpatricia/rpatricia.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/rpatricia/rpatricia.c b/ext/rpatricia/rpatricia.c index 0fc1002..854c5cd 100644 --- a/ext/rpatricia/rpatricia.c +++ b/ext/rpatricia/rpatricia.c @@ -42,7 +42,7 @@ p_add (int argc, VALUE *argv, VALUE self) return Qnil; Data_Get_Struct(self, patricia_tree_t, tree); - prefix = ascii2prefix(AF_INET, STR2CSTR(argv[0])); + prefix = ascii2prefix(AF_INET, StringValuePtr(argv[0])); node = patricia_lookup(tree, prefix); Deref_Prefix(prefix); @@ -70,7 +70,7 @@ p_remove (VALUE self, VALUE r_key) prefix_t *prefix; Data_Get_Struct(self, patricia_tree_t, tree); - c_key = STR2CSTR(r_key); + c_key = StringValuePtr(r_key); prefix = ascii2prefix (AF_INET, c_key); node = patricia_search_exact(tree, prefix); Deref_Prefix (prefix); @@ -91,7 +91,7 @@ p_match (VALUE self, VALUE r_key) prefix_t *prefix; Data_Get_Struct(self, patricia_tree_t, tree); - prefix = ascii2prefix (AF_INET, STR2CSTR(r_key)); + prefix = ascii2prefix (AF_INET, StringValuePtr(r_key)); node = patricia_search_best(tree, prefix); Deref_Prefix (prefix); @@ -110,7 +110,7 @@ p_match_exact (VALUE self, VALUE r_key) prefix_t *prefix; Data_Get_Struct(self, patricia_tree_t, tree); - prefix = ascii2prefix (AF_INET, STR2CSTR(r_key)); + prefix = ascii2prefix (AF_INET, StringValuePtr(r_key)); node = patricia_search_exact(tree, prefix); Deref_Prefix (prefix); -- cgit v1.2.3-24-ge0c7