[Groonga-commit] ranguba/rroonga at acecdfa [master] use rb_id2sym if avaliable

Back to archive index

cosmo0920 null+****@clear*****
Mon Sep 29 02:53:39 JST 2014


cosmo0920	2014-09-29 02:53:39 +0900 (Mon, 29 Sep 2014)

  New Revision: acecdfa2c15cf7d083334c55ee1af23658412fa2
  https://github.com/ranguba/rroonga/commit/acecdfa2c15cf7d083334c55ee1af23658412fa2

  Message:
    use rb_id2sym if avaliable
    
    In Ruby 2.2, use rb_id2sym() instead of ID2SYM().
    Using rb_to_symbol() inappropriate.

  Modified files:
    ext/groonga/extconf.rb
    ext/groonga/rb-grn-utils.c
    ext/groonga/rb-grn.h

  Modified: ext/groonga/extconf.rb (+1 -1)
===================================================================
--- ext/groonga/extconf.rb    2014-09-29 02:35:45 +0900 (f707e00)
+++ ext/groonga/extconf.rb    2014-09-29 02:53:39 +0900 (795a54b)
@@ -269,7 +269,7 @@ $defs << "-DGRN_MICRO_VERSION=#{real_micro}"
 have_header("ruby/st.h") unless have_macro("HAVE_RUBY_ST_H", "ruby.h")
 have_func("rb_errinfo", "ruby.h")
 have_func("rb_sym2str", "ruby.h")
-have_func("rb_to_symbol", "ruby.h")
+have_func("rb_id2sym", "ruby.h")
 have_type("enum ruby_value_type", "ruby.h")
 
 checking_for(checking_message("--enable-debug-log option")) do

  Modified: ext/groonga/rb-grn-utils.c (+2 -2)
===================================================================
--- ext/groonga/rb-grn-utils.c    2014-09-29 02:35:45 +0900 (77d5767)
+++ ext/groonga/rb-grn-utils.c    2014-09-29 02:53:39 +0900 (03ef723)
@@ -674,8 +674,8 @@ rb_grn_add_vector_element (VALUE rb_element, grn_ctx *context, grn_obj *vector,
         ID id_weight;
         CONST_ID(id_value, "value");
         CONST_ID(id_weight, "weight");
-        rb_value = rb_hash_aref(rb_element, rb_to_symbol(id_value));
-        rb_weight = rb_hash_aref(rb_element, rb_to_symbol(id_weight));
+        rb_value = rb_hash_aref(rb_element, rb_id2sym(id_value));
+        rb_weight = rb_hash_aref(rb_element, rb_id2sym(id_weight));
         RVAL2GRNOBJ(rb_value, context, &value_buffer);
         if (!NIL_P(rb_weight)) {
             weight = NUM2UINT(rb_weight);

  Modified: ext/groonga/rb-grn.h (+2 -2)
===================================================================
--- ext/groonga/rb-grn.h    2014-09-29 02:35:45 +0900 (e31506c)
+++ ext/groonga/rb-grn.h    2014-09-29 02:53:39 +0900 (0481d4d)
@@ -46,8 +46,8 @@
 #  define SYM2STR(name) (RSTRING_PTR(rb_sym2str(name)))
 #endif
 
-#ifndef HAVE_RB_TO_SYMBOL
-#  define rb_to_symbol(name) (ID2SYM(name))
+#ifndef HAVE_RB_ID2SYM
+#  define rb_id2sym(name) (ID2SYM(name))
 #endif
 
 #include <groonga.h>
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index