Skip to content

Commit 9e4d470

Browse files
nobuhsbt
authored andcommitted
Use rb_intern_const instead of rb_intern in Init functions
``` find . -name \*.o -exec nm {} + |& sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' | uniq ``` should be empty.
1 parent 0330483 commit 9e4d470

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

ext/openssl/ossl_ts.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,24 +1247,24 @@ Init_ossl_ts(void)
12471247
* timestamp server rejects the message imprint algorithm used in the
12481248
* +Request+
12491249
*/
1250-
sBAD_ALG = rb_intern("BAD_ALG");
1250+
sBAD_ALG = rb_intern_const("BAD_ALG");
12511251

12521252
/*
12531253
* Possible return value for +Response#failure_info+. Indicates that the
12541254
* timestamp server was not able to process the +Request+ properly.
12551255
*/
1256-
sBAD_REQUEST = rb_intern("BAD_REQUEST");
1256+
sBAD_REQUEST = rb_intern_const("BAD_REQUEST");
12571257
/*
12581258
* Possible return value for +Response#failure_info+. Indicates that the
12591259
* timestamp server was not able to parse certain data in the +Request+.
12601260
*/
1261-
sBAD_DATA_FORMAT = rb_intern("BAD_DATA_FORMAT");
1261+
sBAD_DATA_FORMAT = rb_intern_const("BAD_DATA_FORMAT");
12621262

1263-
sTIME_NOT_AVAILABLE = rb_intern("TIME_NOT_AVAILABLE");
1264-
sUNACCEPTED_POLICY = rb_intern("UNACCEPTED_POLICY");
1265-
sUNACCEPTED_EXTENSION = rb_intern("UNACCEPTED_EXTENSION");
1266-
sADD_INFO_NOT_AVAILABLE = rb_intern("ADD_INFO_NOT_AVAILABLE");
1267-
sSYSTEM_FAILURE = rb_intern("SYSTEM_FAILURE");
1263+
sTIME_NOT_AVAILABLE = rb_intern_const("TIME_NOT_AVAILABLE");
1264+
sUNACCEPTED_POLICY = rb_intern_const("UNACCEPTED_POLICY");
1265+
sUNACCEPTED_EXTENSION = rb_intern_const("UNACCEPTED_EXTENSION");
1266+
sADD_INFO_NOT_AVAILABLE = rb_intern_const("ADD_INFO_NOT_AVAILABLE");
1267+
sSYSTEM_FAILURE = rb_intern_const("SYSTEM_FAILURE");
12681268

12691269
/* Document-class: OpenSSL::Timestamp
12701270
* Provides classes and methods to request, create and validate
@@ -1503,11 +1503,11 @@ Init_ossl_ts(void)
15031503
*
15041504
*/
15051505
cTimestampFactory = rb_define_class_under(mTimestamp, "Factory", rb_cObject);
1506-
rb_attr(cTimestampFactory, rb_intern("allowed_digests"), 1, 1, 0);
1507-
rb_attr(cTimestampFactory, rb_intern("default_policy_id"), 1, 1, 0);
1508-
rb_attr(cTimestampFactory, rb_intern("serial_number"), 1, 1, 0);
1509-
rb_attr(cTimestampFactory, rb_intern("gen_time"), 1, 1, 0);
1510-
rb_attr(cTimestampFactory, rb_intern("additional_certs"), 1, 1, 0);
1506+
rb_attr(cTimestampFactory, rb_intern_const("allowed_digests"), 1, 1, 0);
1507+
rb_attr(cTimestampFactory, rb_intern_const("default_policy_id"), 1, 1, 0);
1508+
rb_attr(cTimestampFactory, rb_intern_const("serial_number"), 1, 1, 0);
1509+
rb_attr(cTimestampFactory, rb_intern_const("gen_time"), 1, 1, 0);
1510+
rb_attr(cTimestampFactory, rb_intern_const("additional_certs"), 1, 1, 0);
15111511
rb_define_method(cTimestampFactory, "create_timestamp", ossl_tsfac_create_ts, 3);
15121512
}
15131513

0 commit comments

Comments
 (0)