From c15acbba04536b16937a51a07078abdb6e8172cc Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Mar 2016 07:33:21 +0000 Subject: [PATCH] extension*.rdoc: fix errors [ci skip] * extension.rdoc, extension.ja.rdoc: [DOC] Fix some errors. Renamed files, wrong method names or argument types; the example GetDBM macro is now updated to the current version of the actual code. patch by Marcus Stollsteimer in [ruby-core:74690]. [Bug #12228] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ doc/extension.ja.rdoc | 16 ++++++++-------- doc/extension.rdoc | 18 +++++++++--------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 621e79a48c..5481030c82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Mar 30 16:33:19 2016 Nobuyoshi Nakada + + * extension.rdoc, extension.ja.rdoc: [DOC] Fix some errors. + Renamed files, wrong method names or argument types; the example + GetDBM macro is now updated to the current version of the actual + code. patch by Marcus Stollsteimer in [ruby-core:74690]. + [Bug #12228] + Wed Mar 30 09:46:01 2016 SHIBATA Hiroshi * lib/open-uri.rb: Use `userinfo` for authenticated proxy. diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc index dfa526f2d4..b6b8623cda 100644 --- a/doc/extension.ja.rdoc +++ b/doc/extension.ja.rdoc @@ -275,7 +275,7 @@ rb_utf8_str_new_cstr(const char *ptr) :: エンコーディングがUTF-8のRubyの文字列を生成する. -rb_usascii_str_new_literal(const char *ptr) :: +rb_utf8_str_new_literal(const char *ptr) :: Cのリテラル文字列からエンコーディングがUTF-8のRubyの文字列を生成する. @@ -889,7 +889,7 @@ Dataオブジェクトからdbmstruct構造体のポインタを取り出すた に以下のマクロを使っています. #define GetDBM(obj, dbmp) do {\ - TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);\ + TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\ if ((dbmp) == 0) closed_dbm();\ if ((dbmp)->di_dbm == 0) closed_dbm();\ } while (0) @@ -1069,7 +1069,7 @@ variable.c :: 変数と定数 parse.y :: 字句解析器と構文定義 parse.c :: 自動生成 -keywords :: 予約語 +defs/keywords :: 予約語 lex.c :: 自動生成 == Rubyの評価器 (通称YARV) @@ -1091,12 +1091,12 @@ lex.c :: 自動生成 vm_insnhelper.c vm_method.c - opt_insns_unif.def : 命令融合 - opt_operand.def : 最適化のための定義 + defs/opt_insns_unif.def : 命令融合 + defs/opt_operand.def : 最適化のための定義 - -> insn*.inc : 自動生成 - -> opt*.inc : 自動生成 - -> vm.inc : 自動生成 + -> insn*.inc : 自動生成 + -> opt*.inc : 自動生成 + -> vm.inc : 自動生成 == 正規表現エンジン (鬼車) diff --git a/doc/extension.rdoc b/doc/extension.rdoc index ff1bc9664a..a76b975c77 100644 --- a/doc/extension.rdoc +++ b/doc/extension.rdoc @@ -642,14 +642,14 @@ with the next macro. TypedData_Wrap_Struct() returns a created Ruby object as a VALUE. The klass argument is the class for the object. -data_type is a pointer to a const ruby_data_type_t which describes +data_type is a pointer to a const rb_data_type_t which describes how Ruby should manage the struct. It is recommended that klass derives from a special class called Data (rb_cData) but not from Object or other ordinal classes. If it doesn't, you have to call rb_undef_alloc_func(klass). -ruby_data_type_t is defined like this. Let's take a look at each +rb_data_type_t is defined like this. Let's take a look at each member of the struct. struct rb_data_type_struct { @@ -825,9 +825,9 @@ To retrieve the dbmdata structure from a Ruby object, we define the following macro: #define GetDBM(obj, dbmp) do {\ - TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);\ + TypedData_Get_Struct((obj), struct dbmdata, &dbm_type, (dbmp));\ if ((dbmp) == 0) closed_dbm();\ - if (dbmp->di_dbm == 0) closed_dbm();\ + if ((dbmp)->di_dbm == 0) closed_dbm();\ } while (0) This sort of complicated macro does the retrieving and close checking @@ -1289,7 +1289,7 @@ void rb_define_readonly_variable(const char *name, VALUE *var) :: Defines a read-only global variable. Works just like rb_define_variable(), except the defined variable is read-only. -void rb_define_virtual_variable(const char *name, VALUE (*getter)(), VALUE (*setter)()) :: +void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) :: Defines a virtual variable, whose behavior is defined by a pair of C functions. The getter function is called when the variable is @@ -1301,7 +1301,7 @@ void rb_define_virtual_variable(const char *name, VALUE (*getter)(), VALUE (*set The getter function must return the value for the access. -void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), VALUE (*setter)()) :: +void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) :: Defines hooked variable. It's a virtual variable with a C variable. The getter is called as @@ -1327,7 +1327,7 @@ void rb_define_global_const(const char *name, VALUE val) :: Defines a global constant. This is just the same as - rb_define_const(cKernal, name, val) + rb_define_const(rb_cObject, name, val) == Method Definition @@ -1461,7 +1461,7 @@ char *rb_class2name(VALUE klass) :: Returns the name of the class. -int rb_respond_to(VALUE object, ID id) :: +int rb_respond_to(VALUE obj, ID id) :: Returns true if the object responds to the message specified by id. @@ -1489,7 +1489,7 @@ VALUE rb_block_call(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (A whereas yielded values can be gotten via argc/argv of the third/fourth arguments. -\[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), void *arg1, VALUE (*func2)(), void *arg2) :: +\[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) :: Calls the function func1, supplying func2 as the block. func1 will be called with the argument arg1. func2 receives the value from yield as