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

ruby-changes:5033

From: usa <ko1@a...>
Date: Thu, 22 May 2008 15:23:01 +0900 (JST)
Subject: [ruby-changes:5033] usa - Ruby:r16526 (trunk): * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h,

usa	2008-05-22 15:22:41 +0900 (Thu, 22 May 2008)

  New Revision: 16526

  Modified files:
    trunk/ChangeLog
    trunk/eval_intern.h
    trunk/include/ruby/intern.h
    trunk/include/ruby/ruby.h
    trunk/vm.c
    trunk/vm_core.h

  Log:
    * eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h,
      vm.c: need to add const to prototypes, of course.
    


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/ruby.h?r1=16526&r2=16525&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16526&r2=16525&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/vm_core.h?r1=16526&r2=16525&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/vm.c?r1=16526&r2=16525&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/intern.h?r1=16526&r2=16525&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval_intern.h?r1=16526&r2=16525&diff_format=u

Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 16525)
+++ eval_intern.h	(revision 16526)
@@ -222,12 +222,12 @@
 
 NORETURN(void rb_raise_jump(VALUE));
 NORETURN(void rb_print_undef(VALUE, ID, int));
-NORETURN(void vm_localjump_error(const char *, VALUE, int));
-NORETURN(void vm_jump_tag_but_local_jump(int, VALUE));
+NORETURN(void vm_localjump_error(const char * const, const VALUE, const int));
+NORETURN(void vm_jump_tag_but_local_jump(const int, const VALUE));
 
-NODE *vm_cref_push(rb_thread_t *th, VALUE, int);
+NODE *vm_cref_push(rb_thread_t * const th, const VALUE, const int);
 NODE *vm_set_special_cref(rb_thread_t *th, VALUE *lfp, NODE * cref_stack);
-VALUE vm_make_jump_tag_but_local_jump(int state, VALUE val);
+VALUE vm_make_jump_tag_but_local_jump(const int state, VALUE val);
 
 NODE *ruby_cref(void);
 
@@ -244,10 +244,12 @@
 }
 
 VALUE rb_obj_is_proc(VALUE);
-void rb_vm_check_redefinition_opt_method(NODE *node);
-VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, rb_block_t *blockptr, VALUE filename);
+void rb_vm_check_redefinition_opt_method(NODE * const node);
+VALUE rb_vm_call_cfunc(const VALUE recv, VALUE (* const func)(VALUE),
+		       const VALUE arg, rb_block_t * const blockptr,
+		       const VALUE filename);
 void rb_thread_terminate_all(void);
-void rb_vm_set_eval_stack(rb_thread_t *, VALUE iseq, NODE *cref);
+void rb_vm_set_eval_stack(rb_thread_t * const, const VALUE iseq, NODE * const cref);
 VALUE rb_vm_top_self();
 VALUE rb_vm_cbase(void);
 
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 16525)
+++ include/ruby/intern.h	(revision 16526)
@@ -277,7 +277,7 @@
 VALUE rb_method_call(int, VALUE*, VALUE);
 int rb_mod_method_arity(VALUE, ID);
 int rb_obj_method_arity(VALUE, ID);
-VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
+VALUE rb_protect(VALUE (* const)(VALUE), const VALUE, int* const);
 void rb_set_end_proc(void (*)(VALUE), VALUE);
 void rb_mark_end_proc(void);
 void rb_exec_end_proc(void);
@@ -438,9 +438,9 @@
 int rb_sym_interned_p(VALUE);
 void rb_gc_mark_symbols(void);
 VALUE rb_backref_get(void);
-void rb_backref_set(VALUE);
+void rb_backref_set(const VALUE);
 VALUE rb_lastline_get(void);
-void rb_lastline_set(VALUE);
+void rb_lastline_set(const VALUE);
 VALUE rb_sym_all_symbols(void);
 /* process.c */
 void rb_last_status_set(int status, rb_pid_t pid);
@@ -662,7 +662,7 @@
 VALUE rb_time_succ(VALUE);
 void Init_stack(VALUE*);
 void rb_frame_pop(void);
-int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
+int rb_frame_method_id_and_class(ID * const idp, VALUE * const klassp);
 
 #if defined(__cplusplus)
 #if 0
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 16525)
+++ include/ruby/ruby.h	(revision 16526)
@@ -788,7 +788,7 @@
 VALUE rb_funcall2(VALUE, ID, int, const VALUE*);
 VALUE rb_funcall3(VALUE, ID, int, const VALUE*);
 int rb_scan_args(int, const VALUE*, const char*, ...);
-VALUE rb_call_super(int, const VALUE*);
+VALUE rb_call_super(const int, const VALUE* const);
 
 VALUE rb_gv_set(const char*, VALUE);
 VALUE rb_gv_get(const char*);
@@ -817,17 +817,17 @@
 
 typedef VALUE rb_block_call_func(VALUE, VALUE, int, VALUE*);
 
-VALUE rb_each(VALUE);
-VALUE rb_yield(VALUE);
-VALUE rb_yield_values(int n, ...);
-VALUE rb_yield_values2(int n, VALUE *argv);
-VALUE rb_yield_splat(VALUE);
+VALUE rb_each(const VALUE);
+VALUE rb_yield(const VALUE);
+VALUE rb_yield_values(const int n, ...);
+VALUE rb_yield_values2(const int n, VALUE * const argv);
+VALUE rb_yield_splat(const VALUE);
 int rb_block_given_p(void);
 void rb_need_block(void);
-VALUE rb_iterate(VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE);
-VALUE rb_block_call(VALUE,ID,int,VALUE*,VALUE(*)(ANYARGS),VALUE);
-VALUE rb_rescue(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
-VALUE rb_rescue2(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...);
+VALUE rb_iterate(VALUE(* const)(VALUE),const VALUE,VALUE(* const)(ANYARGS),const VALUE);
+VALUE rb_block_call(const VALUE,const ID,const int,VALUE* const,VALUE(* const)(ANYARGS),const VALUE);
+VALUE rb_rescue(VALUE(* const)(ANYARGS),const VALUE,VALUE(* const)(ANYARGS),const VALUE);
+VALUE rb_rescue2(VALUE(* const)(ANYARGS),const VALUE,VALUE(* const)(ANYARGS),VALUE,...);
 VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
 VALUE rb_catch(const char*,VALUE(*)(ANYARGS),VALUE);
 VALUE rb_catch_obj(VALUE,VALUE(*)(ANYARGS),VALUE);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16525)
+++ ChangeLog	(revision 16526)
@@ -1,3 +1,8 @@
+Thu May 22 15:20:20 2008  NAKAMURA Usaku  <usa@r...>
+
+	* eval_intern.h, vm_core.h, include/ruby/intern.h, include/ruby/ruby.h,
+	  vm.c: need to add const to prototypes, of course.
+
 Thu May 22 13:24:43 2008  Koichi Sasada  <ko1@a...>
 
 	* eval.c, vm.c, vm_core.h, vm_insnhelper.c: specify "const".
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 16525)
+++ vm_core.h	(revision 16526)
@@ -586,7 +586,7 @@
 
 /* VM related object allocate functions */
 /* TODO: should be static functions */
-VALUE rb_thread_alloc(VALUE klass);
+VALUE rb_thread_alloc(const VALUE klass);
 VALUE rb_proc_alloc(VALUE klass);
 
 /* for debug */
@@ -598,22 +598,28 @@
 
 /* functions about thread/vm execution */
 
-VALUE rb_iseq_eval(VALUE iseqval);
+VALUE rb_iseq_eval(const VALUE iseqval);
 void rb_enable_interrupt(void);
 void rb_disable_interrupt(void);
-int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp);
+int rb_thread_method_id_and_class(rb_thread_t * const th, ID * const idp,
+				  VALUE * const klassp);
 
-VALUE vm_eval_body(rb_thread_t *th);
-VALUE vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
-		     int argc, const VALUE *argv, rb_block_t *blockptr);
-VALUE vm_make_proc(rb_thread_t *th, rb_control_frame_t *cfp, rb_block_t *block);
-VALUE vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
-VALUE vm_backtrace(rb_thread_t *, int);
+VALUE vm_eval_body(rb_thread_t * const th);
+VALUE vm_invoke_proc(rb_thread_t *const th, rb_proc_t * const proc,
+		     const VALUE self, const int argc, const VALUE * const argv,
+		     rb_block_t * const blockptr);
+VALUE vm_make_proc(rb_thread_t * const th, rb_control_frame_t *const cfp,
+		   rb_block_t * const block);
+VALUE vm_make_env_object(rb_thread_t * const th, rb_control_frame_t *cfp);
+VALUE vm_backtrace(rb_thread_t * const, int);
 
-VALUE vm_yield(rb_thread_t *th, int argc, const VALUE *argv);
-VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, NODE *cref);
-VALUE vm_call0(rb_thread_t *th, VALUE klass, VALUE recv, VALUE id, ID oid,
-	       int argc, const VALUE *argv, NODE *body, int nosuper);
+VALUE vm_yield(rb_thread_t * const th, const int argc,
+	       const VALUE * const argv);
+VALUE vm_yield_with_cref(rb_thread_t * const th, const int argc,
+			 const VALUE * const argv, NODE * const cref);
+VALUE vm_call0(rb_thread_t * const th, const VALUE klass, const VALUE recv,
+	       const VALUE id, const ID oid, const int argc,
+	       const VALUE * const argv, NODE *const body, const int nosuper);
 
 int vm_get_sourceline(rb_control_frame_t *);
 
Index: vm.c
===================================================================
--- vm.c	(revision 16525)
+++ vm.c	(revision 16526)
@@ -150,7 +150,7 @@
     return obj;
 }
 
-static VALUE check_env_value(VALUE envval);
+static VALUE check_env_value(const VALUE envval);
 
 static int
 check_env(rb_env_t * const env)

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

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