ruby-changes:12293
From: ko1 <ko1@a...>
Date: Wed, 8 Jul 2009 05:33:30 +0900 (JST)
Subject: [ruby-changes:12293] Ruby:r23987 (trunk): * include/ruby/ruby.h:
ko1 2009-07-08 05:28:27 +0900 (Wed, 08 Jul 2009) New Revision: 23987 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23987 Log: * include/ruby/ruby.h: rename "...TypeStruct" and "typed_struct" to "TypedData..." and "typeddata", respectively. rename rb_data_type_t#name to rb_data_type_t#wrap_struct_name. * error.c, gc.c, iseq.c, vm.c: ditto. Modified files: trunk/ChangeLog trunk/error.c trunk/gc.c trunk/include/ruby/ruby.h trunk/iseq.c trunk/version.h trunk/vm.c Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 23986) +++ include/ruby/ruby.h (revision 23987) @@ -737,7 +737,7 @@ }; typedef struct rb_data_type_struct { - const char *name; + const char *wrap_struct_name; void (*dmark)(void*); void (*dfree)(void*); size_t (*dsize)(void *); @@ -764,9 +764,9 @@ VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC); VALUE rb_data_typed_object_alloc(VALUE klass, void *datap, const rb_data_type_t *); -int rb_typed_struct_is_kind_of(VALUE, const rb_data_type_t *); -void *rb_check_typed_struct(VALUE, const rb_data_type_t *); -#define Check_TypedStruct(v,t) rb_check_typed_struct((VALUE)(v),t) +int rb_typeddata_is_kind_of(VALUE, const rb_data_type_t *); +void *rb_check_typeddata(VALUE, const rb_data_type_t *); +#define Check_TypedStruct(v,t) rb_check_typeddata((VALUE)(v),t) #define RUBY_TYPED_DEFAULT_FREE ((void (*)(void *))-1) #define Data_Wrap_Struct(klass,mark,free,sval)\ @@ -778,13 +778,13 @@ Data_Wrap_Struct(klass,mark,free,sval)\ ) -#define Data_Wrap_TypedStruct(klass,data_type,sval)\ +#define TypedData_Wrap_Struct(klass,data_type,sval)\ rb_data_typed_object_alloc(klass,sval,data_type) -#define Data_Make_TypedStruct(klass, type, data_type, sval) (\ +#define TypedData_Make_Struct(klass, type, data_type, sval) (\ sval = ALLOC(type),\ memset(sval, 0, sizeof(type)),\ - Data_Wrap_TypedStruct(klass,data_type,sval)\ + TypedData_Wrap_Struct(klass,data_type,sval)\ ) #define Data_Get_Struct(obj,type,sval) do {\ @@ -792,8 +792,8 @@ sval = (type*)DATA_PTR(obj);\ } while (0) -#define Data_Get_TypedStruct(obj,type,data_type,sval) do {\ - sval = (type*)rb_check_typed_struct(obj, data_type); \ +#define TypedData_Get_Struct(obj,type,data_type,sval) do {\ + sval = (type*)rb_check_typeddata(obj, data_type); \ } while (0) #define RSTRUCT_EMBED_LEN_MAX 3 Index: ChangeLog =================================================================== --- ChangeLog (revision 23986) +++ ChangeLog (revision 23987) @@ -1,3 +1,15 @@ +Wed Jul 8 04:28:16 2009 Koichi Sasada <ko1@a...> + + * include/ruby/ruby.h: + rename + "...TypeStruct" and "typed_struct" to + "TypedData..." and "typeddata", respectively. + rename + rb_data_type_t#name to + rb_data_type_t#wrap_struct_name. + + * error.c, gc.c, iseq.c, vm.c: ditto. + Tue Jul 7 20:23:27 2009 Keiju Ishitsuka <keiju@r...> * bin/irb, lib/irb.rb lib/irb/*: irb-0.9.6, extend inspect-mode Index: iseq.c =================================================================== --- iseq.c (revision 23986) +++ iseq.c (revision 23987) @@ -157,7 +157,7 @@ iseq_alloc(VALUE klass) { rb_iseq_t *iseq; - return Data_Make_TypedStruct(klass, rb_iseq_t, &iseq_data_type, iseq); + return TypedData_Make_Struct(klass, rb_iseq_t, &iseq_data_type, iseq); } static void Index: gc.c =================================================================== --- gc.c (revision 23986) +++ gc.c (revision 23987) @@ -1206,7 +1206,7 @@ rb_objspace_data_type_name(VALUE obj) { if (RTYPEDDATA_P(obj)) { - return RTYPEDDATA_TYPE(obj)->name; + return RTYPEDDATA_TYPE(obj)->wrap_struct_name; } else { return 0; Index: error.c =================================================================== --- error.c (revision 23986) +++ error.c (revision 23987) @@ -317,7 +317,7 @@ } int -rb_typed_struct_is_kind_of(VALUE obj, const rb_data_type_t *data_type) +rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type) { if (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA || !RTYPEDDATA_P(obj) || RTYPEDDATA_TYPE(obj) != data_type) { @@ -327,7 +327,7 @@ } void * -rb_check_typed_struct(VALUE obj, const rb_data_type_t *data_type) +rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type) { const char *etype; static const char mesg[] = "wrong argument type %s (expected %s)"; @@ -337,11 +337,11 @@ } if (!RTYPEDDATA_P(obj)) { etype = rb_obj_classname(obj); - rb_raise(rb_eTypeError, mesg, etype, data_type->name); + rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name); } else if (RTYPEDDATA_TYPE(obj) != data_type) { - etype = RTYPEDDATA_TYPE(obj)->name; - rb_raise(rb_eTypeError, mesg, etype, data_type->name); + etype = RTYPEDDATA_TYPE(obj)->wrap_struct_name; + rb_raise(rb_eTypeError, mesg, etype, data_type->wrap_struct_name); } return DATA_PTR(obj); } Index: vm.c =================================================================== --- vm.c (revision 23986) +++ vm.c (revision 23987) @@ -248,7 +248,7 @@ { VALUE obj; rb_env_t *env; - obj = Data_Make_TypedStruct(rb_cEnv, rb_env_t, &env_data_type, env); + obj = TypedData_Make_Struct(rb_cEnv, rb_env_t, &env_data_type, env); env->env = 0; env->prev_envval = 0; env->block.iseq = 0; @@ -1675,10 +1675,10 @@ VALUE volatile obj; #ifdef USE_THREAD_RECYCLE rb_thread_t *th = thread_recycle_struct(); - obj = Data_Wrap_TypedStruct(klass, &thread_data_type, th); + obj = TypedData_Wrap_Struct(klass, &thread_data_type, th); #else rb_thread_t *th; - obj = Data_Make_TypedStruct(klass, rb_thread_t, &thread_data_type, th); + obj = TypedData_Make_Struct(klass, rb_thread_t, &thread_data_type, th); #endif return obj; } @@ -1979,10 +1979,10 @@ rb_iseq_t *iseq; /* create vm object */ - vm->self = Data_Wrap_TypedStruct(rb_cRubyVM, &vm_data_type, vm); + vm->self = TypedData_Wrap_Struct(rb_cRubyVM, &vm_data_type, vm); /* create main thread */ - th_self = th->self = Data_Wrap_TypedStruct(rb_cThread, &thread_data_type, th); + th_self = th->self = TypedData_Wrap_Struct(rb_cThread, &thread_data_type, th); vm->main_thread = th; vm->running_thread = th; th->vm = vm; Index: version.h =================================================================== --- version.h (revision 23986) +++ version.h (revision 23987) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_RELEASE_DATE "2009-07-07" +#define RUBY_RELEASE_DATE "2009-07-08" #define RUBY_PATCHLEVEL -1 #define RUBY_BRANCH_NAME "trunk" @@ -8,7 +8,7 @@ #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 7 +#define RUBY_RELEASE_DAY 8 #include "ruby/version.h" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/