[前][次][番号順一覧][スレッド一覧]

ruby-changes:42879

From: naruse <ko1@a...>
Date: Mon, 9 May 2016 01:48:17 +0900 (JST)
Subject: [ruby-changes:42879] naruse:r54952 (trunk): * configure.in: check function attirbute const and pure,

naruse	2016-05-09 02:44:51 +0900 (Mon, 09 May 2016)

  New Revision: 54952

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54952

  Log:
    * configure.in: check function attirbute const and pure,
      and define CONSTFUNC and PUREFUNC if available.
      Note that I don't add those options as default because
      it still shows many false-positive (it seems not to consider
      longjmp).
    
    * vm_eval.c (stack_check): get rb_thread_t* as an argument
      to avoid duplicate call of GET_THREAD().

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/eval_intern.h
    trunk/gc.c
    trunk/include/ruby/encoding.h
    trunk/include/ruby/intern.h
    trunk/include/ruby/io.h
    trunk/include/ruby/oniguruma.h
    trunk/include/ruby/ruby.h
    trunk/include/ruby/st.h
    trunk/insns.def
    trunk/internal.h
    trunk/process.c
    trunk/regenc.h
    trunk/st.c
    trunk/string.c
    trunk/vm.c
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
Index: gc.c
===================================================================
--- gc.c	(revision 54951)
+++ gc.c	(revision 54952)
@@ -2033,6 +2033,7 @@ rb_objspace_data_type_name(VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L2033
     }
 }
 
+PUREFUNC(static inline int is_pointer_to_heap(rb_objspace_t *objspace, void *ptr);)
 static inline int
 is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
 {
@@ -2900,6 +2901,7 @@ rb_objspace_call_finalizer(rb_objspace_t https://github.com/ruby/ruby/blob/trunk/gc.c#L2901
     ATOMIC_SET(finalizing, 0);
 }
 
+PUREFUNC(static inline int is_id_value(rb_objspace_t *objspace, VALUE ptr));
 static inline int
 is_id_value(rb_objspace_t *objspace, VALUE ptr)
 {
Index: vm.c
===================================================================
--- vm.c	(revision 54951)
+++ vm.c	(revision 54952)
@@ -25,6 +25,7 @@ https://github.com/ruby/ruby/blob/trunk/vm.c#L25
 
 VALUE rb_str_concat_literals(size_t, const VALUE*);
 
+PUREFUNC(static inline VALUE *VM_EP_LEP(VALUE *));
 static inline VALUE *
 VM_EP_LEP(VALUE *ep)
 {
@@ -60,6 +61,7 @@ rb_vm_ep_local_ep(VALUE *ep) https://github.com/ruby/ruby/blob/trunk/vm.c#L61
     return VM_EP_LEP(ep);
 }
 
+PUREFUNC(static inline VALUE *VM_CF_LEP(const rb_control_frame_t * const cfp));
 static inline VALUE *
 VM_CF_LEP(const rb_control_frame_t * const cfp)
 {
@@ -72,6 +74,7 @@ VM_CF_PREV_EP(const rb_control_frame_t * https://github.com/ruby/ruby/blob/trunk/vm.c#L74
     return VM_EP_PREV_EP(cfp->ep);
 }
 
+PUREFUNC(static inline rb_block_t *VM_CF_BLOCK_PTR(const rb_control_frame_t * const cfp));
 static inline rb_block_t *
 VM_CF_BLOCK_PTR(const rb_control_frame_t * const cfp)
 {
Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 54951)
+++ eval_intern.h	(revision 54952)
@@ -278,7 +278,6 @@ rb_cref_t *rb_vm_cref_replace_with_dupli https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L278
 VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
 void rb_vm_set_progname(VALUE filename);
 void rb_thread_terminate_all(void);
-VALUE rb_vm_top_self();
 VALUE rb_vm_cbase(void);
 
 #ifndef CharNext		/* defined as CharNext[AW] on Windows. */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54951)
+++ ChangeLog	(revision 54952)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon May  9 02:39:16 2016  NARUSE, Yui  <naruse@r...>
+
+	* configure.in: check function attirbute const and pure,
+	  and define CONSTFUNC and PUREFUNC if available.
+	  Note that I don't add those options as default because
+	  it still shows many false-positive (it seems not to consider
+	  longjmp).
+
+	* vm_eval.c (stack_check): get rb_thread_t* as an argument
+	  to avoid duplicate call of GET_THREAD().
+
 Sun May  8 21:01:14 2016  NARUSE, Yui  <naruse@r...>
 
 	* ext/openssl/extconf.rb: assume it doesn't have SSLv2 related
Index: insns.def
===================================================================
--- insns.def	(revision 54951)
+++ insns.def	(revision 54952)
@@ -2088,8 +2088,6 @@ opt_not https://github.com/ruby/ruby/blob/trunk/insns.def#L2088
 (VALUE recv)
 (VALUE val)
 {
-    extern VALUE rb_obj_not(VALUE obj);
-
     vm_search_method(ci, cc, recv);
 
     if (check_cfunc(cc->me, rb_obj_not)) {
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 54951)
+++ vm_insnhelper.c	(revision 54952)
@@ -374,6 +374,7 @@ vm_getspecial(rb_thread_t *th, VALUE *le https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L374
     return val;
 }
 
+PUREFUNC(static rb_callable_method_entry_t *check_method_entry(VALUE obj, int can_be_svar));
 static rb_callable_method_entry_t *
 check_method_entry(VALUE obj, int can_be_svar)
 {
@@ -425,6 +426,9 @@ method_entry_cref(rb_callable_method_ent https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L426
     }
 }
 
+#if VM_CHECK_MODE == 0
+PUREFUNC(static rb_cref_t *check_cref(VALUE, int));
+#endif
 static rb_cref_t *
 check_cref(VALUE obj, int can_be_svar)
 {
@@ -1925,6 +1929,7 @@ find_refinement(VALUE refinements, VALUE https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1929
     return rb_hash_lookup(refinements, klass);
 }
 
+PUREFUNC(static rb_control_frame_t * current_method_entry(rb_thread_t *th, rb_control_frame_t *cfp));
 static rb_control_frame_t *
 current_method_entry(rb_thread_t *th, rb_control_frame_t *cfp)
 {
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 54951)
+++ vm_eval.c	(revision 54952)
@@ -303,10 +303,8 @@ rb_current_receiver(void) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L303
 }
 
 static inline void
-stack_check(void)
+stack_check(rb_thread_t *th)
 {
-    rb_thread_t *th = GET_THREAD();
-
     if (!rb_thread_raised_p(th, RAISED_STACKOVERFLOW) && ruby_stack_check()) {
 	rb_thread_raised_set(th, RAISED_STACKOVERFLOW);
 	rb_exc_raise(sysstack_error);
@@ -342,7 +340,7 @@ rb_call0(VALUE recv, ID mid, int argc, c https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L340
     if (call_status != MISSING_NONE) {
 	return method_missing(recv, mid, argc, argv, call_status);
     }
-    stack_check();
+    stack_check(th);
     return vm_call0(th, recv, mid, argc, argv, me);
 }
 
@@ -460,7 +458,7 @@ rb_check_funcall_default(VALUE recv, ID https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L458
 	return check_funcall_missing(th, klass, recv, mid, argc, argv,
 				     respond, def);
     }
-    stack_check();
+    stack_check(th);
     return vm_call0(th, recv, mid, argc, argv, me);
 }
 
@@ -485,7 +483,7 @@ rb_check_funcall_with_hook(VALUE recv, I https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L483
 	(*hook)(ret != Qundef, recv, mid, argc, argv, arg);
 	return ret;
     }
-    stack_check();
+    stack_check(th);
     (*hook)(TRUE, recv, mid, argc, argv, arg);
     return vm_call0(th, recv, mid, argc, argv, me);
 }
@@ -718,7 +716,7 @@ raise_method_missing(rb_thread_t *th, in https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L716
 		 rb_obj_class(argv[0]));
     }
 
-    stack_check();
+    stack_check(th);
 
     if (last_call_status & MISSING_PRIVATE) {
 	format = rb_fstring_cstr("private method `%s' called for %s%s%s");
Index: configure.in
===================================================================
--- configure.in	(revision 54951)
+++ configure.in	(revision 54952)
@@ -1800,6 +1800,8 @@ AC_DEFUN([RUBY_TYPE_ATTRIBUTE], [dnl https://github.com/ruby/ruby/blob/trunk/configure.in#L1800
 ])
 ])
 
+RUBY_FUNC_ATTRIBUTE(const, CONSTFUNC)
+RUBY_FUNC_ATTRIBUTE(pure, PUREFUNC)
 RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
 RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
 RUBY_FUNC_ATTRIBUTE(deprecated("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by)
Index: regenc.h
===================================================================
--- regenc.h	(revision 54951)
+++ regenc.h	(revision 54952)
@@ -129,30 +129,30 @@ ONIG_EXTERN int onigenc_ascii_apply_all_ https://github.com/ruby/ruby/blob/trunk/regenc.h#L129
 ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_((OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[], OnigEncoding enc));
 ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
 ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_((int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
-ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc));
-ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end, OnigEncoding enc));
+CONSTFUNC(ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], OnigEncoding enc)));
+PUREFUNC(ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_((const UChar* p, const UChar* end, OnigEncoding enc)));
 
 
 /* methods for single byte encoding */
 ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_((OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower, OnigEncoding enc));
-ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p, const UChar* e, OnigEncoding enc));
-ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+CONSTFUNC(ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_((const UChar* p, const UChar* e, OnigEncoding enc)));
+PUREFUNC(ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_((const UChar* p, const UChar* end, OnigEncoding enc)));
+CONSTFUNC(ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc)));
 ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_((OnigCodePoint code, UChar *buf, OnigEncoding enc));
-ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc));
-ONIG_EXTERN int onigenc_ascii_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc));
+CONSTFUNC(ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_((const UChar* start, const UChar* s, const OnigUChar* end, OnigEncoding enc)));
+CONSTFUNC(ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc)));
+CONSTFUNC(ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_((const UChar* s, const UChar* end, OnigEncoding enc)));
+CONSTFUNC(ONIG_EXTERN int onigenc_ascii_is_code_ctype P_((OnigCodePoint code, unsigned int ctype, OnigEncoding enc)));
 
 /* methods for multi byte encoding */
 ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UChar* p, const UChar* end));
 ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
-ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+CONSTFUNC(ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc)));
 ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
 ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, const UChar* p, const UChar* end));
 ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, const UChar* p, const UChar* end));
 ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
-ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
+CONSTFUNC(ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc)));
 ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
 ONIG_EXTERN int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
 
Index: internal.h
===================================================================
--- internal.h	(revision 54951)
+++ internal.h	(revision 54952)
@@ -892,7 +892,7 @@ VALUE rb_invcmp(VALUE, VALUE); https://github.com/ruby/ruby/blob/trunk/internal.h#L892
 struct rb_block_struct;
 int rb_dvar_defined(ID, const struct rb_block_struct *);
 int rb_local_defined(ID, const struct rb_block_struct *);
-const char * rb_insns_name(int i);
+CONSTFUNC(const char * rb_insns_name(int i));
 VALUE rb_insns_name_array(void);
 
 /* complex.c */
@@ -913,7 +913,7 @@ void Init_ext(void); https://github.com/ruby/ruby/blob/trunk/internal.h#L913
 
 /* encoding.c */
 ID rb_id_encoding(void);
-void rb_gc_mark_encodings(void);
+CONSTFUNC(void rb_gc_mark_encodings(void));
 rb_encoding *rb_enc_get_from_index(int index);
 rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2);
 int rb_encdb_replicate(const char *alias, const char *orig);
@@ -923,7 +923,7 @@ void rb_encdb_declare(const char *name); https://github.com/ruby/ruby/blob/trunk/internal.h#L923
 void rb_enc_set_base(const char *name, const char *orig);
 int rb_enc_set_dummy(int index);
 void rb_encdb_set_unicode(int index);
-int rb_data_is_encoding(VALUE obj);
+PUREFUNC(int rb_data_is_encoding(VALUE obj));
 
 /* enum.c */
 VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
@@ -1180,7 +1180,8 @@ rb_float_new_inline(double d) https://github.com/ruby/ruby/blob/trunk/internal.h#L1180
 
 /* object.c */
 void rb_obj_copy_ivar(VALUE dest, VALUE obj);
-VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
+CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2));
+CONSTFUNC(VALUE rb_obj_not(VALUE obj));
 VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
 NORETURN(void rb_undefined_alloc(VALUE klass));
 double rb_num_to_dbl(VALUE val);
@@ -1214,14 +1215,14 @@ int rb_is_attrset_name(VALUE name); https://github.com/ruby/ruby/blob/trunk/internal.h#L1215
 int rb_is_local_name(VALUE name);
 int rb_is_method_name(VALUE name);
 int rb_is_junk_name(VALUE name);
-int rb_is_const_sym(VALUE sym);
-int rb_is_class_sym(VALUE sym);
-int rb_is_global_sym(VALUE sym);
-int rb_is_instance_sym(VALUE sym);
-int rb_is_attrset_sym(VALUE sym);
-int rb_is_local_sym(VALUE sym);
-int rb_is_method_sym(VALUE sym);
-int rb_is_junk_sym(VALUE sym);
+PUREFUNC(int rb_is_const_sym(VALUE sym));
+PUREFUNC(int rb_is_class_sym(VALUE sym));
+PUREFUNC(int rb_is_global_sym(VALUE sym));
+PUREFUNC(int rb_is_instance_sym(VALUE sym));
+PUREFUNC(int rb_is_attrset_sym(VALUE sym));
+PUREFUNC(int rb_is_local_sym(VALUE sym));
+PUREFUNC(int rb_is_method_sym(VALUE sym));
+PUREFUNC(int rb_is_junk_sym(VALUE sym));
 ID rb_make_internal_id(void);
 void rb_gc_free_dsymbol(VALUE);
 ID rb_id_attrget(ID id);
@@ -1451,7 +1452,7 @@ VALUE rb_obj_is_thread(VALUE obj); https://github.com/ruby/ruby/blob/trunk/internal.h#L1452
 void rb_vm_mark(void *ptr);
 void Init_BareVM(void);
 void Init_vm_objects(void);
-VALUE rb_vm_top_self(void);
+PUREFUNC(VALUE rb_vm_top_self(void););
 void rb_thread_recycle_stack_release(VALUE *);
 void rb_vm_change_state(void);
 void rb_vm_inc_const_missing_count(void);
@@ -1465,6 +1466,8 @@ int rb_vm_add_root_module(ID id, VALUE m https://github.com/ruby/ruby/blob/trunk/internal.h#L1466
 void rb_vm_check_redefinition_by_prepend(VALUE klass);
 VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
 VALUE ruby_vm_sysstack_error_copy(void);
+PUREFUNC(st_table *rb_vm_fstring_table(void));
+
 
 /* vm_dump.c */
 void rb_print_backtrace(void);
Index: string.c
===================================================================
--- string.c	(revision 54951)
+++ string.c	(revision 54952)
@@ -233,8 +233,6 @@ static int fstring_cmp(VALUE a, VALUE b) https://github.com/ruby/ruby/blob/trunk/string.c#L233
 
 static VALUE register_fstring(VALUE str);
 
-st_table *rb_vm_fstring_table(void);
-
 const struct st_hash_type rb_fstring_hash_type = {
     fstring_cmp,
     rb_str_hash,
Index: process.c
===================================================================
--- process.c	(revision 54951)
+++ process.c	(revision 54952)
@@ -6921,6 +6921,7 @@ typedef long timetick_int_t; https://github.com/ruby/ruby/blob/trunk/process.c#L6921
 #define TIMETICK_INT2NUM(v) LONG2NUM(v)
 #endif
 
+CONSTFUNC(static timetick_int_t gcd_timetick_int(timetick_int_t, timetick_int_t));
 static timetick_int_t
 gcd_timetick_int(timetick_int_t a, timetick_int_t b)
 {
Index: st.c
===================================================================
--- st.c	(revision 54951)
+++ st.c	(revision 54952)
@@ -1683,6 +1683,7 @@ st_locale_insensitive_strncasecmp(const https://github.com/ruby/ruby/blob/trunk/st.c#L1683
     return 0;
 }
 
+PUREFUNC(static st_index_t strcasehash(st_data_t));
 static st_index_t
 strcasehash(st_data_t arg)
 {
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 54951)
+++ include/ruby/ruby.h	(revision 54952)
@@ -624,7 +624,7 @@ int rb_safe_level(void); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L624
 void rb_set_safe_level(int);
 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 int ruby_safe_level_2_error(void) __attribute__((error("$SAFE=2 to 4 are obsolete")));
-int ruby_safe_level_2_warning(void) __attribute__((warning("$SAFE=2 to 4 are obsolete")));
+int ruby_safe_level_2_warning(void) __attribute__((const,warning("$SAFE=2 to 4 are obsolete")));
 # ifdef RUBY_EXPORT
 #   define ruby_safe_level_2_warning() ruby_safe_level_2_error()
 # endif
@@ -650,7 +650,7 @@ int ruby_safe_level_2_warning(void) __at https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L650
 #define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error))
 #endif
 void rb_set_safe_level_force(int);
-void rb_secure_update(VALUE);
+CONSTFUNC(void rb_secure_update(VALUE));
 NORETURN(void rb_insecure_operation(void));
 
 VALUE rb_errinfo(void);
@@ -952,7 +952,7 @@ enum { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L952
     RMODULE_ENUM_END
 };
 
-double rb_float_value(VALUE);
+PUREFUNC(double rb_float_value(VALUE));
 VALUE rb_float_new(double);
 VALUE rb_float_new_in_heap(double);
 
Index: include/ruby/encoding.h
===================================================================
--- include/ruby/encoding.h	(revision 54951)
+++ include/ruby/encoding.h	(revision 54952)
@@ -113,8 +113,8 @@ int rb_char_to_option_kcode(int c, int * https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L113
 
 int rb_enc_replicate(const char *, rb_encoding *);
 int rb_define_dummy_encoding(const char *);
-int rb_enc_dummy_p(rb_encoding *enc);
-int rb_enc_to_index(rb_encoding *enc);
+PUREFUNC(int rb_enc_dummy_p(rb_encoding *enc));
+PUREFUNC(int rb_enc_to_index(rb_encoding *enc));
 int rb_enc_get_index(VALUE obj);
 void rb_enc_set_index(VALUE obj, int encindex);
 int rb_enc_find_index(const char *name);
@@ -240,8 +240,8 @@ rb_enc_asciicompat_inline(rb_encoding *e https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L240
 #define rb_enc_asciicompat(enc) rb_enc_asciicompat_inline(enc)
 
 int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
-int rb_enc_toupper(int c, rb_encoding *enc);
-int rb_enc_tolower(int c, rb_encoding *enc);
+CONSTFUNC(int rb_enc_toupper(int c, rb_encoding *enc));
+CONSTFUNC(int rb_enc_tolower(int c, rb_encoding *enc));
 ID rb_intern3(const char*, long, rb_encoding*);
 ID rb_interned_id_p(const char *, long, rb_encoding *);
 int rb_enc_symname_p(const char*, rb_encoding*);
@@ -251,7 +251,7 @@ long rb_str_coderange_scan_restartable(c https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L251
 int rb_enc_str_asciionly_p(VALUE);
 #define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
 VALUE rb_enc_from_encoding(rb_encoding *enc);
-int rb_enc_unicode_p(rb_encoding *enc);
+PUREFUNC(int rb_enc_unicode_p(rb_encoding *enc));
 rb_encoding *rb_ascii8bit_encoding(void);
 rb_encoding *rb_utf8_encoding(void);
 rb_encoding *rb_usascii_encoding(void);
@@ -260,13 +260,13 @@ rb_encoding *rb_filesystem_encoding(void https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L260
 rb_encoding *rb_default_external_encoding(void);
 rb_encoding *rb_default_internal_encoding(void);
 #ifndef rb_ascii8bit_encindex
-int rb_ascii8bit_encindex(void);
+CONSTFUNC(int rb_ascii8bit_ (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]