summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/memory_view/memory_view.c42
-rw-r--r--ext/-test-/string/coderange.c8
-rw-r--r--ext/openssl/ossl_ts.c26
-rw-r--r--ext/racc/cparse/cparse.c2
4 files changed, 39 insertions, 39 deletions
diff --git a/ext/-test-/memory_view/memory_view.c b/ext/-test-/memory_view/memory_view.c
index a59e7b8..0ae9f45 100644
--- a/ext/-test-/memory_view/memory_view.c
+++ b/ext/-test-/memory_view/memory_view.c
@@ -350,35 +350,35 @@ Init_memory_view(void)
rb_define_method(cMDView, "[]", mdview_aref, 1);
rb_memory_view_register(cMDView, &mdview_memory_view_entry);
- id_str = rb_intern("__str__");
- sym_format = ID2SYM(rb_intern("format"));
- sym_native_size_p = ID2SYM(rb_intern("native_size_p"));
- sym_offset = ID2SYM(rb_intern("offset"));
- sym_size = ID2SYM(rb_intern("size"));
- sym_repeat = ID2SYM(rb_intern("repeat"));
- sym_obj = ID2SYM(rb_intern("obj"));
- sym_len = ID2SYM(rb_intern("len"));
- sym_readonly = ID2SYM(rb_intern("readonly"));
- sym_format = ID2SYM(rb_intern("format"));
- sym_item_size = ID2SYM(rb_intern("item_size"));
- sym_ndim = ID2SYM(rb_intern("ndim"));
- sym_shape = ID2SYM(rb_intern("shape"));
- sym_strides = ID2SYM(rb_intern("strides"));
- sym_sub_offsets = ID2SYM(rb_intern("sub_offsets"));
- sym_endianness = ID2SYM(rb_intern("endianness"));
- sym_little_endian = ID2SYM(rb_intern("little_endian"));
- sym_big_endian = ID2SYM(rb_intern("big_endian"));
+ id_str = rb_intern_const("__str__");
+ sym_format = ID2SYM(rb_intern_const("format"));
+ sym_native_size_p = ID2SYM(rb_intern_const("native_size_p"));
+ sym_offset = ID2SYM(rb_intern_const("offset"));
+ sym_size = ID2SYM(rb_intern_const("size"));
+ sym_repeat = ID2SYM(rb_intern_const("repeat"));
+ sym_obj = ID2SYM(rb_intern_const("obj"));
+ sym_len = ID2SYM(rb_intern_const("len"));
+ sym_readonly = ID2SYM(rb_intern_const("readonly"));
+ sym_format = ID2SYM(rb_intern_const("format"));
+ sym_item_size = ID2SYM(rb_intern_const("item_size"));
+ sym_ndim = ID2SYM(rb_intern_const("ndim"));
+ sym_shape = ID2SYM(rb_intern_const("shape"));
+ sym_strides = ID2SYM(rb_intern_const("strides"));
+ sym_sub_offsets = ID2SYM(rb_intern_const("sub_offsets"));
+ sym_endianness = ID2SYM(rb_intern_const("endianness"));
+ sym_little_endian = ID2SYM(rb_intern_const("little_endian"));
+ sym_big_endian = ID2SYM(rb_intern_const("big_endian"));
#ifdef WORDS_BIGENDIAN
- rb_const_set(mMemoryViewTestUtils, rb_intern("NATIVE_ENDIAN"), sym_big_endian);
+ rb_const_set(mMemoryViewTestUtils, rb_intern_const("NATIVE_ENDIAN"), sym_big_endian);
#else
- rb_const_set(mMemoryViewTestUtils, rb_intern("NATIVE_ENDIAN"), sym_little_endian);
+ rb_const_set(mMemoryViewTestUtils, rb_intern_const("NATIVE_ENDIAN"), sym_little_endian);
#endif
#define DEF_ALIGNMENT_CONST(type, TYPE) do { \
int alignment; \
STRUCT_ALIGNOF(type, alignment); \
- rb_const_set(mMemoryViewTestUtils, rb_intern(#TYPE "_ALIGNMENT"), INT2FIX(alignment)); \
+ rb_const_set(mMemoryViewTestUtils, rb_intern_const(#TYPE "_ALIGNMENT"), INT2FIX(alignment)); \
} while(0)
DEF_ALIGNMENT_CONST(short, SHORT);
diff --git a/ext/-test-/string/coderange.c b/ext/-test-/string/coderange.c
index 1342ce2..bc998ca 100644
--- a/ext/-test-/string/coderange.c
+++ b/ext/-test-/string/coderange.c
@@ -38,10 +38,10 @@ str_coderange_scan(VALUE str)
void
Init_string_coderange(VALUE klass)
{
- sym_7bit = ID2SYM(rb_intern("7bit"));
- sym_valid = ID2SYM(rb_intern("valid"));
- sym_unknown = ID2SYM(rb_intern("unknown"));
- sym_broken = ID2SYM(rb_intern("broken"));
+ sym_7bit = ID2SYM(rb_intern_const("7bit"));
+ sym_valid = ID2SYM(rb_intern_const("valid"));
+ sym_unknown = ID2SYM(rb_intern_const("unknown"));
+ sym_broken = ID2SYM(rb_intern_const("broken"));
rb_define_method(klass, "coderange", str_coderange, 0);
rb_define_method(klass, "coderange_scan", str_coderange_scan, 0);
}
diff --git a/ext/openssl/ossl_ts.c b/ext/openssl/ossl_ts.c
index 160ec0d..d3209c3 100644
--- a/ext/openssl/ossl_ts.c
+++ b/ext/openssl/ossl_ts.c
@@ -1247,24 +1247,24 @@ Init_ossl_ts(void)
* timestamp server rejects the message imprint algorithm used in the
* +Request+
*/
- sBAD_ALG = rb_intern("BAD_ALG");
+ sBAD_ALG = rb_intern_const("BAD_ALG");
/*
* Possible return value for +Response#failure_info+. Indicates that the
* timestamp server was not able to process the +Request+ properly.
*/
- sBAD_REQUEST = rb_intern("BAD_REQUEST");
+ sBAD_REQUEST = rb_intern_const("BAD_REQUEST");
/*
* Possible return value for +Response#failure_info+. Indicates that the
* timestamp server was not able to parse certain data in the +Request+.
*/
- sBAD_DATA_FORMAT = rb_intern("BAD_DATA_FORMAT");
+ sBAD_DATA_FORMAT = rb_intern_const("BAD_DATA_FORMAT");
- sTIME_NOT_AVAILABLE = rb_intern("TIME_NOT_AVAILABLE");
- sUNACCEPTED_POLICY = rb_intern("UNACCEPTED_POLICY");
- sUNACCEPTED_EXTENSION = rb_intern("UNACCEPTED_EXTENSION");
- sADD_INFO_NOT_AVAILABLE = rb_intern("ADD_INFO_NOT_AVAILABLE");
- sSYSTEM_FAILURE = rb_intern("SYSTEM_FAILURE");
+ sTIME_NOT_AVAILABLE = rb_intern_const("TIME_NOT_AVAILABLE");
+ sUNACCEPTED_POLICY = rb_intern_const("UNACCEPTED_POLICY");
+ sUNACCEPTED_EXTENSION = rb_intern_const("UNACCEPTED_EXTENSION");
+ sADD_INFO_NOT_AVAILABLE = rb_intern_const("ADD_INFO_NOT_AVAILABLE");
+ sSYSTEM_FAILURE = rb_intern_const("SYSTEM_FAILURE");
/* Document-class: OpenSSL::Timestamp
* Provides classes and methods to request, create and validate
@@ -1503,11 +1503,11 @@ Init_ossl_ts(void)
*
*/
cTimestampFactory = rb_define_class_under(mTimestamp, "Factory", rb_cObject);
- rb_attr(cTimestampFactory, rb_intern("allowed_digests"), 1, 1, 0);
- rb_attr(cTimestampFactory, rb_intern("default_policy_id"), 1, 1, 0);
- rb_attr(cTimestampFactory, rb_intern("serial_number"), 1, 1, 0);
- rb_attr(cTimestampFactory, rb_intern("gen_time"), 1, 1, 0);
- rb_attr(cTimestampFactory, rb_intern("additional_certs"), 1, 1, 0);
+ rb_attr(cTimestampFactory, rb_intern_const("allowed_digests"), 1, 1, 0);
+ rb_attr(cTimestampFactory, rb_intern_const("default_policy_id"), 1, 1, 0);
+ rb_attr(cTimestampFactory, rb_intern_const("serial_number"), 1, 1, 0);
+ rb_attr(cTimestampFactory, rb_intern_const("gen_time"), 1, 1, 0);
+ rb_attr(cTimestampFactory, rb_intern_const("additional_certs"), 1, 1, 0);
rb_define_method(cTimestampFactory, "create_timestamp", ossl_tsfac_create_ts, 3);
}
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index 487784a..8fa1069 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -820,7 +820,7 @@ void
Init_cparse(void)
{
VALUE Racc, Parser;
- ID id_racc = rb_intern("Racc");
+ ID id_racc = rb_intern_const("Racc");
if (rb_const_defined(rb_cObject, id_racc)) {
Racc = rb_const_get(rb_cObject, id_racc);