diff --git a/COPYING b/COPYING index 9043404a830c0e..bc3943419a34e2 100644 --- a/COPYING +++ b/COPYING @@ -44,9 +44,9 @@ version 2 (see the file GPL), or the conditions below: For the list of those files and their copying conditions, see the file LEGAL. - 5. The scripts and library files supplied as input to or produced as + 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the - copyright of the software, but belong to whomever generated them, + copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. diff --git a/ChangeLog b/ChangeLog index f4ee21c9c90354..286a8cbb27002a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -452,7 +452,7 @@ Tue Oct 6 06:26:00 2009 Hidetoshi NAGAI * ext/tk/lib/tkextlib/vu/dial.rb: fix logical bug. - * ext/tk/lib/tk/canvas.rb, ext/tk/lib/tkextlib/blt/component.rb: + * ext/tk/lib/tk/canvas.rb, ext/tk/lib/tkextlib/blt/component.rb: lack of support for methodcall_optkeys. Mon Oct 5 17:19:33 2009 Yukihiro Matsumoto @@ -791,7 +791,7 @@ Mon Sep 28 12:13:15 2009 Yukihiro Matsumoto method_missing with same symbol should be equal. [ruby-core:25755] - * proc.c (mnew): should always return method object. + * proc.c (mnew): should always return method object. Mon Sep 28 11:38:07 2009 NAKAMURA Usaku @@ -1282,18 +1282,18 @@ Wed Sep 16 06:30:07 2009 Marc-Andre Lafortune * thread.c (rb_exec_recursive_outer, rb_exec_recursive): Added method to short-circuit to the outermost level in case of recursion - + * test/ruby/test_thread.rb (test_recursive_outer): Test for above - + * hash.c (rb_hash_hash): Return a sensible hash for in case of recursion [ruby-core:24648] - + * range.c (rb_range_hash): ditto - + * struct.c (rb_struct_hash): ditto - + * array.c (rb_array_hash): ditto - + * test/ruby/test_array.rb (test_hash2): test for above Wed Sep 16 06:17:33 2009 Marc-Andre Lafortune @@ -1437,7 +1437,7 @@ Sun Sep 13 20:18:49 2009 Nobuyoshi Nakada Sun Sep 13 19:39:59 2009 Masaki Suketa - * ext/win32ole/win32ole.c: some refactoring. + * ext/win32ole/win32ole.c: some refactoring. Sun Sep 13 19:38:34 2009 Nobuyoshi Nakada @@ -1478,7 +1478,7 @@ Sun Sep 13 09:34:10 2009 Nobuyoshi Nakada Sun Sep 13 08:30:30 2009 Masaki Suketa - * ext/win32ole/win32ole.c: fix WIN32OLE_TYPELIB.new when the 1st + * ext/win32ole/win32ole.c: fix WIN32OLE_TYPELIB.new when the 1st argument is the non-registered file. Sun Sep 13 02:08:43 2009 Koichi Sasada @@ -1794,7 +1794,7 @@ Sun Sep 6 17:31:28 2009 Koichi Sasada Sun Sep 6 16:13:06 2009 Koichi Sasada - * insns.def (setinstancevariable), vm_insnhelper.c (vm_setivar): + * insns.def (setinstancevariable), vm_insnhelper.c (vm_setivar): fix to use inline cache (trivial optimization). Sun Sep 6 10:34:19 2009 Nobuyoshi Nakada @@ -1901,11 +1901,11 @@ Mon Aug 31 14:17:09 2009 Yuki Sonoda (Yugui) (rb_singleton_class): refactored. (rb_define_singleton_method): it needs a metaclass only but not its metametaclass. - + * object.c: booting class hierarchy was moved to class.c for keeping dependency between compilation units least. - (Init_Object): extracting the booting into - Init_class_hierarchy. + (Init_Object): extracting the booting into + Init_class_hierarchy. (boot_defclass): moved to class.c. Sun Aug 30 23:44:09 2009 Tanaka Akira @@ -1946,7 +1946,7 @@ Sun Aug 30 03:59:43 2009 Tanaka Akira * timev.h (TIME_SCALE): defined as 1000000000. (struct vtm): subsec is replaced by subsecx. subsec * TIME_SCALE == subsecx. - + * time.c: avoid rational in most cases. (struct time_object): timev is replaced by timexv. timev * TIME_SCALE == timexv. @@ -2186,7 +2186,7 @@ Sun Aug 23 15:12:22 2009 Tanaka Akira * bootstraptest/runner.rb (Dir.mktmpdir): updated to latest. (in_temporary_working_directory): temporary directory name changed. - + Sun Aug 23 00:56:13 2009 Tanaka Akira * thread.c (rb_thread_schedule): don't recur infinitely. diff --git a/LEGAL b/LEGAL index 991bb4dea92871..e487173e3d4f06 100644 --- a/LEGAL +++ b/LEGAL @@ -56,7 +56,7 @@ http://www.geocities.jp/kosako3/oniguruma/ http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/oniguruma/ http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/oniguruma/ - When this software is partly used or it is distributed with Ruby, + When this software is partly used or it is distributed with Ruby, this of Ruby follows the license of Ruby. configure: @@ -132,11 +132,11 @@ random.c This is a faster version by taking Shawn Cokus's optimization, Matthe Bellew's simplification, Isaku Wada's real version. - Before using, initialize the state by using init_genrand(seed) + Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -149,8 +149,8 @@ random.c notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -347,7 +347,7 @@ ext/nkf/nkf-utf8/utf8tbl.c: copyrighted semi-public-domain software. Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA) - Everyone is permitted to do anything on this program + Everyone is permitted to do anything on this program including copying, modifying, improving, as long as you don't try to pretend that you wrote it. i.e., the above copyright notice has to appear in all copies. @@ -398,7 +398,7 @@ ext/win32ole/win32ole.c: Other modifications Copyright (c) 1997, 1998 by Gurusamy Sarathy and Jan Dubois - + You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the README file of the Perl distribution. diff --git a/LGPL b/LGPL index b1e3f5a2638797..15a6fe93154562 100644 --- a/LGPL +++ b/LGPL @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an diff --git a/Makefile.in b/Makefile.in index 4218ffecc1df35..9143dc86875e95 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,9 +53,9 @@ warnflags = @warnflags@ XCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) @XCFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ -EXTLDFLAGS = +EXTLDFLAGS = XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS) -EXTLIBS = +EXTLIBS = LIBS = @LIBS@ $(EXTLIBS) MISSING = @LIBOBJS@ @ALLOCA@ LDSHARED = @LIBRUBY_LDSHARED@ diff --git a/README b/README index 7e8370ec59bde2..669a818353960a 100644 --- a/README +++ b/README @@ -102,7 +102,7 @@ See the file COPYING. * The Author -Feel free to send comments and bug reports to the author. Here is the +Feel free to send comments and bug reports to the author. Here is the author's latest mail address: matz@netlab.jp diff --git a/README.EXT b/README.EXT index e29b3ae89d7a75..86b70eeac3fac3 100644 --- a/README.EXT +++ b/README.EXT @@ -147,7 +147,7 @@ To convert C data to Ruby values: cast to VALUE. -You can determine whether a VALUE is pointer or not by checking its LSB. +You can determine whether a VALUE is pointer or not by checking its LSB. Notice Ruby does not allow arbitrary pointer values to be a VALUE. They should be pointers to the structures which Ruby knows about. The known @@ -213,9 +213,9 @@ listed below: rb_str_cat2(str, rb_vsprintf(format, ap)), respectively. rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) - + Creates a new Ruby string with the specified encoding. - + rb_usascii_str_new(const char *ptr, long len) rb_usascii_str_new_cstr(const char *ptr) @@ -296,17 +296,17 @@ To define nested classes or modules, use the functions below: To define methods or singleton methods, use these functions: - void rb_define_method(VALUE klass, const char *name, + void rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - void rb_define_singleton_method(VALUE object, const char *name, + void rb_define_singleton_method(VALUE object, const char *name, VALUE (*func)(), int argc) The `argc' represents the number of the arguments to the C function, which must be less than 17. But I doubt you'll need that many. If `argc' is negative, it specifies the calling sequence, not number of -the arguments. +the arguments. If argc is -1, the function will be called as: @@ -326,14 +326,14 @@ actual arguments. There are some more functions to define methods. One takes an ID as the name of method to be defined. See 2.2.2 for IDs. - void rb_define_method_id(VALUE klass, ID name, + void rb_define_method_id(VALUE klass, ID name, VALUE (*func)(ANYARGS), int argc) There are two functions to define private/protected methods: - void rb_define_private_method(VALUE klass, const char *name, + void rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - void rb_define_protected_method(VALUE klass, const char *name, + void rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(), int argc) At last, rb_define_module_function defines a module functions, @@ -350,7 +350,7 @@ or To define module functions, use: - void rb_define_module_function(VALUE module, const char *name, + void rb_define_module_function(VALUE module, const char *name, VALUE (*func)(), int argc) In addition, function-like methods, which are private methods defined @@ -399,7 +399,7 @@ evaluate the string as Ruby program. This function will do the job: Evaluation is done under the current context, thus current local variables of the innermost method (which is defined by Ruby) can be accessed. -Note that the evaluation can raise an exception. There is a safer +Note that the evaluation can raise an exception. There is a safer function: VALUE rb_eval_string_protect(const char *str, int *state) @@ -563,7 +563,7 @@ Data_Get_Struct(). A pointer to the structure will be assigned to the variable sval. -See the example below for details. +See the example below for details. 4. Example - Creating dbm extension @@ -618,7 +618,7 @@ Init_dbm(void) } -- -The dbm extension wraps the dbm struct in the C environment using +The dbm extension wraps the dbm struct in the C environment using Data_Make_Struct. -- @@ -847,7 +847,7 @@ utility functions ruby interpreter implementation dmyext.c - dmydln.c + dmydln.c dmyencoding.c id.c inits.c @@ -883,7 +883,7 @@ class library rational.c : Rational re.c : Regexp, MatchData signal.c : Signal - sprintf.c : + sprintf.c : string.c : String struct.c : Struct time.c : Time @@ -898,7 +898,7 @@ multilingualization enc/trans/* : codepoint mapping tables goruby interpreter implementation - + goruby.c golf_prelude.rb : goruby specific libraries. -> golf_prelude.c : automatically generated @@ -946,7 +946,7 @@ sval, and returns the DATA encapsulating the pointer to memory region. Data_Get_Struct(data, type, sval) This macro retrieves the pointer value from DATA, and assigns it to -the variable sval. +the variable sval. ** Checking data types @@ -1033,7 +1033,7 @@ The getter function must return the value for the access. void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), VALUE (*setter)()) -Defines hooked variable. It's a virtual variable with a C variable. +Defines hooked variable. It's a virtual variable with a C variable. The getter is called as VALUE getter(ID id, VALUE *var) @@ -1174,7 +1174,7 @@ argc/argv as the third/fourth arguments. Calls the function func1, supplying func2 as the block. func1 will be called with the argument arg1. func2 receives the value from yield as the first argument, arg2 as the second argument. - + When rb_iterate is used in 1.9, func1 has to call some Ruby-level method. This function is obsolete since 1.9; use rb_block_call instead. diff --git a/README.EXT.ja b/README.EXT.ja index c35de7d42dd114..f15e065b38fd81 100644 --- a/README.EXT.ja +++ b/README.EXT.ja @@ -115,9 +115,9 @@ FIXNUM (整数に変換できない場合には例外が発生する).同様にチェック無 で使える変換マクロはdoubleを取り出す「NUM2DBL()」があります. -char* を取り出す場合, StringValue() と StringValuePtr() +char* を取り出す場合, StringValue() と StringValuePtr() を使います. -StringValue(var) は var が String +StringValue(var) は var が String であれば何もせず,そうでなければ var を var.to_str() の結果 に置き換えるマクロ,StringValuePtr(var) は同様に var を String に置き換えてから var のバイト列表現に対する char* を @@ -242,9 +242,9 @@ Ruby rb_str_cat2(str, rb_vsprintf(format, ap)) と同等である. rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) - + 指定されたエンコーディングでRubyの文字列を生成する. - + rb_usascii_str_new(const char *ptr, long len) rb_usascii_str_new_cstr(const char *ptr) @@ -336,10 +336,10 @@ Ruby メソッドや特異メソッドを定義するには以下の関数を使います. - void rb_define_method(VALUE klass, const char *name, + void rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - void rb_define_singleton_method(VALUE object, const char *name, + void rb_define_singleton_method(VALUE object, const char *name, VALUE (*func)(), int argc) @@ -361,14 +361,14 @@ argc メソッドを定義する関数はまだいくつかあります. ひとつはメソッド 名としてIDを取ります. IDについては2.2.2を参照. - void rb_define_method_id(VALUE klass, ID name, + void rb_define_method_id(VALUE klass, ID name, VALUE (*func)(ANYARGS), int argc) private/protectedなメソッドを定義するふたつの関数があります. - void rb_define_private_method(VALUE klass, const char *name, + void rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - void rb_define_protected_method(VALUE klass, const char *name, + void rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(), int argc) privateメソッドとは関数形式でしか呼び出すことの出来ないメソッ @@ -389,7 +389,7 @@ private という形式でも使えます.モジュール関数を定義する関数は以下の 通りです. - void rb_define_module_function(VALUE module, const char *name, + void rb_define_module_function(VALUE module, const char *name, VALUE (*func)(), int argc) 関数的メソッド(Kernelモジュールのprivate method)を定義するた @@ -986,7 +986,7 @@ Ruby rational.c : Rational re.c : Regexp, MatchData signal.c : Signal - sprintf.c : + sprintf.c : string.c : String struct.c : Struct time.c : Time @@ -1001,7 +1001,7 @@ Ruby enc/trans/* : コードポイント対応表 gorubyコマンドの実装 - + goruby.c golf_prelude.rb : goruby固有のライブラリ -> golf_prelude.c : 自動生成 @@ -1161,12 +1161,12 @@ void rb_define_global_const(const char *name, VALUE val) rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) - メソッドを定義する.argcはselfを除く引数の数.argcが-1の時, + メソッドを定義する.argcはselfを除く引数の数.argcが-1の時, 関数には引数の数(selfを含まない)を第1引数, 引数の配列を第2 - 引数とする形式で与えられる(第3引数はself).argcが-2の時, + 引数とする形式で与えられる(第3引数はself).argcが-2の時, 第1引数がself, 第2引数がargs(argsは引数を含むRubyの配列)と いう形式で与えられる. - + rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) privateメソッドを定義する.引数はrb_define_method()と同じ. @@ -1266,10 +1266,10 @@ VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, [OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) - func2をブロックとして設定し, func1をイテレータとして呼ぶ. + func2をブロックとして設定し, func1をイテレータとして呼ぶ. func1には arg1が引数として渡され, func2には第1引数にイテレー タから与えられた値, 第2引数にarg2が渡される. - + 1.9でrb_iterateを使う場合は, func1の中でRubyレベルのメソッド を呼び出さなければならない. 1.9でobsoleteとなった. 代わりにrb_block_callが用意された. @@ -1527,7 +1527,7 @@ dir_config(target[, default_include, default_lib]) pkg_config(pkg) - pkg-configコマンドからパッケージpkgの情報を得る. + pkg-configコマンドからパッケージpkgの情報を得る. pkg-configの実際のコマンド名は,--with-pkg-configコマンド ラインオプションで指定可能. diff --git a/README.ja b/README.ja index 2191720a26d164..b9e19972bbe0cc 100644 --- a/README.ja +++ b/README.ja @@ -61,8 +61,8 @@ Ruby まで本文に subscribe YourFirstName YourFamilyName - -と書いて送って下さい。 + +と書いて送って下さい。 Ruby開発者向けメーリングリストもあります。こちらではrubyのバ グ、将来の仕様拡張など実装上の問題について議論されています。 @@ -70,12 +70,12 @@ Ruby ruby-dev-ctl@ruby-lang.org -までruby-listと同様の方法でメールしてください。 +までruby-listと同様の方法でメールしてください。 Ruby拡張モジュールについて話し合うruby-extメーリングリストと 数学関係の話題について話し合うruby-mathメーリングリストと 英語で話し合うruby-talkメーリングリストもあります。参加方法 -はどれも同じです。 +はどれも同じです。 * コンパイル・インストール diff --git a/ToDo b/ToDo index 7e5ef523a8028f..87bb61f4da0c77 100644 --- a/ToDo +++ b/ToDo @@ -51,7 +51,7 @@ Hacking Interpreter * export rb_io_{addstr,printf,puts,print} * autoload should work with threads [ruby-talk:4589] * remove stdio dependency from IOs. -* warn for inconsistent local variable usage (lv m and method m at the same time). +* warn for inconsistent local variable usage (lv m and method m at the same time). * MicroRuby * Built-in Interactive Ruby. * Parser API diff --git a/array.c b/array.c index 05d5494af775d9..9e46127525c2d2 100644 --- a/array.c +++ b/array.c @@ -1577,7 +1577,7 @@ ary_join_1(VALUE obj, VALUE ary, VALUE sep, long i, VALUE result) } else { VALUE args[3]; - + args[0] = val; args[1] = sep; args[2] = result; diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index 834e8a5870b705..42459d7020bf02 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -93,7 +93,7 @@ CPU = $(PROCESSOR_ARCHITECTURE) ARCH = $(PROCESSOR_ARCHITECTURE) !endif !ifndef DEBUGFLAGS -DEBUGFLAGS = +DEBUGFLAGS = !endif !ifndef OPTFLAGS OPTFLAGS = -O @@ -170,7 +170,7 @@ LIBRUBY_LDSHARED = $(LDSHARED) LIBRUBY_DLDFLAGS = -Gi $(DLDFLAGS) $(EXTLDFLAGS) LDOBJECTS = $(MAINOBJ) -SOLIBS = +SOLIBS = EXEEXT = .exe PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) diff --git a/bcc32/README.bcc32 b/bcc32/README.bcc32 index fb19906c7522ae..d59507498ce50f 100644 --- a/bcc32/README.bcc32 +++ b/bcc32/README.bcc32 @@ -36,9 +36,9 @@ You can also specify the install directory. For example, run `((%configure --prefix=%))' Default of the install directory is /usr . - + (2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile})) - if you want to change the name of the executable files. + if you want to change the name of the executable files. And add ((|RUBYW_INSTALL_NAME|)) to change the name of the executable without console window if also you want. @@ -75,8 +75,8 @@ to their base names. $(RUBYW_INSTALL_NAME).ico or rubyw.ico --> $(RUBYW_INSTALL_NAME).exe the others --> $(RUBY_SO_NAME).dll -Although no icons are distributed with the ruby source or in the official -site, you can use anything you like. For example, followings are written +Although no icons are distributed with the ruby source or in the official +site, you can use anything you like. For example, followings are written in Japanese, but you can download at least. * (()) or @@ -100,7 +100,7 @@ in Japanese, but you can download at least. make test make install -* Build on the relative directory from the ruby source directory and CPU type +* Build on the relative directory from the ruby source directory and CPU type i386. ex.) @@ -108,7 +108,7 @@ in Japanese, but you can download at least. build directory: C:\ruby\bccwin32 install directory: C:\usr\local CPU i386 - + C: cd \ruby mkdir bccwin32 diff --git a/benchmark/driver.rb b/benchmark/driver.rb index 687dec26f1e822..1f879adbd4a5cf 100644 --- a/benchmark/driver.rb +++ b/benchmark/driver.rb @@ -48,7 +48,7 @@ def message_print *args def progress_message *args unless STDOUT.tty? - STDERR.print(*args) + STDERR.print(*args) STDERR.flush end end diff --git a/benchmark/other-lang/eval.rb b/benchmark/other-lang/eval.rb index 387592738900d5..48a2cea0199e12 100644 --- a/benchmark/other-lang/eval.rb +++ b/benchmark/other-lang/eval.rb @@ -51,14 +51,14 @@ def bench cmd require 'pp' # utime -puts Lang.join("\t") +puts Lang.join("\t") Bench.each_with_index{|b, bi| print b, "\t" puts Result[bi].map{|e| e[0]}.join("\t") } # rtime -puts Lang.join("\t") +puts Lang.join("\t") Bench.each_with_index{|b, bi| print b, "\t" puts Result[bi].map{|e| e[1]}.join("\t") diff --git a/benchmark/report.rb b/benchmark/report.rb index e931966cca57bd..8cfd0ce77b2054 100644 --- a/benchmark/report.rb +++ b/benchmark/report.rb @@ -27,7 +27,7 @@ def benchmark cmd rubybin = ENV['RUBY'] || File.join( RbConfig::CONFIG["bindir"], RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]) - + IO.popen(rubybin, 'r+'){|io| io.write cmd io.close_write diff --git a/benchmark/run.rb b/benchmark/run.rb index 6ef294364259c0..0cd236384953ec 100644 --- a/benchmark/run.rb +++ b/benchmark/run.rb @@ -33,8 +33,8 @@ def bm file bm_name = $1 puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly puts "#{bm_name}: " - - + + puts <klass +#define METACLASS_OF(k) RBASIC(k)->klass /*! * whether k is a meta^(n)-class of Class class @@ -333,7 +333,7 @@ Init_class_hierarchy(void) rb_cModule = boot_defclass("Module", rb_cObject); rb_cClass = boot_defclass("Class", rb_cModule); - RBASIC(rb_cClass)->klass + RBASIC(rb_cClass)->klass = RBASIC(rb_cModule)->klass = RBASIC(rb_cObject)->klass = RBASIC(rb_cBasicObject)->klass @@ -408,10 +408,10 @@ rb_class_inherited(VALUE super, VALUE klass) /*! * Defines a top-level class. * \param name name of the class - * \param super a class from which the new class will derive. + * \param super a class from which the new class will derive. * NULL means \c Object class. * \return the created class - * \throw TypeError if the constant name \a name is already taken but + * \throw TypeError if the constant name \a name is already taken but * the constant is not a \c Class. * \throw NameError if the class is already defined but the class can not * be reopened because its superclass is not \a super. @@ -454,10 +454,10 @@ rb_define_class(const char *name, VALUE super) * Defines a class under the namespace of \a outer. * \param outer a class which contains the new class. * \param name name of the new class - * \param super a class from which the new class will derive. + * \param super a class from which the new class will derive. * NULL means \c Object class. * \return the created class - * \throw TypeError if the constant name \a name is already taken but + * \throw TypeError if the constant name \a name is already taken but * the constant is not a \c Class. * \throw NameError if the class is already defined but the class can not * be reopened because its superclass is not \a super. @@ -477,10 +477,10 @@ rb_define_class_under(VALUE outer, const char *name, VALUE super) * Defines a class under the namespace of \a outer. * \param outer a class which contains the new class. * \param id name of the new class - * \param super a class from which the new class will derive. + * \param super a class from which the new class will derive. * NULL means \c Object class. * \return the created class - * \throw TypeError if the constant name \a name is already taken but + * \throw TypeError if the constant name \a name is already taken but * the constant is not a \c Class. * \throw NameError if the class is already defined but the class can not * be reopened because its superclass is not \a super. @@ -1009,12 +1009,12 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj) * These API takes a C function as a method body. * * \par Method body functions - * Method body functions must return a VALUE and + * Method body functions must return a VALUE and * can be one of the following form: *
*
Fixed number of parameters
*
- * This form is a normal C function, excepting it takes + * This form is a normal C function, excepting it takes * a receiver object as the first argument. * * \code @@ -1034,7 +1034,7 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj) *
Ruby array style
*
* This form takes two parameters: self and args. - * \a self is the receiver. \a args is an Array object which + * \a self is the receiver. \a args is an Array object which * containts the arguments. * * \code @@ -1108,7 +1108,7 @@ rb_undef_method(VALUE klass, const char *name) * * \note DO NOT expose the returned singleton class to * outside of class.c. - * Use \ref rb_singleton_class instead for + * Use \ref rb_singleton_class instead for * consistency of the metaclass hierarchy. */ static VALUE @@ -1160,11 +1160,11 @@ singleton_class_of(VALUE obj) * \return the singleton class. * * \post \a obj has its own singleton class. - * \post if \a obj is a class, - * the returned singleton class also has its own + * \post if \a obj is a class, + * the returned singleton class also has its own * singleton class in order to keep consistency of the * inheritance structure of metaclasses. - * \note a new singleton class will be created + * \note a new singleton class will be created * if \a obj does not have it. * \note the singleton classes for nil, true and false are: * NilClass, TrueClass and FalseClass. @@ -1175,7 +1175,7 @@ rb_singleton_class(VALUE obj) VALUE klass = singleton_class_of(obj); /* ensures an exposed class belongs to its own eigenclass */ - if (TYPE(obj) == T_CLASS) ENSURE_EIGENCLASS(klass); + if (TYPE(obj) == T_CLASS) ENSURE_EIGENCLASS(klass); return klass; } diff --git a/common.mk b/common.mk index c8e535d461b625..fe1432b602612c 100644 --- a/common.mk +++ b/common.mk @@ -23,7 +23,7 @@ ID_H_TARGET = -id.h- DMYEXT = dmyext.$(OBJEXT) NORMALMAINOBJ = main.$(OBJEXT) MAINOBJ = $(NORMALMAINOBJ) -EXTOBJS = +EXTOBJS = DLDOBJS = $(DMYEXT) MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) miniprelude.$(OBJEXT) ENC_MK = enc.mk @@ -759,8 +759,8 @@ parse: miniruby$(EXEEXT) PHONY $(MINIRUBY) $(srcdir)/tool/parse.rb $(TESTRUN_SCRIPT) COMPARE_RUBY = $(BASERUBY) -ITEM = -OPTS = +ITEM = +OPTS = benchmark: $(PROGRAM) PHONY $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \ diff --git a/doc/ChangeLog-1.8.0 b/doc/ChangeLog-1.8.0 index e16c7f4f205b2d..93eef3f71cc61c 100644 --- a/doc/ChangeLog-1.8.0 +++ b/doc/ChangeLog-1.8.0 @@ -42,7 +42,7 @@ Sun Aug 3 23:56:50 2003 Nobuyoshi Nakada Sun Aug 3 22:07:47 2003 Hidetoshi NAGAI - * ext/tk/lib/tkentry.rb: support 'validatecommand' option of + * ext/tk/lib/tkentry.rb: support 'validatecommand' option of TkEntry/TkSpinbox widget * ext/tk/sample/{demos-en,demos-jp}/spin.rb: add @@ -60,7 +60,7 @@ Sun Aug 3 18:03:44 2003 WATANABE Hirofumi Sun Aug 3 08:53:06 2003 Hidetoshi NAGAI - * ext/tk/sample/{demos-en,demos-jp}/image3.rb: add + * ext/tk/sample/{demos-en,demos-jp}/image3.rb: add * ext/tk/lib/tkcanvas.rb: bug fix on Tk object ID management @@ -84,7 +84,7 @@ Sat Aug 2 23:51:52 2003 Yukihiro Matsumoto Sat Aug 2 09:58:13 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: bug fix --- TkGrid failed to treat + * ext/tk/lib/tk.rb: bug fix --- TkGrid failed to treat RELATIVE PLACEMENT * ext/tk/sample/demos-en/, demos-jp/: add or modify some @@ -122,7 +122,7 @@ Sat Aug 2 14:02:39 2003 Nobuyoshi Nakada Sat Aug 2 09:58:13 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: bug fix --- forgot to entry a widget class + * ext/tk/lib/tk.rb: bug fix --- forgot to entry a widget class name of 'labelframe' widget * ext/tk/sample/{demos-en,demos-jp}/{labelframe.rb,paned1.rb, @@ -238,7 +238,7 @@ Fri Aug 1 09:54:38 2003 Yukihiro Matsumoto Fri Aug 1 04:58:55 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: bug fix --- forget to eval given block to + * ext/tk/lib/tk.rb: bug fix --- forget to eval given block to TkRoot.new method * ext/tk/sample/tkoptdb-safeTk.rb: new sample script @@ -255,13 +255,13 @@ Thu Jul 31 23:44:00 2003 Masatoshi SEKI Thu Jul 31 23:04:45 2003 Hidetoshi NAGAI - * ext/tk/sample/resource.en, ext/tk/sample/resource.jp: + * ext/tk/sample/resource.en, ext/tk/sample/resource.jp: wrong resource file format - * ext/tk/lib/tk.rb: add Tk::Encoding.{encoding_convertfrom, + * ext/tk/lib/tk.rb: add Tk::Encoding.{encoding_convertfrom, encoding_convertto} - * ext/tk/lib/tk.rb: add TkOptionDB.read_with_encoding to read + * ext/tk/lib/tk.rb: add TkOptionDB.read_with_encoding to read non-utf8 resource file Thu Jul 31 23:02:47 2003 NAKAMURA Usaku @@ -274,15 +274,15 @@ Thu Jul 31 20:52:40 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: (IMPORTANT BUG FIX) scan of event keywords doesn't work on recent versions of Tck/Tk - * ext/tk/lib/tk.rb: initialize error of instance variable on + * ext/tk/lib/tk.rb: initialize error of instance variable on TkComposite - * ext/tk/lib/multi-tk.rb: initialize error on encoding-system on + * ext/tk/lib/multi-tk.rb: initialize error on encoding-system on MultiTkIp * ext/tk/lib/tk.rb: trouble on destroying widgets - * ext/tk/sample/demos-en/, demos-jp/: add JP and EN version of + * ext/tk/sample/demos-en/, demos-jp/: add JP and EN version of Ruby/Tk widget demos Thu Jul 31 15:25:12 2003 NAKAMURA Usaku @@ -311,13 +311,13 @@ Thu Jul 31 08:18:00 2003 Nathaniel Talbott Thu Jul 31 07:59:18 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: wrap the command-proc of TkScale --- pass + * ext/tk/lib/tk.rb: wrap the command-proc of TkScale --- pass the numeric object to the proc - * ext/tk/lib/tk.rb: better support for widgets created on + * ext/tk/lib/tk.rb: better support for widgets created on Tk interpreter (without Ruby) - * ext/tk/lib/multi-tk.rb: a little more stable on Multiple Tk + * ext/tk/lib/multi-tk.rb: a little more stable on Multiple Tk interpreters running Thu Jul 31 00:17:19 2003 Shugo Maeda @@ -411,17 +411,17 @@ Wed Jul 30 07:23:14 2003 Hidetoshi NAGAI * ext/tk/lib/tkentry.rb: fix lack of methods for TkEntry - * ext/tk/lib/multi-tk.rb, ext/tk/lib/tk.rb, - ext/tk/lib/tkdialog.rb, ext/tk/lib/tkentry.rb, + * ext/tk/lib/multi-tk.rb, ext/tk/lib/tk.rb, + ext/tk/lib/tkdialog.rb, ext/tk/lib/tkentry.rb, ext/tk/sample/safe-tk.rb, ext/tk/sample/tktimer2.rb: bug fix - * ext/tk/lib/multi-tk.rb: MultiTkIp.new_* accept a block to + * ext/tk/lib/multi-tk.rb: MultiTkIp.new_* accept a block to eval under the new interpreter Wed Jul 30 04:36:30 2003 Hidetoshi NAGAI - * ext/tcltklib/tcltklib.c, - ext/tk/lib/tk.rb, ext/tk/lib/tkafter.rb: additional check of + * ext/tcltklib/tcltklib.c, + ext/tk/lib/tk.rb, ext/tk/lib/tkafter.rb: additional check of Tk interpreters' status for a little more safety Wed Jul 30 02:37:12 2003 Yukihiro Matsumoto @@ -514,14 +514,14 @@ Mon Jul 28 22:57:52 2003 Yukihiro Matsumoto Tue Jul 29 16:20:36 2003 Hidetoshi NAGAI - * ext/tcltklib/tcltklib.c: bug fix and + * ext/tcltklib/tcltklib.c: bug fix and change mainloop_abort_on_no_widget_cmd => mainloop_abort_on_exception ( to avoid thread timing trouble on accessing destroyed widgets ) - * ext/tk/lib/multi-tk.rb: change default mode of + * ext/tk/lib/multi-tk.rb: change default mode of mainloop_abort_on_exception on multi-tk.rb - * ext/tk/lib/multi-tk.rb: fix a bug of the procedure for + * ext/tk/lib/multi-tk.rb: fix a bug of the procedure for 'Delete' button on the safe-Tk frmae Tue Jul 29 12:22:28 2003 why the lucky stiff @@ -541,8 +541,8 @@ Tue Jul 29 12:15:37 2003 NAKAMURA Usaku Tue Jul 29 08:05:30 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb, ext/tk/lib/tkdialog.rb, ext/tk/lib/tktext.rb, - ext/tk/sample/tkbiff.rb, ext/tk/sample/tkdialog.rb, + * ext/tk/lib/tk.rb, ext/tk/lib/tkdialog.rb, ext/tk/lib/tktext.rb, + ext/tk/sample/tkbiff.rb, ext/tk/sample/tkdialog.rb, ext/tk/sample/tkform.rb: bug fix ( tested with Ruby/Tk widget demo ) Tue Jul 29 04:22:08 2003 why the lucky stiff @@ -571,7 +571,7 @@ Tue Jul 29 01:24:32 2003 Hidetoshi NAGAI * ext/tk/lib/multi-tk.rb: bug fix and pack options are pssed to the safeTk container - * ext/tk/sample/safe-tk.rb: add example for pack options of + * ext/tk/sample/safe-tk.rb: add example for pack options of safeTk container Mon Jul 28 23:23:08 2003 Nobuyoshi Nakada @@ -643,7 +643,7 @@ Sun Jul 27 19:35:06 2003 Hidetoshi NAGAI * ext/tcltklib/tcltklib.c: add some methods to support multiple interpreters (low level) - * ext/tk/lib/multi-tk.rb: new library to support multiple Tk + * ext/tk/lib/multi-tk.rb: new library to support multiple Tk interpreters (high level) * ext/tcltklib/demo/safeTk.rb: new sample of safeTk interpreter @@ -732,12 +732,12 @@ Fri Jul 26 00:04:25 2003 NAKAMURA, Hiroshi Fri Jul 25 16:43:03 2003 Hidetoshi NAGAI - * ext/tcltklib/tcltklib.c: add TclTkIp#create_slave, + * ext/tcltklib/tcltklib.c: add TclTkIp#create_slave, TclTkIp#_make_safe and TclTkIp#safe? * ext/tcltklib/MANUAL.euc: modify descriptions - * ext/tk/lib/tk.rb: bug fix [ruby-talk:76980] and modify to + * ext/tk/lib/tk.rb: bug fix [ruby-talk:76980] and modify to support multi Tk IPs * ext/tk/lib/tkafter.rb: modify to support multi Tk IPs @@ -747,10 +747,10 @@ Fri Jul 25 15:47:39 2003 GOTOU Yuuzou * ext/openssl/extconf.rb: add check for BN_rand_range() and BN_pseudo_rand_range(). - * ext/openssl/ossl_bn.c (ossl_bn_s_rand_range): should raise + * ext/openssl/ossl_bn.c (ossl_bn_s_rand_range): should raise NotImplementedError if BN_rand_range() wan not defined. - * ext/openssl/ossl_bn.c (ossl_bn_s_pseudo_rand_range): should raise + * ext/openssl/ossl_bn.c (ossl_bn_s_pseudo_rand_range): should raise NotImplementedError if BN_pseudo_rand_range() wan not defined. * ext/openssl/ossl_pkcs7.c (ossl_pkcs7_s_encrypt): avoid compiler @@ -1110,7 +1110,7 @@ Thu Jul 17 13:42:53 2003 WATANABE Hirofumi Thu Jul 17 06:40:28 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: recover and fix typo : Tk.chooseDirectory + * ext/tk/lib/tk.rb: recover and fix typo : Tk.chooseDirectory (Tk8.4 feature) Wed Jul 16 16:23:58 2003 Yukihiro Matsumoto @@ -1139,7 +1139,7 @@ Tue Jul 15 14:38:21 2003 Yukihiro Matsumoto Tue Jul 15 03:30:41 2003 why the lucky stiff - * ext/syck/rubyext.c (syck_mark_emitter): forgot to rb_gc_mark the + * ext/syck/rubyext.c (syck_mark_emitter): forgot to rb_gc_mark the outgoing IO object. Sun Jul 13 14:55:36 2003 Koji Arai @@ -1196,7 +1196,7 @@ Fri Jul 11 16:09:09 2003 Yukihiro Matsumoto Fri Jul 11 07:17:47 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: not create a Tcl/Tk interpreter if already + * ext/tk/lib/tk.rb: not create a Tcl/Tk interpreter if already defined TkCore::INTERP * ext/tk/lib/tk.rb: bugfix on TkWindow#configure @@ -1306,7 +1306,7 @@ Thu Jul 3 14:22:46 2003 Yukihiro Matsumoto Thu Jul 3 12:13:05 2003 WATANABE Hirofumi - * lib/mkmf.rb (VPATH): convert from Windows form to Unix form on + * lib/mkmf.rb (VPATH): convert from Windows form to Unix form on MinGW. This fixes the build with GNU make 3.80-1 for Cygwin. Wed Jul 2 23:27:34 2003 Yukihiro Matsumoto @@ -1459,11 +1459,11 @@ Thu Jun 26 21:34:49 2003 Nobuyoshi Nakada Wed Jun 25 14:40:33 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: add and modify methods --- - TkWidget.database_class, TkWidget.database_classname, - TkWidget#database_class, TkWidget#database_classname + * ext/tk/lib/tk.rb: add and modify methods --- + TkWidget.database_class, TkWidget.database_classname, + TkWidget#database_class, TkWidget#database_classname - * ext/tk/lib/tk.rb: instances of a subclass of TkToplevel or + * ext/tk/lib/tk.rb: instances of a subclass of TkToplevel or TkFrame are created with ":class=>subclass" option as default. * ext/tk/sample/tkoptdb.rb: add a new part @@ -1478,7 +1478,7 @@ Wed Jun 25 05:49:10 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: add widget destroy hook binding to TkBindTag::ALL - * ext/tk/lib/tkcanvas.rb: Although requiring manual control of GC, + * ext/tk/lib/tkcanvas.rb: Although requiring manual control of GC, memory eating problem of TkCanvas Items is fixed. * ext/tk/lib/tktext.rb: add some methods and bug fix @@ -1493,10 +1493,10 @@ Tue Jun 24 16:46:07 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: bug fix on TkToplevel, TkFrame, TkPanedwindow, TkOptionDB - * ext/tk/lib/tk.rb: TkOptionDB --- make it more secure to use procs + * ext/tk/lib/tk.rb: TkOptionDB --- make it more secure to use procs defined on resourceDB - * ext/tk/sample/tkoptdb.rb, resource.ja, resource.en: + * ext/tk/sample/tkoptdb.rb, resource.ja, resource.en: sample script how to use TkOptionDB. Tue Jun 24 14:22:41 2003 why the lucky stiff @@ -1610,14 +1610,14 @@ Sun Jun 22 23:42:20 2003 Nobuyoshi Nakada Sun Jun 22 16:17:02 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: TkRoot.new and TkToplevel.new accept Wm + * ext/tk/lib/tk.rb: TkRoot.new and TkToplevel.new accept Wm commands as elements * ext/tk/lib/tk.rb: TkMenu --- add some methods * ext/tk/lib/tk.rb: TkOptionMenubutton --- bug fix - * ext/tk/sample/tkmenubutton.rb: sample of TkMenubutton and + * ext/tk/sample/tkmenubutton.rb: sample of TkMenubutton and TkOptionMenubutton Sat Jun 21 23:15:08 2003 Yukihiro Matsumoto @@ -1625,7 +1625,7 @@ Sat Jun 21 23:15:08 2003 Yukihiro Matsumoto * eval.c (proc_invoke): should not propagate distination tag if tag is already handled in this level. (ruby-bugs-ja PR#501) - * object.c (str_to_id): check for empty string before intern. + * object.c (str_to_id): check for empty string before intern. [ruby-talk:74006] Sat Jun 21 13:56:09 2003 Takaaki Uematsu @@ -1636,10 +1636,10 @@ Sat Jun 21 13:56:09 2003 Takaaki Uematsu Sat Jun 21 12:55:17 2003 Hidetoshi NAGAI - * ext/tk/lib/tk.rb: TkRoot.new and TkToplevel.new accept Wm commands - as elements of a hash argument. + * ext/tk/lib/tk.rb: TkRoot.new and TkToplevel.new accept Wm commands + as elements of a hash argument. - * ext/tk/sample/tktimer2.rb: add comments about the usage of a + * ext/tk/sample/tktimer2.rb: add comments about the usage of a TkTimer object. Sat Jun 21 08:47:22 2003 Hidetoshi NAGAI @@ -1647,10 +1647,10 @@ Sat Jun 21 08:47:22 2003 Hidetoshi NAGAI * ext/tk/lib/tk*.rb: remove direct-accesses to TkComm::INTERP and TkComm::INITIALIZE_TARGETS - * ext/tk/lib/tk*.rb: use TkINTERP_SETUP_SCRIPTS constant for setting + * ext/tk/lib/tk*.rb: use TkINTERP_SETUP_SCRIPTS constant for setting up the interpreter - * ext/tcltklib/tcltklib.c: support to create a safe interpreter + * ext/tcltklib/tcltklib.c: support to create a safe interpreter with safe-Tk Fri Jun 20 23:28:27 2003 Yukihiro Matsumoto @@ -1660,7 +1660,7 @@ Fri Jun 20 23:28:27 2003 Yukihiro Matsumoto Fri Jun 20 15:04:28 2003 NAKAMURA Usaku - * defines.h (PATH_ENV): name of PATH environment. [new]. + * defines.h (PATH_ENV): name of PATH environment. [new]. * defines.h (ENV_IGNORECASE): define for case insensitive platforms to access environment variables. @@ -1678,7 +1678,7 @@ Fri Jun 20 14:52:46 2003 Hidetoshi NAGAI Fri Jun 20 03:09:21 2003 Yukihiro Matsumoto - * parse.y (new_yield): distinguish "yield 1,2" and "yield [1,2]". + * parse.y (new_yield): distinguish "yield 1,2" and "yield [1,2]". [ruby-dev:20360] * eval.c (rb_eval): support new_yield() change. @@ -1688,7 +1688,7 @@ Fri Jun 20 03:09:21 2003 Yukihiro Matsumoto [ruby-list:36935] * parse.y (no_blockarg): separate no block argument check and - ret_args argument processing. + ret_args argument processing. Fri Jun 20 00:45:19 2003 NAKAMURA, Hiroshi @@ -1696,9 +1696,9 @@ Fri Jun 20 00:45:19 2003 NAKAMURA, Hiroshi Thu Jun 19 22:51:41 2003 Masatoshi SEKI - * lib/drb.rb, lib/drb/drb.rb, lib/drb/eq.rb, - lib/drb/extserv.rb, lib/drb/extservm.rb, lib/drb/gw.rb, - lib/drb/invokemethod.rb, lib/drb/observer.rb, + * lib/drb.rb, lib/drb/drb.rb, lib/drb/eq.rb, + lib/drb/extserv.rb, lib/drb/extservm.rb, lib/drb/gw.rb, + lib/drb/invokemethod.rb, lib/drb/observer.rb, lib/drb/timeridconv.rb, lib/drb/unix.rb: import drb-2.0.4b3 Thu Jun 19 16:14:43 2003 Hidetoshi NAGAI @@ -1710,17 +1710,17 @@ Thu Jun 19 16:14:43 2003 Hidetoshi NAGAI * ext/tcltklib/tcltklib.c: add TclTkLib::EventFlag::NONE ( == 0 ) - * ext/tcltklib/tcltklib.c: add set_no_event_wait() and + * ext/tcltklib/tcltklib.c: add set_no_event_wait() and get_no_event_wait() * ext/tcltklib/MANUAL.euc: modify * ext/tcltklib/README.euc: ditto - * ext/tk/lib/tk.rb: change default value of TkCore.do_one_event + * ext/tk/lib/tk.rb: change default value of TkCore.do_one_event argument - * ext/tk/lib/tk.rb: add TkCore.set_no_event_wait(wait) and + * ext/tk/lib/tk.rb: add TkCore.set_no_event_wait(wait) and TkCore.get_no_event_wait * ext/tk/lib/tk.rb: add Tk.exit ( == destroy root widget ) @@ -1730,7 +1730,7 @@ Thu Jun 19 16:14:43 2003 Hidetoshi NAGAI * ext/tk/lib/tkafter.rb: set_callback returns self - * ext/tk/lib/tkafter.rb: continue() raises an exception, if already + * ext/tk/lib/tkafter.rb: continue() raises an exception, if already running or no procedure. * ext/tk/lib/tkafter.rb: skip() raises an exception, if not running. @@ -1768,15 +1768,15 @@ Wed Jun 18 19:46:21 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: rename 'no_create' option to 'without_creating' - * ext/tk/lib/tk.rb: add TkWindow#pack_in, TkWindow#grid_in, + * ext/tk/lib/tk.rb: add TkWindow#pack_in, TkWindow#grid_in, TkWindow#place_in * ext/tk/lib/tk.rb: add TkWindow#bind_class and TkWindow#database_class - * ext/tk/lib/tk.rb: add TkBindTag.new_by_name and TkDatabaseClass + * ext/tk/lib/tk.rb: add TkBindTag.new_by_name and TkDatabaseClass for binding to database class - * ext/tk/lib/tk.rb: check varname whether already exsist or not. + * ext/tk/lib/tk.rb: check varname whether already exsist or not. (TkVarAccess.new) * ext/tk/lib/tk.rb: TkTextWin#bbox returns an array of four numbers @@ -1788,21 +1788,21 @@ Wed Jun 18 19:46:21 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: TkBindTag.new accepts a block - * ext/tk/lib/tk.rb: If given taglist, TkWindow#bindtags(taglist) + * ext/tk/lib/tk.rb: If given taglist, TkWindow#bindtags(taglist) returns taglist * ext/tk/lib/tk.rb: add TkWindow#bindtags=(taglist) - * ext/tk/lib/tk.rb: Tk.focue and Tk.focus_lastfor return nil + * ext/tk/lib/tk.rb: Tk.focue and Tk.focus_lastfor return nil if there is no target widget. - * ext/tk/lib/tk.rb: Tk::Wm.client returns the argument string + * ext/tk/lib/tk.rb: Tk::Wm.client returns the argument string when setting name - * ext/tk/lib/tk.rb: TkGrid.columnconfiginfo and rowconfiginfo + * ext/tk/lib/tk.rb: TkGrid.columnconfiginfo and rowconfiginfo given a slot return a number. - * ext/tk/lib/tk.rb: TkWindow.grid_columnconfiginfo and + * ext/tk/lib/tk.rb: TkWindow.grid_columnconfiginfo and grid_rowconfiginfo --- ditto * ext/tk/lib/tk.rb: rename and define alias :: TkOption ==> TkOptionDB @@ -1813,10 +1813,10 @@ Wed Jun 18 19:46:21 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: some TkComm methods change to module functions - * ext/tk/lib/tk.rb: add support for -displayof option to some + * ext/tk/lib/tk.rb: add support for -displayof option to some TkWinfo methods - * ext/tk/lib/tk.rb: bind, bind_append and bind_remove --- + * ext/tk/lib/tk.rb: bind, bind_append and bind_remove --- returns the target of event-binding * ext/tk/lib/tk.rb: add Tk8.4 features @@ -1837,7 +1837,7 @@ Wed Jun 18 19:46:21 2003 Hidetoshi NAGAI * ext/tk/lib/tkentry.rb: TkEntry#bbox returns an array of four numbers - * ext/tk/lib/tkentry.rb: scan validatecommand arguments and + * ext/tk/lib/tkentry.rb: scan validatecommand arguments and convert to proper type * ext/tk/lib/tkbgerror.rb: support to define a error handler by user @@ -1932,7 +1932,7 @@ Fri Jun 13 09:24:39 2003 Shugo Maeda Thu Jun 12 22:13:13 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb : add 'no_create' option to widget - initialize method. + initialize method. * ext/tk/MANIFEST : forgot to commit when added tkmacpkg.rb and tkwinpkg.rb @@ -1947,7 +1947,7 @@ Thu Jun 12 21:14:11 2003 Hidetoshi NAGAI * ext/tk/lib/tkmacpkg.rb : Mac resource (not new but not included until now) - * ext/tk/lib/tkwinpkg.rb : Win DDE and registry (not new but not + * ext/tk/lib/tkwinpkg.rb : Win DDE and registry (not new but not included until now) Tue Jun 10 14:26:30 2003 why the lucky stiff @@ -8346,7 +8346,7 @@ Tue Jun 4 07:03:33 2002 Hidetoshi NAGAI * ext/tk/lib/tkfont.rb: Fix bugs on TkFont.init_widget_font for Tk8.x. - * ext/tk/lib/tkafter.rb: Add self to 1st argument of interval- + * ext/tk/lib/tkafter.rb: Add self to 1st argument of interval- and loop-proc TkAfter#current_interval returns an interval (sleep) time value TkAfter#current_args returns an array of arguments @@ -8354,7 +8354,7 @@ Tue Jun 4 07:03:33 2002 Hidetoshi NAGAI * ext/tk/lib/tk*.rb: Allow to use Symbols for parameters. - * ext/tk/lib/tkcanvas.rb: (TkcItem) Add 'coords' parameter to the + * ext/tk/lib/tkcanvas.rb: (TkcItem) Add 'coords' parameter to the canvas item constructor (for new notation of constructor). * ext/tcltklib/tcltklib.c: New 'mainloop' and 'mainloop_watchdog'. @@ -8363,7 +8363,7 @@ Tue Jun 4 07:03:33 2002 Hidetoshi NAGAI 'use' parameter. * ext/tk/lib/tk.rb: Add new parameter 'widgetname' to the widget - constructor to support effective use of Resource Database. + constructor to support effective use of Resource Database. * ext/tk/lib/tk.rb: TkOption::get always returns a tainted string. diff --git a/doc/ChangeLog-YARV b/doc/ChangeLog-YARV index c9d32916cfc076..da0668bba85555 100644 --- a/doc/ChangeLog-YARV +++ b/doc/ChangeLog-YARV @@ -86,7 +86,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * blockinlining.c, compile.c, compile.h, debug.c, debug.h, insnhelper.h, insns.def, iseq.c, thread.c, thread_pthread.ci, thread_pthread.h, thread_win32.ci, thread_win32.h, vm.c, vm.h, - vm_dump.c, vm_evalbody.ci, vm_opts.h.base, yarv.h, + vm_dump.c, vm_evalbody.ci, vm_opts.h.base, yarv.h, yarv_version.h, yarvcore.c, yarvcore.h : add a header includes copyright @@ -110,7 +110,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * signal.c : ditto - * test/ruby/test_signal.rb : + * test/ruby/test_signal.rb : * thread_pthread.ci : rename timer thread functions @@ -203,7 +203,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * ext/dbm, dl, gdbm, iconv, io, pty, sdbm : added - * test/dbm, gdbm, io, logger, net, readline, sdbm, soap, + * test/dbm, gdbm, io, logger, net, readline, sdbm, soap, webrick, win32ole, wsdl, xsd : added @@ -652,7 +652,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * vm.c : ditto - * yarvcore.c : prohibit tail call optimization to mark + * yarvcore.c : prohibit tail call optimization to mark iseq object * yarvcore.h : add some allocator function declaration @@ -906,7 +906,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * yarvcore.h : disable to use get/setcontext - * lib/webrick/server.rb : add experimental implementation + * lib/webrick/server.rb : add experimental implementation using thraeds pool @@ -1447,7 +1447,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * insns.def : ditto - * vm_dump.c : + * vm_dump.c : * intern.h : change rb_thread_signal_raise/exit interface @@ -2060,7 +2060,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2006-02-15(Wed) 17:39:16 +0900 Koichi Sasada - * eval_intern.h : + * eval_intern.h : * eval_jump.h, vm.c : localjump_error() and jump_tag_but_local_jump() move to th_localjump_error and th_jump_tag_but_local_jump at vm.c @@ -2618,123 +2618,123 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * array.c : revert last commit - * ascii.c : ditto + * ascii.c : ditto - * bignum.c : ditto + * bignum.c : ditto - * class.c : ditto + * class.c : ditto - * compar.c : ditto + * compar.c : ditto - * defines.h : ditto + * defines.h : ditto - * dir.c : ditto + * dir.c : ditto - * dln.c : ditto + * dln.c : ditto - * dln.h : ditto + * dln.h : ditto - * enum.c : ditto + * enum.c : ditto - * enumerator.c : ditto + * enumerator.c : ditto - * error.c : ditto + * error.c : ditto - * euc_jp.c : ditto + * euc_jp.c : ditto - * file.c : ditto + * file.c : ditto - * gc.c : ditto + * gc.c : ditto - * hash.c : ditto + * hash.c : ditto - * intern.h : ditto + * intern.h : ditto - * io.c : ditto + * io.c : ditto - * lex.c : ditto + * lex.c : ditto - * main.c : ditto + * main.c : ditto - * marshal.c : ditto + * marshal.c : ditto - * math.c : ditto + * math.c : ditto - * missing.h : ditto + * missing.h : ditto - * node.h : ditto + * node.h : ditto - * numeric.c : ditto + * numeric.c : ditto - * object.c : ditto + * object.c : ditto - * oniguruma.h : ditto + * oniguruma.h : ditto - * pack.c : ditto + * pack.c : ditto - * prec.c : ditto + * prec.c : ditto - * process.c : ditto + * process.c : ditto - * random.c : ditto + * random.c : ditto - * range.c : ditto + * range.c : ditto - * rb/mklog.rb : ditto + * rb/mklog.rb : ditto - * re.c : ditto + * re.c : ditto - * regcomp.c : ditto + * regcomp.c : ditto - * regenc.c : ditto + * regenc.c : ditto - * regenc.h : ditto + * regenc.h : ditto - * regerror.c : ditto + * regerror.c : ditto - * regex.h : ditto + * regex.h : ditto - * regexec.c : ditto + * regexec.c : ditto - * regint.h : ditto + * regint.h : ditto - * regparse.c : ditto + * regparse.c : ditto - * regparse.h : ditto + * regparse.h : ditto - * ruby.c : ditto + * ruby.c : ditto - * ruby.h : ditto + * ruby.h : ditto - * rubyio.h : ditto + * rubyio.h : ditto - * rubysig.h : ditto + * rubysig.h : ditto - * signal.c : ditto + * signal.c : ditto - * sjis.c : ditto + * sjis.c : ditto - * sprintf.c : ditto + * sprintf.c : ditto - * st.c : ditto + * st.c : ditto - * st.h : ditto + * st.h : ditto - * string.c : ditto + * string.c : ditto - * struct.c : ditto + * struct.c : ditto - * time.c : ditto + * time.c : ditto - * utf8.c : ditto + * utf8.c : ditto - * util.c : ditto + * util.c : ditto - * util.h : ditto + * util.h : ditto - * variable.c : ditto + * variable.c : ditto - * version.c : ditto + * version.c : ditto 2006-02-12(Sun) 21:33:10 +0900 Koichi Sasada @@ -3151,7 +3151,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2006-02-12(Sun) 05:05:02 +0900 Koichi Sasada * eval.c, eval_intern.h, eval_load.c, eval_proc.c, node.h, - insnhelper.h, insns.def, vm.c, yarvcore.c, yarvcore.h : + insnhelper.h, insns.def, vm.c, yarvcore.c, yarvcore.h : change cref data structure and unify ruby_class and ruby_cbase and some refoctoring @@ -3810,7 +3810,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * yarvtest/test_eval.rb : added - * yarvtest/test_proc.rb : + * yarvtest/test_proc.rb : 2005-12-29(Thu) 12:27:12 +0900 Koichi Sasada @@ -4091,7 +4091,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2005-12-25(Sun) 01:45:55 +0900 Koichi Sasada - * insns.def, compile.c, rb/insns2vm.rb, template/insns_info.inc.tmpl : + * insns.def, compile.c, rb/insns2vm.rb, template/insns_info.inc.tmpl : trace stack depth at compile time and use it as cont_sp for exception handling @@ -4167,7 +4167,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * compile.c, yarvcore.h : support all defined?() syntax - * compile.c : fix NODE_COLON2 + * compile.c : fix NODE_COLON2 * yarvtest/test_bin.rb : add or fix tests for above @@ -4278,7 +4278,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * insns.def : remove logic for zsuper - * template/optinsn.inc.tmpl : + * template/optinsn.inc.tmpl : * vm.c : remove thread_yield_light_prepare, thread_yield_light_invoke @@ -4292,7 +4292,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * array.c, numeric.c, range.c : add prototype of block inlining function - * blockinlining.c, vm_opts.h.base : add block inlining flag + * blockinlining.c, vm_opts.h.base : add block inlining flag * common.mk, debug.h, debug.c : add debug_breakpoint() for gdb @@ -4328,7 +4328,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * vm.c : fix to skip pushing value at "next" - * yarvcore.h : move definision of + * yarvcore.h : move definision of "struct iseq_compile_data_ensure_node_stack" to compile.c * compile.c : fix ensure catch table creation @@ -4390,7 +4390,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2005-11-29(Tue) 16:39:07 +0900 Koichi Sasada - * eval.c, eval_proc.c, vm.c, vm_macro.def : + * eval.c, eval_proc.c, vm.c, vm_macro.def : support define_method and invoke NODE_BMETHOD method @@ -4478,7 +4478,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * debug.c : add debug_v() and change to use only printf on debug_id() - * sample/test.rb : + * sample/test.rb : * vm.c : fix make_proc_from_block @@ -4539,7 +4539,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * eval.c : support rb_frame_pop() and rb_frame_callee(), add rb_sourcefile(), rb_souceline(), - + * compile.c : support postposition while/until, fix block parameter index @@ -4582,7 +4582,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * benchmark/other-lang/eval.rb : fix path - * lib/English.rb, lib/cgi.rb, lib/complex.rb, lib/delegate.rb : + * lib/English.rb, lib/cgi.rb, lib/complex.rb, lib/delegate.rb : added @@ -4712,7 +4712,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2005-10-05(Wed) 21:20:13 +0900 Koichi Sasada - * eva.c, eval_thread.c, ruby.h, eval_error.h, eval_jump.h, + * eva.c, eval_thread.c, ruby.h, eval_error.h, eval_jump.h, eval_load.c, thread.c, error.c, compile.h : remove ruby_errinfo * thread_win32.h, thread_pthread.h : set stack size to 4KB @@ -4795,7 +4795,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * thread.c, common.mk : add thread.c - * thread.c, gc.c, eval_thread.c, yarvcore.c, yarvcore.h : + * thread.c, gc.c, eval_thread.c, yarvcore.c, yarvcore.h : support native thread (on pthread) * insns.def : add YARV_CHECK_INTS() check @@ -5322,7 +5322,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * yarvcore.c, yarvcore.h : remove cYarvThrowObject (unused) - * yarvcore.c, yarvcore.h, insns.def : + * yarvcore.c, yarvcore.h, insns.def : thread_object#stack_mark_poinetr * depend, rb/eval.rb : BOPT, TOPT -> OPT @@ -5394,7 +5394,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * tmpl/vmtc.inc.tmpl : add const prefix - * /rb/asm_parse.rb, extconf.rb : added and make assembler analised output + * /rb/asm_parse.rb, extconf.rb : added and make assembler analised output * opt_operand.def : add send operands unification @@ -5493,7 +5493,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * depend : adde reconf rule - * insnhelper.h : + * insnhelper.h : * vm_evalbody.inc : rename to vm_evalbody.h @@ -5711,7 +5711,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * yarvcore.h : make type "struct iseq_compile_data" - * yarvcore.h : iseq_object#insn_info_ary to iseq_object#insn_info_tbl + * yarvcore.h : iseq_object#insn_info_ary to iseq_object#insn_info_tbl 2005-02-21(Mon) 05:24:01 +0900 Koichi Sasada @@ -5736,7 +5736,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * test/test_method.rb : add tests for above - * insns.def : opt_ltlt and + * insns.def : opt_ltlt and 2005-02-18(Fri) 08:54:40 +0900 Koichi Sasada @@ -5770,7 +5770,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * yarvcore.h, insns.def, compile.c : support defined? expression (limited) - * test/test_syn.rb : tests for above is added + * test/test_syn.rb : tests for above is added * compile.c, insns.def : support block passed method dispatch @@ -6002,7 +6002,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * vm.c (thread_dump_regs) : added - * vm.c (thread_call0, thread_call0_cfunc, thread_invoke_yield, + * vm.c (thread_call0, thread_call0_cfunc, thread_invoke_yield, thread_invoke_yield_cfunc), insns.def (yield, send) : fixed, added to support IFUNC @@ -6322,7 +6322,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2004-12-02(Thu) 13:20:41 +0900 Koichi Sasada * yarvcore.c, vm.h, vm.c, insns.def, insnhelper.h, yarvutil.rb : - add usage analisys framework + add usage analisys framework * disasm.c : insn_operand_intern to separate function @@ -6433,7 +6433,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada * yarv.h : added - * yarvcore.c, yarv.h : support yarv_is_working, yarv_block_given_p, + * yarvcore.c, yarv.h : support yarv_is_working, yarv_block_given_p, yarv_yield, yarv_funcall (only dummy function) * vm.c : thread_eval_body changed return value @@ -6488,7 +6488,7 @@ Sun Dec 31 17:42:05 2006 Koichi Sasada 2004-11-01(Mon) 04:45:54 +0900 Koichi Sasada - * yarvcore.h, compile.c, debug.c, version.h : + * yarvcore.h, compile.c, debug.c, version.h : redesgin gc debug scheme (GC_CHECK()) * yarvcore.c : mark iseqobj->current_block on GC diff --git a/doc/NEWS-1.8.7 b/doc/NEWS-1.8.7 index 460a7c93281540..84219bcbb85b16 100644 --- a/doc/NEWS-1.8.7 +++ b/doc/NEWS-1.8.7 @@ -223,7 +223,7 @@ with all sufficient information, see the ChangeLog file. * ARGF.lines * ARGF.readbyte - New methods. + New methods. * Method#name * Method#owner @@ -617,7 +617,7 @@ with all sufficient information, see the ChangeLog file. md = Digest::MD5.new("string") # After (works with any version) md = Digest::MD5.new.update("string") - + # Before hd = Digest::MD5.new("string").hexdigest # After (works with any version) diff --git a/doc/NEWS-1.9.1 b/doc/NEWS-1.9.1 index 05752330ebe065..9989477ee42f37 100644 --- a/doc/NEWS-1.9.1 +++ b/doc/NEWS-1.9.1 @@ -31,18 +31,18 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. * builtin classes and objects * Kernel and Object - o Kernel#methods and #singleton_methods used to return an + o Kernel#methods and #singleton_methods used to return an array of strings but now they return an array of symbols. * Class and Module o Module#attr works as Module#attr_reader by default. Optional boolean argument is obsolete. o Module#instance_methods, #private_instance_methods and - #public_instance_methods used to return an array of + #public_instance_methods used to return an array of strings but now they return an array of symbols. o Extra subclassing check when binding UnboundMethods - + * Exceptions - o Exceptions are equal to each other if they belong to + o Exceptions are equal to each other if they belong to the same class and have the same message and backtrace. o SystemStackError used to be a subclass of StandardError but not it is a direct subclass of Exception. @@ -71,7 +71,7 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. o Most of the changes in Hash apply to hash like interfaces such as ENV and *DBM. * IO operations - o Many methods used to act byte-wise but now some of those act + o Many methods used to act byte-wise but now some of those act character-wise. You can use alternate byte-wise methods. o IO#getc o Non-blocking IO @@ -94,7 +94,7 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. o IO#internal_encoding, IO#external_encoding, IO#set_encoding o IO.pipe takes encoding option - o Directive %u behaves like %d for negative values in + o Directive %u behaves like %d for negative values in printf-style formatting. * File and Dir operations o #to_path is called as necessary in File.path, File.chmod, @@ -168,7 +168,7 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. * Pathname o No longer has #to_str nor #=~. * time and date - o Time.parse and Date.parse interprets slashed numerical dates + o Time.parse and Date.parse interprets slashed numerical dates as "dd/mm/yyyy". * Readline o If Readline uses libedit, Readline::HISTORY[0] returns the @@ -209,15 +209,15 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. * New syntax and semantics o Magic comments to declare in which encoding your source code is written - o New literal hash syntax and new syntax for hash style - arguments + o New literal hash syntax and new syntax for hash style + arguments o New syntax for lambdas o .() and calling Procs without #call/#[] o Block in block arguments o Block local variables o Mandatory arguments after optional arguments allowed o Multiple splats allowed - o #[] can take splatted arguments, hash style arguments + o #[] can take splatted arguments, hash style arguments and a block. o New directives in printf-style formatted strings (%). o Newlines allowed before ternary colon operator (:) and @@ -263,7 +263,7 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. * Enumerable and Enumerator o Enumerator#enum_cons and Enumerator#enum_slice are - removed. Use #each_cons and #each_slice without a block. + removed. Use #each_cons and #each_slice without a block. o Enumerable#each_with_index can take optional arguments and passes them to #each. o Enumerable#each_with_object @@ -386,7 +386,7 @@ See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. o Readline.emacs_editing_mode? o Readline::HISTORY.clear * Tk - o TkXXX widget classes are removed and redefined as aliases of + o TkXXX widget classes are removed and redefined as aliases of Tk::XXX classes. * RDoc o Updated to version 2.2.2. See: diff --git a/doc/forwardable.rd b/doc/forwardable.rd index 0eca25b90a9988..091c8a51b1480a 100644 --- a/doc/forwardable.rd +++ b/doc/forwardable.rd @@ -1,5 +1,5 @@ -- forwardable.rb - + $Release Version: 1.1 $ $Revision$ Original version by Tosh @@ -13,7 +13,7 @@ A Module to define delegations for selected methods to a class. == Usage Using through extending the class. - + class Foo extend Forwardable @@ -34,7 +34,7 @@ Using through extending the class. ((|accessor|)). --- Forwardable#def_instance_delegator(accessor, method, ali = method) - + adding the delegation for ((|method|)) to ((|accessor|)). When you give optional argument ((|ali|)), ((|ali|)) is used as the name of the delegation method, instead of ((|method|)). @@ -44,7 +44,7 @@ Using through extending the class. the alias of ((|Forwardable#def_instance_delegators|)). --- Forwardable#def_delegator(accessor, method, ali = method) - + the alias of ((|Forwardable#def_instance_delegator|)). = SingleForwardable diff --git a/doc/forwardable.rd.ja b/doc/forwardable.rd.ja index 48186b111f24e5..125e2288e8271d 100644 --- a/doc/forwardable.rd.ja +++ b/doc/forwardable.rd.ja @@ -9,8 +9,8 @@ == 使い方 -クラスに対してextendして使います. - +クラスに対してextendして使います. + class Foo extend Forwardable @@ -50,7 +50,7 @@ == 使い方 -オブジェクトに対して((|extend|))して使います. +オブジェクトに対して((|extend|))して使います. g = Goo.new g.extend SingleForwardable diff --git a/doc/irb/irb-tools.rd.ja b/doc/irb/irb-tools.rd.ja index 7711f96e08af25..6496b31adb242f 100644 --- a/doc/irb/irb-tools.rd.ja +++ b/doc/irb/irb-tools.rd.ja @@ -112,7 +112,7 @@ XMP マルチスレッドには対応していません. = frame.rb -現在実行中のフレーム情報を取り扱うためのクラスです. +現在実行中のフレーム情報を取り扱うためのクラスです. * IRB::Frame.top(n = 0) 上からn番目のコンテキストを取り出します. nは0が最上位になります. @@ -127,7 +127,7 @@ set_trace_func は対応していません. = completion.rb -irbのcompletion機能を提供するものです. +irbのcompletion機能を提供するものです. == 使い方 @@ -144,7 +144,7 @@ irb トップレベルで(TAB)を押すとすべての構文要素, クラス, メソッドの候補がで ます. 候補が唯一ならば完全に補完します. - irb(main):001:0> in + irb(main):001:0> in in inspect instance_eval include install_alias_method instance_of? initialize install_aliases instance_variables @@ -168,8 +168,8 @@ irb foo.dup foo.kind_of? foo.to_s foo.eql? foo.method foo.type foo.equal? foo.methods foo.untaint - foo.extend foo.nil? - foo.freeze foo.private_methods + foo.extend foo.nil? + foo.freeze foo.private_methods =end diff --git a/doc/irb/irb.rd b/doc/irb/irb.rd index 8468809d2b8604..e8470a1187c5bd 100644 --- a/doc/irb/irb.rd +++ b/doc/irb/irb.rd @@ -8,7 +8,7 @@ irb -- interactive ruby = What is irb? irb stands for `interactive ruby'. irb is a tool to execute interactively -ruby expressions read from stdin. +ruby expressions read from stdin. = Invoking @@ -16,9 +16,9 @@ ruby expressions read from stdin. = Usage -Use of irb is easy if you know ruby. Executing irb, prompts are +Use of irb is easy if you know ruby. Executing irb, prompts are displayed as follows. Then, enter expression of ruby. A input is -executed when it is syntacticaly completed. +executed when it is syntacticaly completed. dim% irb irb(main):001:0> 1+2 @@ -29,16 +29,16 @@ executed when it is syntacticaly completed. irb(main):005:2> end irb(main):006:1> end nil - irb(main):007:0> + irb(main):007:0> And, Readline extesion module can be used with irb. Using Readline -is the standard default action if Readline is installed. +is the standard default action if Readline is installed. = Command line option irb.rb [options] file_name opts options: - -f suppress read ~/.irbrc + -f suppress read ~/.irbrc -m bc mode (fraction or matrix are available) -d set $DEBUG to true (same as `ruby -d') -Kc same as `ruby -Kc' @@ -55,25 +55,25 @@ is the standard default action if Readline is installed. --prompt-mode prompt-mode switches prompt mode. Pre-defined prompt modes are `default', `simple', `xmp' and `inf-ruby' - - --inf-ruby-mode uses prompt appreciate for inf-ruby-mode on emacs. - Suppresses --readline. + + --inf-ruby-mode uses prompt appreciate for inf-ruby-mode on emacs. + Suppresses --readline. --simple-prompt simple prompt mode --noprompt no prompt --tracer display trace for each execution of commands. --back-trace-limit n displayes backtrace top n and tail n. The default - value is 16. + value is 16. --irb_debug n sets internal debug level to n (It shouldn't be used) -v, --version prints the version of irb = Configurations irb reads `~/.irbrc' when it is invoked. If `~/.irbrb' doesn't exist -irb try to read in the order `.irbrc', `irb.rc', `_irbrc' then `$irbrc'. +irb try to read in the order `.irbrc', `irb.rc', `_irbrc' then `$irbrc'. The following is altanative to the command line option. To use them -type as follows in an irb session. +type as follows in an irb session. IRB.conf[:IRB_NAME]="irb" IRB.conf[:MATH_MODE]=false @@ -100,7 +100,7 @@ To costomize the prompt you set a variable IRB.conf[:PROMPT] -For example, describe as follows in `.irbrc'. +For example, describe as follows in `.irbrc'. IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode :PROMPT_I => nil, # normal prompt @@ -113,20 +113,20 @@ Then, invoke irb with the above prompt mode by % irb --prompt my-prompt -Or add the following in `.irbrc'. +Or add the following in `.irbrc'. IRB.conf[:PROMPT_MODE] = :MY_PROMPT -Constants PROMPT_I, PROMPT_S and PROMPT_C specifies the format. -In the prompt specification, some special strings are available. +Constants PROMPT_I, PROMPT_S and PROMPT_C specifies the format. +In the prompt specification, some special strings are available. %N command name which is running %m to_s of main object (self) %M inspect of main object (self) %l type of string(", ', /, ]), `]' is inner %w[...] - %NNi indent level. NN is degits and means as same as printf("%NNd"). + %NNi indent level. NN is degits and means as same as printf("%NNd"). It can be ommited - %NNn line number. + %NNn line number. %% % For instance, the default prompt mode is defined as follows: @@ -136,70 +136,70 @@ IRB.conf[:PROMPT_MODE][:DEFAULT] = { :PROMPT_S => "%N(%m):%03n:%i%l ", :PROMPT_C => "%N(%m):%03n:%i* ", :RETURN => "%s\n" -} +} -RETURN is used to printf. +RETURN is used to printf. == Configurating subirb The command line option or IRB.conf specify the default behavior of -(sub)irb. On the other hand, each conf of in the next sction `6. Command' -is used to individually configurate (sub)irb. +(sub)irb. On the other hand, each conf of in the next sction `6. Command' +is used to individually configurate (sub)irb. If proc is set to IRB.conf[:IRB_RC], its subirb will be invoked after execution of that proc under giving the context of irb as its -aregument. By this mechanism each subirb can be configurated. +aregument. By this mechanism each subirb can be configurated. = Command -For irb commands, both simple name and `irb_'-prefixed name are prepared. +For irb commands, both simple name and `irb_'-prefixed name are prepared. ---- exit, quit, irb_exit - Quits (sub)irb. +--- exit, quit, irb_exit + Quits (sub)irb. --- conf, irb_context Displays current configuration. Modifing the configuration is - achieved by sending message to `conf'. + achieved by sending message to `conf'. --- conf.eval_history = N Sets execution result history. - N is a integer or nil. If N > 0, the number of historys is N. + N is a integer or nil. If N > 0, the number of historys is N. If N == 0, the number of historys is unlimited. If N is nill, execution result history isn't used(default). --- conf.back_trace_limit - Sets display lines of backtrace as top n and tail n. + Sets display lines of backtrace as top n and tail n. The default value is 16. - + --- conf.debug_level = N - Sets debug level of irb. + Sets debug level of irb. --- conf.ignore_eof = true/false - Whether ^D (control-d) will be ignored or not. - If false is set, ^D means quit. + Whether ^D (control-d) will be ignored or not. + If false is set, ^D means quit. --- conf.ignore_sigint= true/false - Whether ^C (control-c) will be ignored or not. - If false is set, ^D means quit. If true, - during input: cancel inputing then return to top level. - during execute: abondon current execution. + Whether ^C (control-c) will be ignored or not. + If false is set, ^D means quit. If true, + during input: cancel inputing then return to top level. + during execute: abondon current execution. --- conf.inf_ruby_mode = true/false Whether inf-ruby-mode or not. The default value is false. --- conf.inspect_mode = true/false/nil - Specifies inspect mode. + Specifies inspect mode. true: display inspect false: display to_s - nil: inspect mode in non math mode, - non inspect mode in math mode. + nil: inspect mode in non math mode, + non inspect mode in math mode. --- conf.math_mode - Whether bc mode or not. + Whether bc mode or not. --- conf.use_loader = true/false - Whether irb's own file reader method is used when load/require or not. - This mode is globaly affected (irb wide). + Whether irb's own file reader method is used when load/require or not. + This mode is globaly affected (irb wide). --- conf.prompt_c prompt for a continuating statement (e.g, immediately after of `if') @@ -211,19 +211,19 @@ For irb commands, both simple name and `irb_'-prefixed name are prepared. prompt for a continuating string --- conf.rc - Whether ~/.irbrc is read or not. + Whether ~/.irbrc is read or not. --- conf.use_prompt = true/false - Prompting or not. + Prompting or not. --- conf.use_readline = true/false/nil - Whether readline is used or not. - true: uses + Whether readline is used or not. + true: uses false: doen't use nil: intends to use readline except for inf-ruby-mode (default) # #--- conf.verbose=T/F -# Whether verbose messages are display or not. +# Whether verbose messages are display or not. --- cws, chws, irb_change_workspace [obj] obj will be self. If obj is omitted, self will be home-object, or @@ -236,7 +236,7 @@ For irb commands, both simple name and `irb_'-prefixed name are prepared. same as UNIX-shell command popd --- irb [obj] - Invoke subirb. If obj is given, obj will be self. + Invoke subirb. If obj is given, obj will be self. --- jobs, irb_jobs List of subirb @@ -250,7 +250,7 @@ For irb commands, both simple name and `irb_'-prefixed name are prepared. self(obj which is specified of irb obj) --- kill n, irb_kill n - Kill subirb. The means of n is as same as the case of irb_fg. + Kill subirb. The means of n is as same as the case of irb_fg. --- souce, irb_source path This is a like UNIX-shell command source. evaluate script in path @@ -279,7 +279,7 @@ For irb commands, both simple name and `irb_'-prefixed name are prepared. nil irb(main):002:0> class Foo;end nil - irb(main):003:0> irb Foo # invoke subirb which has the + irb(main):003:0> irb Foo # invoke subirb which has the # context of Foo irb#2(Foo):001:0> def foo # define Foo#foo irb#2(Foo):002:1> print 1 @@ -302,7 +302,7 @@ For irb commands, both simple name and `irb_'-prefixed name are prepared. nil irb#2(Foo):010:0> Foo.instance_methods ["bar", "foo"] - irb#2(Foo):011:0> fg 0 + irb#2(Foo):011:0> fg 0 nil irb(main):007:0> f = Foo.new # @@ -324,13 +324,13 @@ For irb commands, both simple name and `irb_'-prefixed name are prepared. #0->irb on main (# : running) nil irb(main):010:0> exit # exit - dim% + dim% = Restrictions Because irb evaluates the inputs immediately after the imput is syntactically completed, irb gives slight different result than -directly use ruby. Known difference is pointed out here. +directly use ruby. Known difference is pointed out here. == Declaration of the local variable @@ -344,7 +344,7 @@ The following causes an error in ruby: --- NameError -Though, the above will successfully done by irb. +Though, the above will successfully done by irb. >> eval "foo = 0" => 0 @@ -355,7 +355,7 @@ Ruby evaluates a code after reading entire of code and determination of the scope of local variables. On the other hand, irb do immediately. More precisely, irb evaluate at first - evel "foo = 0" + evel "foo = 0" then foo is defined on this timing. It is because of this incompatibility. @@ -372,7 +372,7 @@ If you'd like to detect those differences, begin...end can be used: == Here-document -Implementation of Here-document is incomplete. +Implementation of Here-document is incomplete. == Symbol diff --git a/doc/irb/irb.rd.ja b/doc/irb/irb.rd.ja index 53f76180ec8515..b536fa27a046b2 100644 --- a/doc/irb/irb.rd.ja +++ b/doc/irb/irb.rd.ja @@ -12,7 +12,7 @@ irb % irb -で行ないます. +で行ないます. = 使い方 @@ -30,7 +30,7 @@ irb irb(main):005:2> end irb(main):006:1> end nil - irb(main):007:0> + irb(main):007:0> また, irbはReadlineモジュールにも対応しています. Readlineモジュールが インストールされている時には, それを使うのが標準の動作になります. @@ -48,19 +48,19 @@ irb --noverbose これから実行する行を表示しない --echo 実行結果を表示する(デフォルト) --noecho 実行結果を表示しない - --inspect 結果出力にinspectを用いる(bcモード以外はデフォルト). + --inspect 結果出力にinspectを用いる(bcモード以外はデフォルト). --noinspect 結果出力にinspectを用いない. --readline readlineライブラリを利用する. --noreadline readlineライブラリを利用しない. デフォルトの動作は, inf-ruby-mode以外でreadlineライブラリを利用しよう - とする. + とする. --prompt prompt-mode --prompt-mode prompt-mode プロンプトモードを切替えます. 現在定義されているプ ロンプトモードは, default, simple, xmp, inf-rubyが 用意されています. デフォルトはdefaultプロンプトモー ドになっています. - + --inf-ruby-mode emacsのinf-ruby-mode用のプロンプト表示を行なう. 特 に指定がない限り, readlineライブラリは使わなくなる. --simple-prompt @@ -69,7 +69,7 @@ irb --tracer コマンド実行時にトレースを行なう. --back-trace-limit n バックトレース表示をバックトレースの頭から n, 後ろ - からnだけ行なう. デフォルトは16 + からnだけ行なう. デフォルトは16 --irb_debug n irbのデバッグデバッグレベルをnに設定する(利用しな い方が無難でしょう). -v, --version irbのバージョンを表示する @@ -103,7 +103,7 @@ irb == プロンプトの設定 -プロンプトをカスタマイズしたい時には, +プロンプトをカスタマイズしたい時には, IRB.conf[:PROMPT] @@ -145,7 +145,7 @@ PROMPT_I, PROMPT_N, PROMPT_S, PROMPT_C :PROMPT_S => "%N(%m):%03n:%i%l ", :PROMPT_C => "%N(%m):%03n:%i* ", :RETURN => "%s\n" - } + } となっています. @@ -167,34 +167,34 @@ proc irb拡張コマンドは, 簡単な名前と頭に`irb_'をつけた名前と両方定義されて います. これは, 簡単な名前がoverrideされた時のためです. ---- exit, quit, irb_exit - 終了する. +--- exit, quit, irb_exit + 終了する. サブirbの場合, そのサブirbを終了する. --- conf, irb_context irbの現在の設定を表示する. 設定の変更は, confにメッセージを送るこ - とによって行なえる. + とによって行なえる. --- conf.eval_history = N 実行結果のヒストリ機能の設定. nnは整数かnilで nn>0 であればその数だけヒストリにためる。nn==0の時は - 無制限に記憶する、nilだとヒストリ機能はやめる(デフォルト). + 無制限に記憶する、nilだとヒストリ機能はやめる(デフォルト). --- Conf.back_trace_limit バックトレース表示をバックトレースの頭からn, 後ろからnだけ行なう. デフォルトは16 - + --- conf.debug_level = N irb用のデバッグレベルの設定 --- conf.ignore_eof = true/false ^Dが入力された時の動作を設定する. trueの時は^Dを無視する, falseの - 時はirbを終了する. + 時はirbを終了する. --- conf.ignore_sigint= true/false ^Cが入力された時の動作を設定する. false時は, irbを終了する. trueの 時の動作は以下のようになる: - 入力中: これまで入力したものをキャンセルしトップレベルに戻る. + 入力中: これまで入力したものをキャンセルしトップレベルに戻る. 実行中: 実行を中止する. --- conf.inf_ruby_mode = true/false @@ -205,7 +205,7 @@ irb true: インスペクトして表示する. false: 通常のprintで表示する. nil: 通常モードであれば, inspect modeとなり, mathモードの時は, non - inspect modeとなる. + inspect modeとなる. --- conf.math_mode 参照のみ. bcモード(分数, 行列の計算ができます)かどうか? @@ -234,7 +234,7 @@ irb true: readlineを使う. false: readlineを使わない. nil: (デフォルト)inf-ruby-mode以外でreadlineライブラリを利用しよ - うとする. + うとする. # #--- conf.verbose=T/F # irbからいろいろなメッセージを出力するか? @@ -276,9 +276,9 @@ irb = システム変数 ---- _ +--- _ 前の計算の実行結果を覚えている(ローカル変数). ---- __ +--- __ 実行結果の履歴を覚えている. __[line_no]で、その行で実行した結果を得ることができる. line_noが負の 時には、最新の結果から-line_no前の結果を得ることができる. @@ -321,7 +321,7 @@ irb nil irb#2(Foo):010:0> Foo.instance_methods ["bar", "foo"] - irb#2(Foo):011:0> fg 0 + irb#2(Foo):011:0> fg 0 nil irb(main):007:0> f = Foo.new # @@ -343,7 +343,7 @@ irb #0->irb on main (# : running) nil irb(main):010:0> exit # 終了 - dim% + dim% = 使用上の制限 @@ -372,11 +372,11 @@ ruby となり, エラーを起こしません. これは, rubyが最初にスクリプト全体をコン パイルしてローカル変数を決定するからです. それに対し, irbは実行可能に -なる(式が閉じる)と自動的に評価しているからです. 上記の例では, +なる(式が閉じる)と自動的に評価しているからです. 上記の例では, - evel "foo = 0" + evel "foo = 0" -を行なった時点で評価を行ない, その時点で変数が定義されるため, 次式で +を行なった時点で評価を行ない, その時点で変数が定義されるため, 次式で 変数fooは定義されているからです. このようなrubyとirbの動作の違いを解決したい場合は, begin...endで括って @@ -392,7 +392,7 @@ ruby == ヒアドキュメント -現在のところヒアドキュメントの実装は不完全です. +現在のところヒアドキュメントの実装は不完全です. == シンボル diff --git a/doc/rake/CHANGES b/doc/rake/CHANGES index 3b1a02b812e0c9..4f5695d8558f9b 100644 --- a/doc/rake/CHANGES +++ b/doc/rake/CHANGES @@ -36,7 +36,7 @@ * Fixed stray ARGV option problem that was interfering with Test::Unit::Runner. -* Fixed default verbose mode (was accidently changed to false). +* Fixed default verbose mode (was accidently changed to false). * Removed reference to manage_gem to fix the warning produced by the gem package task. @@ -49,7 +49,7 @@ directory. * Added fix to handle ruby installations in directories with spaces in - their name. + their name. == Version 0.8.2 @@ -87,7 +87,7 @@ * Changed from using Mutex to Monitor. Evidently Mutex causes thread join errors when Ruby is compiled with -disable-pthreads. (Patch - supplied by Ittay Dror) + supplied by Ittay Dror) * Fixed bug in makefile parser that had problems with extra spaces in file task names. (Patch supplied by Ittay Dror) @@ -142,14 +142,14 @@ * Fixed some bugs where the application object was going to the global appliation instead of using its own data. * Added square and curly bracket patterns to FileList#include (Tilman - Sauerbeck). + Sauerbeck). * Added plain filename support to rule dependents (suggested by Nobu - Nakada). + Nakada). * Added pathmap support to rule dependents. * Added a 'tasks' method to a namespace to get a list of tasks associated with the namespace. * Fixed the method name leak from FileUtils (bug found by Glenn - Vanderburg). + Vanderburg). * Added rake_extension to handle detection of extension collisions. * Added test for noop, bad_option and verbose flags to sh command. * Removed dependency on internal fu_xxx functions from FileUtils. @@ -270,7 +270,7 @@ * Fixed a bug that prevented the TESTOPTS flag from working with the revised for 1.8.2 test task. * Updated the docs on --trace to indicate that it also enables a full - backtrace on errors. + backtrace on errors. == Version 0.4.14 diff --git a/doc/rake/README b/doc/rake/README index 41668dd7275746..a3360ad91593da 100644 --- a/doc/rake/README +++ b/doc/rake/README @@ -1,4 +1,4 @@ -= RAKE -- Ruby Make += RAKE -- Ruby Make Supporting Rake version: 0.8.6 @@ -52,7 +52,7 @@ First, you must write a "Rakefile" file which contains the build rules. Here's a simple example: task :default => [:test] - + task :test do ruby "test/unittest.rb" end diff --git a/doc/rake/command_line_usage.rdoc b/doc/rake/command_line_usage.rdoc index c60e53f51a23ff..bc75d5fec84514 100644 --- a/doc/rake/command_line_usage.rdoc +++ b/doc/rake/command_line_usage.rdoc @@ -9,7 +9,7 @@ Options are: [name=value] Set the environment variable name to value during the execution of the rake command. You can access - the value by using ENV['name']. + the value by using ENV['name']. [--classic-namespace (-n)] Import the Task, FileTask, and FileCreateTask into the top-level diff --git a/doc/rake/glossary.rdoc b/doc/rake/glossary.rdoc index 0ca1869306973a..920ddc2c44e96d 100644 --- a/doc/rake/glossary.rdoc +++ b/doc/rake/glossary.rdoc @@ -39,7 +39,7 @@ [prerequisites] Every task has a set (possiblity empty) of prerequisites. A prerequisite P to Task T is itself a task that must be invoked - before Task T. + before Task T. [rule] A rule is a recipe for synthesizing a task when no task is diff --git a/doc/rake/jamis.rb b/doc/rake/jamis.rb index c7439d88ea7334..c7bc84ac5b6875 100644 --- a/doc/rake/jamis.rb +++ b/doc/rake/jamis.rb @@ -183,7 +183,7 @@ module Page CSS XHTML_PREAMBLE = %{ - } @@ -510,7 +510,7 @@ module Page @@ -50,8 +50,8 @@ } } //--> - - + +
@@ -186,13 +186,13 @@ There are also an "unofficial" release for 8.0p2 and 8.1a2 that were not done by the author. Edit(October 26, 1999 09:43)
BWidget -
A set of native Tk 8.x Widgets using Tcl8.x namespaces. +
A set of native Tk 8.x Widgets using Tcl8.x namespaces. The ToolKit is available under Unix/X11 and Windows. -The BWidget(s) have a professional look&feel as in other -well known Toolkits (Tix or Incr Widget) but the concept is -radically different because everything is native +The BWidget(s) have a professional look&feel as in other +well known Toolkits (Tix or Incr Widget) but the concept is +radically different because everything is native so no platform compilation, no compiled extension -library are needed. The code is 100 Pure Tcl/Tk. +library are needed. The code is 100 Pure Tcl/Tk. More 30 components : Notebook, PageManager, Tree, PanedWindow, ButtonBox, ScrollView, ComboBox, SpinBox, ListBox, SelectFont, SelectColor, ProgressBare ... Edit @@ -220,10 +220,10 @@
This project seeks to integrate the Tk toolkit with the Frontier scripting language. Edit (August 19, 1999 15:36)
Img image format extension -
This package enhances Tk, adding support for many other Image formats: +
This package enhances Tk, adding support for many other Image formats: BMP, XBM, XPM, GIF (with transparency), PNG, JPEG, TIFF and postscript. -This is implemented as a shared library that can be dynamically loaded into +This is implemented as a shared library that can be dynamically loaded into Tcl/Tk. Edit (November 21, 1999 06:35)
mclistbox - a multi-column listbox widget @@ -234,7 +234,7 @@ standalone. Edit (August 19, 1999 15:37)
MFC views C++ class for embedding Tk
The idea of embedding Tk in MFC windows always seemed very enticing but information was sparse and contradictory - on a - scale between "very easy" and "not yet possible". The only thing for it was to have a go and lo, it wasn't that hard after all. + scale between "very easy" and "not yet possible". The only thing for it was to have a go and lo, it wasn't that hard after all. CTkView is a C++ class which can be used in MFC SDI or MDI applications. An instance of CTkView hosts an embedded Tk toplevel widget and performs some management chores for the widget so that it can size, update and react correctly to Windows events. Edit @@ -244,7 +244,7 @@ Works with 8.0
Download: download.html
Pad++ is a Tk widget that provides a Zoomable User Interface (ZUI) that supports real-time interactive zoomable graphics in a fashion similar to the Tk Canvas widget. Pad++ supports tens of thousands of objects which include text, images, graphics, portals, lenses, simple html (and more), including transparency and rotation. Edit (August 19, 1999 15:39)
Progressbar -
Progressbar is a megawidget written in pure tcl (ie: no compiling required - runs on all platforms Macintosh, Unix, Windows). +
Progressbar is a megawidget written in pure tcl (ie: no compiling required - runs on all platforms Macintosh, Unix, Windows). Its primary purpose is to show the progress of any action in percent. Edit (January 24, 2000 09:19)
scwoop (Simple Composite Widget Object Oriented Package)
Scwoop is a composite widget (also known as mega widget) extension to the great Tk widget library. Scwoop is @@ -287,7 +287,7 @@
TkPrint is an extension that allows you to print from a Tk widget. Edit (October 11, 1999 09:58)
TkTable Home Page -
The TkTable widget. The table command creates a +
The TkTable widget. The table command creates a 2-dimensional grid of cells. The table can use a Tcl array variable or Tcl command for data storage and retrieval. Edit @@ -303,14 +303,14 @@ distribution. Edit (August 23, 1999 12:14)
ToGL - a Tk Open GL widget
Togl is a Tk widget for OpenGL rendering. Togl is based on OGLTK, originally written by Benjamin Bederson at the -University of New Mexico (who has since moved to the University of Maryland). Togl adds the new features: +University of New Mexico (who has since moved to the University of Maryland). Togl adds the new features:
    -
  • color-index mode support including color allocation functions -
  • support for requesting stencil, accumulation, alpha buffers, etc -
  • multiple OpenGL drawing widgets -
  • OpenGL extension testing from Tcl -
  • simple, portable font support -
  • overlay plane support +
  • color-index mode support including color allocation functions +
  • support for requesting stencil, accumulation, alpha buffers, etc +
  • multiple OpenGL drawing widgets +
  • OpenGL extension testing from Tcl +
  • simple, portable font support +
  • overlay plane support
Togl allows one to create and manage a special Tk/OpenGL widget with Tcl and render into it with a C program. That is, a typical Togl program will have Tcl code for managing the user interface and a C program for computations and @@ -383,7 +383,7 @@ Works with Tcl/Tk 8.0 or higher
Download: widget-0.9.tar.gz
This is a package of megawidgets (i.e., compound widgets) that work almost exactly like Tk widgets. - You can also build your own new megawidgets. + You can also build your own new megawidgets. Includes: combobox, hierarchy, console, progressbar, tabnotebook, validating entry, pane geometry manager, baloon help. Edit (August 23, 1999 12:16) @@ -419,14 +419,14 @@ over[9].src = "http://images.scriptics.com/images/homeMainRollover3.gif" } - + function MakeImageArray(n) { this.length = n for (var i = 0; i<=n; i++)="i++)" {="{" this[i]="this[i]" ="" new="new" Image()="Image()" }="}" return="return" this="this" }="}" //="//" --="--">
© 1998-2000 Scriptics Corporation. All rights reserved. - Legal Notice | + Legal Notice | Privacy Statement
diff --git a/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension b/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension index 7f515feee8c079..23238e9c66c996 100644 --- a/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension +++ b/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension @@ -30,7 +30,7 @@ MODIFICATIONS. GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal +in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the @@ -38,4 +38,4 @@ Government shall have only "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the -terms specified in this license. +terms specified in this license. diff --git a/ext/tk/sample/tkextlib/tkimg/readme.txt b/ext/tk/sample/tkextlib/tkimg/readme.txt index 4d9774492c71b7..8e4b0163b1c57f 100644 --- a/ext/tk/sample/tkextlib/tkimg/readme.txt +++ b/ext/tk/sample/tkextlib/tkimg/readme.txt @@ -1,3 +1,3 @@ -The script 'demo.rb' is based on 'demo.tcl' of Tcl/Tk's 'Img' extention. +The script 'demo.rb' is based on 'demo.tcl' of Tcl/Tk's 'Img' extention. Image data in 'demo.rb' is those of 'demo.tcl'. Please read 'license_terms_of_Img_extension' file. diff --git a/ext/tk/sample/tkextlib/treectrl/readme.txt b/ext/tk/sample/tkextlib/treectrl/readme.txt index 9f26ac069cf48a..bda4f63d88bcb2 100644 --- a/ext/tk/sample/tkextlib/treectrl/readme.txt +++ b/ext/tk/sample/tkextlib/treectrl/readme.txt @@ -1,2 +1,2 @@ The scripts and image files in this directory are based on demo files -of Tcl/Tk's TreeCtrl extention. +of Tcl/Tk's TreeCtrl extention. diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c index 4388fb294d4046..608feab65d0798 100644 --- a/ext/tk/stubs.c +++ b/ext/tk/stubs.c @@ -40,7 +40,7 @@ _nativethread_consistency_check(ip) return; } - /* If the variable "tcl_platform(threaded)" exists, + /* If the variable "tcl_platform(threaded)" exists, then the Tcl interpreter was compiled with threads enabled. */ if (Tcl_GetVar2(ip, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != (char*)NULL) { #ifdef HAVE_NATIVETHREAD @@ -189,13 +189,13 @@ ruby_open_tcltk_dll(appname) return( ruby_open_tcl_dll(appname) || ruby_open_tk_dll() ); } -int +int tcl_stubs_init_p() { return(tclStubsPtr != (TclStubs*)NULL); } -int +int tk_stubs_init_p() { return(tkStubsPtr != (TkStubs*)NULL); @@ -240,14 +240,14 @@ ruby_tcl_create_ip_and_stubs_init(st) } } - p_Tcl_CreateInterp + p_Tcl_CreateInterp = (Tcl_Interp *(*)())DL_SYM(tcl_dll, "Tcl_CreateInterp"); if (!p_Tcl_CreateInterp) { if (st) *st = NO_CreateInterp; return (Tcl_Interp*)NULL; } - p_Tcl_DeleteInterp + p_Tcl_DeleteInterp = (Tcl_Interp *(*)())DL_SYM(tcl_dll, "Tcl_DeleteInterp"); if (!p_Tcl_DeleteInterp) { if (st) *st = NO_DeleteInterp; @@ -438,7 +438,7 @@ ruby_open_tcl_dll(appname) return TCLTK_STUBS_OK; } -int +int ruby_open_tk_dll() { if (!open_tcl_dll) { @@ -449,7 +449,7 @@ ruby_open_tk_dll() return TCLTK_STUBS_OK; } -int +int #ifdef HAVE_PROTOTYPES ruby_open_tcltk_dll(char *appname) #else @@ -460,13 +460,13 @@ ruby_open_tcltk_dll(appname) return( ruby_open_tcl_dll(appname) || ruby_open_tk_dll() ); } -int +int tcl_stubs_init_p() { return 1; } -int +int tk_stubs_init_p() { return call_tk_stubs_init; @@ -499,13 +499,13 @@ ruby_tcl_create_ip_and_stubs_init(st) return tcl_ip; } -int +int ruby_tcl_stubs_init() { return TCLTK_STUBS_OK; } -int +int #ifdef HAVE_PROTOTYPES ruby_tk_stubs_init(Tcl_Interp *tcl_ip) #else @@ -553,7 +553,7 @@ ruby_tk_stubs_safeinit(tcl_ip) #endif } -int +int ruby_tcltk_stubs() { /* Tcl_FindExecutable(RSTRING_PTR(rb_argv0)); */ diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 2938536cdaba77..b31b5fb074f5fa 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -82,9 +82,9 @@ set_tcltk_version() { if (tcltk_version.major) return; - Tcl_GetVersion(&(tcltk_version.major), - &(tcltk_version.minor), - &(tcltk_version.patchlevel), + Tcl_GetVersion(&(tcltk_version.major), + &(tcltk_version.minor), + &(tcltk_version.patchlevel), &(tcltk_version.type)); } @@ -401,7 +401,7 @@ struct call_queue { VALUE thread; }; -void +void invoke_queue_mark(struct invoke_queue *q) { rb_gc_mark(q->interp); @@ -409,7 +409,7 @@ invoke_queue_mark(struct invoke_queue *q) rb_gc_mark(q->thread); } -void +void eval_queue_mark(struct eval_queue *q) { rb_gc_mark(q->interp); @@ -417,7 +417,7 @@ eval_queue_mark(struct eval_queue *q) rb_gc_mark(q->thread); } -void +void call_queue_mark(struct call_queue *q) { int i; @@ -444,7 +444,7 @@ static VALUE watchdog_thread; Tcl_Interp *current_interp; -/* thread control strategy */ +/* thread control strategy */ /* multi-tk works with the following settings only ??? : CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE 1 : USE_TOGGLE_WINDOW_MODE_FOR_IDLE 0 @@ -464,11 +464,11 @@ Tcl_Interp *current_interp; static int have_rb_thread_waiting_for_value = 0; #endif -/* - * 'event_loop_max' is a maximum events which the eventloop processes in one - * term of thread scheduling. 'no_event_tick' is the count-up value when - * there are no event for processing. - * 'timer_tick' is a limit of one term of thread scheduling. +/* + * 'event_loop_max' is a maximum events which the eventloop processes in one + * term of thread scheduling. 'no_event_tick' is the count-up value when + * there are no event for processing. + * 'timer_tick' is a limit of one term of thread scheduling. * If 'timer_tick' == 0, then not use the timer for thread scheduling. */ #ifdef RUBY_USE_NATIVE_THREAD @@ -871,18 +871,18 @@ tcltkip_init_tk(interp) case TCLTK_STUBS_OK: break; case NO_Tk_Init: - return rb_exc_new2(rb_eLoadError, + return rb_exc_new2(rb_eLoadError, "tcltklib: can't find Tk_SafeInit()"); case FAIL_Tk_Init: - return create_ip_exc(interp, rb_eRuntimeError, - "tcltklib: fail to Tk_SafeInit(). %s", + return create_ip_exc(interp, rb_eRuntimeError, + "tcltklib: fail to Tk_SafeInit(). %s", Tcl_GetStringResult(ptr->ip)); case FAIL_Tk_InitStubs: - return create_ip_exc(interp, rb_eRuntimeError, - "tcltklib: fail to Tk_InitStubs(). %s", + return create_ip_exc(interp, rb_eRuntimeError, + "tcltklib: fail to Tk_InitStubs(). %s", Tcl_GetStringResult(ptr->ip)); default: - return create_ip_exc(interp, rb_eRuntimeError, + return create_ip_exc(interp, rb_eRuntimeError, "tcltklib: unknown error(%d) on ruby_tk_stubs_safeinit", st); } } else { @@ -892,18 +892,18 @@ tcltkip_init_tk(interp) case TCLTK_STUBS_OK: break; case NO_Tk_Init: - return rb_exc_new2(rb_eLoadError, + return rb_exc_new2(rb_eLoadError, "tcltklib: can't find Tk_Init()"); case FAIL_Tk_Init: - return create_ip_exc(interp, rb_eRuntimeError, - "tcltklib: fail to Tk_Init(). %s", + return create_ip_exc(interp, rb_eRuntimeError, + "tcltklib: fail to Tk_Init(). %s", Tcl_GetStringResult(ptr->ip)); case FAIL_Tk_InitStubs: - return create_ip_exc(interp, rb_eRuntimeError, - "tcltklib: fail to Tk_InitStubs(). %s", + return create_ip_exc(interp, rb_eRuntimeError, + "tcltklib: fail to Tk_InitStubs(). %s", Tcl_GetStringResult(ptr->ip)); default: - return create_ip_exc(interp, rb_eRuntimeError, + return create_ip_exc(interp, rb_eRuntimeError, "tcltklib: unknown error(%d) on ruby_tk_stubs_init", st); } } @@ -936,7 +936,7 @@ pending_exception_check0() if (!NIL_P(exc) && rb_obj_is_kind_of(exc, rb_eException)) { DUMP1("find a pending exception"); - if (rbtk_eventloop_depth > 0 + if (rbtk_eventloop_depth > 0 || rbtk_internal_eventloop_handler > 0 ) { return 1; /* pending */ @@ -1004,7 +1004,7 @@ pending_exception_check1(thr_crit_bup, ptr) /* call original 'exit' command */ -static void +static void call_original_exit(ptr, state) struct tcltkip *ptr; int state; @@ -1049,7 +1049,7 @@ call_original_exit(ptr, state) argv[1] = state_obj; argv[2] = (Tcl_Obj *)NULL; - ptr->return_value + ptr->return_value = (*(info->objProc))(info->objClientData, ptr->ip, 2, argv); Tcl_DecrRefCount(cmd_obj); @@ -1125,7 +1125,7 @@ call_original_exit(ptr, state) argv[1] = RSTRING_PTR(rb_fix2str(INT2NUM(state), 10)); argv[2] = (char *)NULL; - ptr->return_value = (*(info->proc))(info->clientData, ptr->ip, + ptr->return_value = (*(info->proc))(info->clientData, ptr->ip, 2, argv); #if USE_RUBY_ALLOC @@ -1174,7 +1174,7 @@ _timer_for_tcl(clientData) run_timer_flag = 1; if (timer_tick > 0) { - timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl, + timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl, (ClientData)0); } else { timer_token = (Tcl_TimerToken)NULL; @@ -1244,7 +1244,7 @@ set_eventloop_tick(self, tick) rb_secure(4); if (ttick < 0) { - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "timer-tick parameter must be 0 or positive number"); } @@ -1257,7 +1257,7 @@ set_eventloop_tick(self, tick) timer_tick = req_timer_tick = ttick; if (timer_tick > 0) { /* start timer callback */ - timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl, + timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl, (ClientData)0); } else { timer_token = (Tcl_TimerToken)NULL; @@ -1311,7 +1311,7 @@ set_no_event_wait(self, wait) rb_secure(4); if (t_wait <= 0) { - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "no_event_wait parameter must be positive number"); } @@ -1434,7 +1434,7 @@ set_max_block_time(self, time) default: { VALUE tmp = rb_funcall(time, ID_inspect, 0, 0); - rb_raise(rb_eArgError, "invalid value for time: '%s'", + rb_raise(rb_eArgError, "invalid value for time: '%s'", StringValuePtr(tmp)); } } @@ -1704,7 +1704,7 @@ static int check_eventloop_interp() { DUMP1("check eventloop_interp"); - if (eventloop_interp != (Tcl_Interp*)NULL + if (eventloop_interp != (Tcl_Interp*)NULL && Tcl_InterpDeleted(eventloop_interp)) { DUMP2("eventloop_interp(%p) was deleted", eventloop_interp); return 1; @@ -1741,7 +1741,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) if (timer_tick > 0) { thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; - timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl, + timer_token = Tcl_CreateTimerHandler(timer_tick, _timer_for_tcl, (ClientData)0); rb_thread_critical = thr_crit_bup; } else { @@ -1773,8 +1773,8 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) if (timer_tick == 0 && update_flag == 0) { timer_tick = NO_THREAD_INTERRUPT_TIME; - timer_token = Tcl_CreateTimerHandler(timer_tick, - _timer_for_tcl, + timer_token = Tcl_CreateTimerHandler(timer_tick, + _timer_for_tcl, (ClientData)0); } @@ -1782,7 +1782,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) if (*check_var || !found_event) { return found_event; } - if (interp != (Tcl_Interp*)NULL + if (interp != (Tcl_Interp*)NULL && Tcl_InterpDeleted(interp)) { /* IP for check_var is deleted */ return 0; @@ -1790,13 +1790,13 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) } /* found_event = Tcl_DoOneEvent(event_flag); */ - found_event = RTEST(rb_protect(call_DoOneEvent, - INT2FIX(event_flag), &status)); + found_event = RTEST(rb_protect(call_DoOneEvent, + INT2FIX(event_flag), &status)); if (status) { switch (status) { case TAG_RAISE: if (NIL_P(rb_errinfo())) { - rbtk_pending_exception + rbtk_pending_exception = rb_exc_new2(rb_eException, "unknown exception"); } else { rbtk_pending_exception = rb_errinfo(); @@ -1823,7 +1823,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) } if (depth != rbtk_eventloop_depth) { - DUMP2("DoOneEvent(1) abnormal exit!! %d", + DUMP2("DoOneEvent(1) abnormal exit!! %d", rbtk_eventloop_depth); } @@ -1883,7 +1883,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) if (*check_var || !found_event) { return found_event; } - if (interp != (Tcl_Interp*)NULL + if (interp != (Tcl_Interp*)NULL && Tcl_InterpDeleted(interp)) { /* IP for check_var is deleted */ return 0; @@ -1895,12 +1895,12 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) int status; #ifdef RUBY_USE_NATIVE_THREAD if (update_flag) { - st = RTEST(rb_protect(call_DoOneEvent, - INT2FIX(event_flag), &status)); + st = RTEST(rb_protect(call_DoOneEvent, + INT2FIX(event_flag), &status)); } else { - st = RTEST(rb_protect(call_DoOneEvent, - INT2FIX(event_flag & window_event_mode), - &status)); + st = RTEST(rb_protect(call_DoOneEvent, + INT2FIX(event_flag & window_event_mode), + &status)); #if USE_TOGGLE_WINDOW_MODE_FOR_IDLE if (!st) { if (toggle_eventloop_window_mode_for_idle()) { @@ -1915,8 +1915,8 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) } #else /* st = Tcl_DoOneEvent(event_flag); */ - st = RTEST(rb_protect(call_DoOneEvent, - INT2FIX(event_flag), &status)); + st = RTEST(rb_protect(call_DoOneEvent, + INT2FIX(event_flag), &status)); #endif #if CONTROL_BY_STATUS_OF_RB_THREAD_WAITING_FOR_VALUE @@ -1930,8 +1930,8 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) switch (status) { case TAG_RAISE: if (NIL_P(rb_errinfo())) { - rbtk_pending_exception - = rb_exc_new2(rb_eException, + rbtk_pending_exception + = rb_exc_new2(rb_eException, "unknown exception"); } else { rbtk_pending_exception = rb_errinfo(); @@ -1958,14 +1958,14 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) } if (depth != rbtk_eventloop_depth) { - DUMP2("DoOneEvent(2) abnormal exit!! %d", + DUMP2("DoOneEvent(2) abnormal exit!! %d", rbtk_eventloop_depth); return 0; } TRAP_CHECK(); - if (check_var != (int*)NULL + if (check_var != (int*)NULL && !NIL_P(rbtk_pending_exception)) { DUMP1("exception on wait"); return 0; @@ -1994,8 +1994,8 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) switch (status) { case TAG_RAISE: if (NIL_P(rb_errinfo())) { - rbtk_pending_exception - = rb_exc_new2(rb_eException, + rbtk_pending_exception + = rb_exc_new2(rb_eException, "unknown exception"); } else { rbtk_pending_exception = rb_errinfo(); @@ -2014,7 +2014,7 @@ lib_eventloop_core(check_root, update_flag, check_var, interp) case TAG_FATAL: if (NIL_P(rb_errinfo())) { - rb_exc_raise(rb_exc_new2(rb_eFatal, + rb_exc_raise(rb_exc_new2(rb_eFatal, "FATAL")); } else { rb_exc_raise(rb_errinfo()); @@ -2090,9 +2090,9 @@ lib_eventloop_main_core(args) check_rootwidget_flag = params->check_root; - if (lib_eventloop_core(params->check_root, - params->update_flag, - params->check_var, + if (lib_eventloop_core(params->check_root, + params->update_flag, + params->check_var, params->interp)) { return Qtrue; } else { @@ -2115,7 +2115,7 @@ lib_eventloop_main(args) switch (status) { case TAG_RAISE: if (NIL_P(rb_errinfo())) { - rbtk_pending_exception + rbtk_pending_exception = rb_exc_new2(rb_eException, "unknown exception"); } else { rbtk_pending_exception = rb_errinfo(); @@ -2156,7 +2156,7 @@ lib_eventloop_ensure(args) } while((eventloop_thread = rb_ary_pop(eventloop_stack))) { - DUMP2("eventloop-ensure: new eventloop-thread -> %lx", + DUMP2("eventloop-ensure: new eventloop-thread -> %lx", eventloop_thread); if (eventloop_thread == current_evloop) { @@ -2169,7 +2169,7 @@ lib_eventloop_ensure(args) Tcl_DeleteTimerHandler(timer_token); timer_token = (Tcl_TimerToken)NULL; - break; + break; } #ifdef RUBY_VM @@ -2233,7 +2233,7 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp) rb_ary_push(eventloop_stack, parent_evloop); - DUMP3("tcltklib: eventloop-thread : %lx -> %lx\n", + DUMP3("tcltklib: eventloop-thread : %lx -> %lx\n", parent_evloop, eventloop_thread); args->check_root = check_root; @@ -2245,10 +2245,10 @@ lib_eventloop_launcher(check_root, update_flag, check_var, interp) rb_thread_critical = Qfalse; #if 0 - return rb_ensure(lib_eventloop_main, (VALUE)args, + return rb_ensure(lib_eventloop_main, (VALUE)args, lib_eventloop_ensure, (VALUE)args); #endif - return rb_ensure(lib_eventloop_main_core, (VALUE)args, + return rb_ensure(lib_eventloop_main_core, (VALUE)args, lib_eventloop_ensure, (VALUE)args); } @@ -2269,7 +2269,7 @@ lib_mainloop(argc, argv, self) check_rootwidget = Qfalse; } - return lib_eventloop_launcher(RTEST(check_rootwidget), 0, + return lib_eventloop_launcher(RTEST(check_rootwidget), 0, (int*)NULL, (Tcl_Interp*)NULL); } @@ -2303,7 +2303,7 @@ static VALUE watchdog_evloop_launcher(check_rootwidget) VALUE check_rootwidget; { - return lib_eventloop_launcher(RTEST(check_rootwidget), 0, + return lib_eventloop_launcher(RTEST(check_rootwidget), 0, (int*)NULL, (Tcl_Interp*)NULL); } @@ -2339,9 +2339,9 @@ lib_watchdog_core(check_rootwidget) if (NIL_P(eventloop_thread) || (loop_counter == prev_val && chance >= EVLOOP_WAKEUP_CHANCE)) { /* start new eventloop thread */ - DUMP2("eventloop thread %lx is sleeping or dead", + DUMP2("eventloop thread %lx is sleeping or dead", eventloop_thread); - evloop = rb_thread_create(watchdog_evloop_launcher, + evloop = rb_thread_create(watchdog_evloop_launcher, (void*)&check_rootwidget); DUMP2("create new eventloop thread %lx", evloop); loop_counter = -1; @@ -2386,7 +2386,7 @@ lib_mainloop_watchdog(argc, argv, self) VALUE check_rootwidget; #ifdef RUBY_VM - rb_raise(rb_eNotImpError, + rb_raise(rb_eNotImpError, "eventloop_watchdog is not implemented on Ruby VM."); #endif @@ -2398,7 +2398,7 @@ lib_mainloop_watchdog(argc, argv, self) check_rootwidget = Qfalse; } - return rb_ensure(lib_watchdog_core, check_rootwidget, + return rb_ensure(lib_watchdog_core, check_rootwidget, lib_watchdog_ensure, Qnil); } @@ -2429,7 +2429,7 @@ struct thread_call_proc_arg { int *done; }; -void +void _thread_call_proc_arg_mark(struct thread_call_proc_arg *q) { rb_gc_mark(q->proc); @@ -2458,7 +2458,7 @@ _thread_call_proc(arg) { struct thread_call_proc_arg *q = (struct thread_call_proc_arg*)arg; - return rb_ensure(_thread_call_proc_core, (VALUE)q, + return rb_ensure(_thread_call_proc_core, (VALUE)q, _thread_call_proc_ensure, (VALUE)q); } @@ -2500,7 +2500,7 @@ lib_thread_callback(argc, argv, self) rb_thread_schedule(); /* start sub-eventloop */ - foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0, 0, + foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0, 0, q->done, (Tcl_Interp*)NULL)); #ifdef RUBY_VM @@ -2917,7 +2917,7 @@ static int #if TCL_MAJOR_VERSION >= 8 ip_ruby_eval(clientData, interp, argc, argv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int argc; Tcl_Obj *CONST argv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -2933,7 +2933,7 @@ ip_ruby_eval(clientData, interp, argc, argv) int code; if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } @@ -2941,15 +2941,15 @@ ip_ruby_eval(clientData, interp, argc, argv) /* ruby command has 1 arg. */ if (argc != 2) { #if 0 - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc - 1); #else char buf[sizeof(int)*8 + 1]; Tcl_ResetResult(interp); sprintf(buf, "%d", argc-1); - Tcl_AppendResult(interp, "wrong number of arguments (", + Tcl_AppendResult(interp, "wrong number of arguments (", buf, " for 1)", (char *)NULL); - rbtk_pending_exception = rb_exc_new2(rb_eArgError, + rbtk_pending_exception = rb_exc_new2(rb_eArgError, Tcl_GetStringResult(interp)); return TCL_ERROR; #endif @@ -3045,7 +3045,7 @@ ip_ruby_cmd_receiver_const_get(name) /* has '::' at head ? */ if (*head == ':') head += 2; - tail = head; + tail = head; /* search */ while(*tail) { @@ -3108,7 +3108,7 @@ static int #if TCL_MAJOR_VERSION >= 8 ip_ruby_cmd(clientData, interp, argc, argv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int argc; Tcl_Obj *CONST argv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -3131,7 +3131,7 @@ ip_ruby_cmd(clientData, interp, argc, argv) int code; if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } @@ -3142,7 +3142,7 @@ ip_ruby_cmd(clientData, interp, argc, argv) #else Tcl_ResetResult(interp); Tcl_AppendResult(interp, "too few arguments", (char *)NULL); - rbtk_pending_exception = rb_exc_new2(rb_eArgError, + rbtk_pending_exception = rb_exc_new2(rb_eArgError, Tcl_GetStringResult(interp)); return TCL_ERROR; #endif @@ -3164,13 +3164,13 @@ ip_ruby_cmd(clientData, interp, argc, argv) receiver = ip_ruby_cmd_receiver_get(str); if (NIL_P(receiver)) { #if 0 - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "unknown class/module/global-variable '%s'", str); #else Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "unknown class/module/global-variable '", + Tcl_AppendResult(interp, "unknown class/module/global-variable '", str, "'", (char *)NULL); - rbtk_pending_exception = rb_exc_new2(rb_eArgError, + rbtk_pending_exception = rb_exc_new2(rb_eArgError, Tcl_GetStringResult(interp)); if (old_gc == Qfalse) rb_gc_enable(); return TCL_ERROR; @@ -3231,12 +3231,12 @@ ip_ruby_cmd(clientData, interp, argc, argv) static int #if TCL_MAJOR_VERSION >= 8 #ifdef HAVE_PROTOTYPES -ip_InterpExitObjCmd(ClientData clientData, Tcl_Interp *interp, +ip_InterpExitObjCmd(ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *CONST argv[]) #else ip_InterpExitObjCmd(clientData, interp, argc, argv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int argc; Tcl_Obj *CONST argv[]; #endif @@ -3254,7 +3254,7 @@ ip_InterpExitCommand(clientData, interp, argc, argv) #endif { DUMP1("start ip_InterpExitCommand"); - if (interp != (Tcl_Interp*)NULL + if (interp != (Tcl_Interp*)NULL && !Tcl_InterpDeleted(interp) #if TCL_NAMESPACE_DEBUG && !ip_null_namespace(interp) @@ -3281,7 +3281,7 @@ ip_RubyExitObjCmd(ClientData clientData, Tcl_Interp *interp, #else ip_RubyExitObjCmd(clientData, interp, argc, argv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int argc; Tcl_Obj *CONST argv[]; #endif @@ -3314,8 +3314,8 @@ ip_RubyExitCommand(clientData, interp, argc, argv) if (argc < 1 || argc > 2) { /* arguemnt error */ - Tcl_AppendResult(interp, - "wrong number of arguments: should be \"", + Tcl_AppendResult(interp, + "wrong number of arguments: should be \"", cmd, " ?returnCode?\"", (char *)NULL); return TCL_ERROR; } @@ -3337,10 +3337,10 @@ ip_RubyExitCommand(clientData, interp, argc, argv) switch(argc) { case 1: /* rb_exit(0); */ /* not return if succeed */ - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "fail to call \"", cmd, "\"", (char *)NULL); - rbtk_pending_exception = rb_exc_new2(rb_eSystemExit, + rbtk_pending_exception = rb_exc_new2(rb_eSystemExit, Tcl_GetStringResult(interp)); rb_iv_set(rbtk_pending_exception, "status", INT2FIX(0)); @@ -3356,8 +3356,8 @@ ip_RubyExitCommand(clientData, interp, argc, argv) #else /* TCL_MAJOR_VERSION < 8 */ state = (int)strtol(argv[1], &endptr, 0); if (*endptr) { - Tcl_AppendResult(interp, - "expected integer but got \"", + Tcl_AppendResult(interp, + "expected integer but got \"", argv[1], "\"", (char *)NULL); return TCL_ERROR; } @@ -3365,10 +3365,10 @@ ip_RubyExitCommand(clientData, interp, argc, argv) #endif /* rb_exit(state); */ /* not return if succeed */ - Tcl_AppendResult(interp, "fail to call \"", cmd, " ", + Tcl_AppendResult(interp, "fail to call \"", cmd, " ", param, "\"", (char *)NULL); - rbtk_pending_exception = rb_exc_new2(rb_eSystemExit, + rbtk_pending_exception = rb_exc_new2(rb_eSystemExit, Tcl_GetStringResult(interp)); rb_iv_set(rbtk_pending_exception, "status", INT2FIX(state)); @@ -3376,8 +3376,8 @@ ip_RubyExitCommand(clientData, interp, argc, argv) default: /* arguemnt error */ - Tcl_AppendResult(interp, - "wrong number of arguments: should be \"", + Tcl_AppendResult(interp, + "wrong number of arguments: should be \"", cmd, " ?returnCode?\"", (char *)NULL); return TCL_ERROR; } @@ -3397,7 +3397,7 @@ static int ip_rbUpdateObjCmd _((ClientData, Tcl_Interp *, int, static int ip_rbUpdateObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -3418,7 +3418,7 @@ ip_rbUpdateCommand(clientData, interp, objc, objv) DUMP1("Ruby's 'update' is called"); if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } @@ -3465,8 +3465,8 @@ ip_rbUpdateCommand(clientData, interp, objc, objv) # if TCL_MAJOR_VERSION >= 8 int dummy; Tcl_AppendResult(interp, "wrong number of arguments: should be \"", - Tcl_GetStringFromObj(objv[0], &dummy), - " [ idletasks ]\"", + Tcl_GetStringFromObj(objv[0], &dummy), + " [ idletasks ]\"", (char *) NULL); # else /* TCL_MAJOR_VERSION < 8 */ Tcl_AppendResult(interp, "wrong number of arguments: should be \"", @@ -3531,7 +3531,7 @@ struct th_update_param { }; static void rb_threadUpdateProc _((ClientData)); -static void +static void rb_threadUpdateProc(clientData) ClientData clientData; /* Pointer to integer to set to 1. */ { @@ -3550,7 +3550,7 @@ static int ip_rb_threadUpdateObjCmd _((ClientData, Tcl_Interp *, int, static int ip_rb_threadUpdateObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -3574,7 +3574,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv) DUMP1("Ruby's 'thread_update' is called"); if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } @@ -3586,7 +3586,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv) #endif #endif - if (rb_thread_alone() + if (rb_thread_alone() || NIL_P(eventloop_thread) || eventloop_thread == current_thread) { #if TCL_MAJOR_VERSION >= 8 DUMP1("call ip_rbUpdateObjCmd"); @@ -3634,8 +3634,8 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv) # if TCL_MAJOR_VERSION >= 8 int dummy; Tcl_AppendResult(interp, "wrong number of arguments: should be \"", - Tcl_GetStringFromObj(objv[0], &dummy), - " [ idletasks ]\"", + Tcl_GetStringFromObj(objv[0], &dummy), + " [ idletasks ]\"", (char *) NULL); # else /* TCL_MAJOR_VERSION < 8 */ Tcl_AppendResult(interp, "wrong number of arguments: should be \"", @@ -3709,7 +3709,7 @@ static int ip_rb_threadTkWaitCommand _((ClientData, Tcl_Interp *, int, #endif #if TCL_MAJOR_VERSION >= 8 -static char *VwaitVarProc _((ClientData, Tcl_Interp *, +static char *VwaitVarProc _((ClientData, Tcl_Interp *, CONST84 char *,CONST84 char *, int)); static char * VwaitVarProc(clientData, interp, name1, name2, flags) @@ -3739,7 +3739,7 @@ VwaitVarProc(clientData, interp, name1, name2, flags) static int ip_rbVwaitObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used */ - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -3758,13 +3758,13 @@ ip_rbVwaitCommand(clientData, interp, objc, objv) DUMP1("Ruby's 'vwait' is called"); if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } #if 0 - if (!rb_thread_alone() + if (!rb_thread_alone() && eventloop_thread != Qnil && eventloop_thread != rb_thread_current()) { #if TCL_MAJOR_VERSION >= 8 @@ -3822,7 +3822,7 @@ ip_rbVwaitCommand(clientData, interp, objc, objv) nameString = objv[1]; #endif - /* + /* if (Tcl_TraceVar(interp, nameString, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VwaitVarProc, (ClientData) &done) != TCL_OK) { @@ -3845,7 +3845,7 @@ ip_rbVwaitCommand(clientData, interp, objc, objv) done = 0; - foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0, + foundEvent = RTEST(lib_eventloop_launcher(/* not check root-widget */0, 0, &done, interp)); thr_crit_bup = rb_thread_critical; @@ -3923,7 +3923,7 @@ ip_rbVwaitCommand(clientData, interp, objc, objv) /* based on tkCmd.c */ /**************************/ #if TCL_MAJOR_VERSION >= 8 -static char *WaitVariableProc _((ClientData, Tcl_Interp *, +static char *WaitVariableProc _((ClientData, Tcl_Interp *, CONST84 char *,CONST84 char *, int)); static char * WaitVariableProc(clientData, interp, name1, name2, flags) @@ -3933,7 +3933,7 @@ WaitVariableProc(clientData, interp, name1, name2, flags) CONST84 char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ #else /* TCL_MAJOR_VERSION < 8 */ -static char *WaitVariableProc _((ClientData, Tcl_Interp *, +static char *WaitVariableProc _((ClientData, Tcl_Interp *, char *, char *, int)); static char * WaitVariableProc(clientData, interp, name1, name2, flags) @@ -3983,7 +3983,7 @@ WaitWindowProc(clientData, eventPtr) static int ip_rbTkWaitObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -4007,13 +4007,13 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) DUMP1("Ruby's 'tkwait' is called"); if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } #if 0 - if (!rb_thread_alone() + if (!rb_thread_alone() && eventloop_thread != Qnil && eventloop_thread != rb_thread_current()) { #if TCL_MAJOR_VERSION >= 8 @@ -4038,12 +4038,12 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) #if TCL_MAJOR_VERSION >= 8 Tcl_AppendResult(interp, "wrong number of arguments: should be \"", - Tcl_GetStringFromObj(objv[0], &dummy), - " variable|visibility|window name\"", + Tcl_GetStringFromObj(objv[0], &dummy), + " variable|visibility|window name\"", (char *) NULL); #else /* TCL_MAJOR_VERSION < 8 */ Tcl_AppendResult(interp, "wrong number of arguments: should be \"", - objv[0], " variable|visibility|window name\"", + objv[0], " variable|visibility|window name\"", (char *) NULL); #endif @@ -4059,14 +4059,14 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) rb_thread_critical = Qtrue; /* - if (Tcl_GetIndexFromObj(interp, objv[1], - (CONST84 char **)optionStrings, + if (Tcl_GetIndexFromObj(interp, objv[1], + (CONST84 char **)optionStrings, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } */ - ret = Tcl_GetIndexFromObj(interp, objv[1], - (CONST84 char **)optionStrings, + ret = Tcl_GetIndexFromObj(interp, objv[1], + (CONST84 char **)optionStrings, "option", 0, &index); rb_thread_critical = thr_crit_bup; @@ -4090,7 +4090,7 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) index = TKWAIT_WINDOW; } else { Tcl_AppendResult(interp, "bad option \"", objv[1], - "\": must be variable, visibility, or window", + "\": must be variable, visibility, or window", (char *) NULL); Tcl_Release(interp); return TCL_ERROR; @@ -4193,8 +4193,8 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) } if (window == NULL) { - Tcl_AppendResult(interp, ": tkwait: ", - "no main-window (not Tk application?)", + Tcl_AppendResult(interp, ": tkwait: ", + "no main-window (not Tk application?)", (char*)NULL); rb_thread_critical = thr_crit_bup; #if TCL_MAJOR_VERSION >= 8 @@ -4299,8 +4299,8 @@ ip_rbTkWaitCommand(clientData, interp, objc, objv) #endif if (window == NULL) { - Tcl_AppendResult(interp, ": tkwait: ", - "no main-window (not Tk application?)", + Tcl_AppendResult(interp, ": tkwait: ", + "no main-window (not Tk application?)", (char*)NULL); rb_thread_critical = thr_crit_bup; Tcl_Release(interp); @@ -4368,7 +4368,7 @@ struct th_vwait_param { }; #if TCL_MAJOR_VERSION >= 8 -static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *, +static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *, CONST84 char *,CONST84 char *, int)); static char * rb_threadVwaitProc(clientData, interp, name1, name2, flags) @@ -4378,7 +4378,7 @@ rb_threadVwaitProc(clientData, interp, name1, name2, flags) CONST84 char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ #else /* TCL_MAJOR_VERSION < 8 */ -static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *, +static char *rb_threadVwaitProc _((ClientData, Tcl_Interp *, char *, char *, int)); static char * rb_threadVwaitProc(clientData, interp, name1, name2, flags) @@ -4439,7 +4439,7 @@ rb_threadWaitWindowProc(clientData, eventPtr) static int ip_rb_threadVwaitObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -4460,7 +4460,7 @@ ip_rb_threadVwaitCommand(clientData, interp, objc, objv) DUMP1("Ruby's 'thread_vwait' is called"); if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } @@ -4596,7 +4596,7 @@ ip_rb_threadVwaitCommand(clientData, interp, objc, objv) static int ip_rb_threadTkWaitObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -4623,7 +4623,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) DUMP1("Ruby's 'thread_tkwait' is called"); if (interp == (Tcl_Interp*)NULL) { - rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, + rbtk_pending_exception = rb_exc_new2(rb_eRuntimeError, "IP is deleted"); return TCL_ERROR; } @@ -4654,12 +4654,12 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) #if TCL_MAJOR_VERSION >= 8 Tcl_AppendResult(interp, "wrong number of arguments: should be \"", - Tcl_GetStringFromObj(objv[0], &dummy), - " variable|visibility|window name\"", + Tcl_GetStringFromObj(objv[0], &dummy), + " variable|visibility|window name\"", (char *) NULL); #else /* TCL_MAJOR_VERSION < 8 */ Tcl_AppendResult(interp, "wrong number of arguments: should be \"", - objv[0], " variable|visibility|window name\"", + objv[0], " variable|visibility|window name\"", (char *) NULL); #endif @@ -4675,14 +4675,14 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; /* - if (Tcl_GetIndexFromObj(interp, objv[1], - (CONST84 char **)optionStrings, + if (Tcl_GetIndexFromObj(interp, objv[1], + (CONST84 char **)optionStrings, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } */ - ret = Tcl_GetIndexFromObj(interp, objv[1], - (CONST84 char **)optionStrings, + ret = Tcl_GetIndexFromObj(interp, objv[1], + (CONST84 char **)optionStrings, "option", 0, &index); rb_thread_critical = thr_crit_bup; @@ -4707,7 +4707,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) index = TKWAIT_WINDOW; } else { Tcl_AppendResult(interp, "bad option \"", objv[1], - "\": must be variable, visibility, or window", + "\": must be variable, visibility, or window", (char *) NULL); Tcl_Release(tkwin); Tcl_Release(interp); @@ -4741,7 +4741,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) case TKWAIT_VARIABLE: thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; - /* + /* if (Tcl_TraceVar(interp, nameString, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, rb_threadVwaitProc, (ClientData) param) != TCL_OK) { @@ -4829,8 +4829,8 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) #endif if (window == NULL) { - Tcl_AppendResult(interp, ": thread_tkwait: ", - "no main-window (not Tk application?)", + Tcl_AppendResult(interp, ": thread_tkwait: ", + "no main-window (not Tk application?)", (char*)NULL); rb_thread_critical = thr_crit_bup; @@ -4881,7 +4881,7 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) if (param->done != TKWAIT_MODE_DESTROY) { Tk_DeleteEventHandler(window, VisibilityChangeMask|StructureNotifyMask, - rb_threadWaitVisibilityProc, + rb_threadWaitVisibilityProc, (ClientData) param); } @@ -4954,8 +4954,8 @@ ip_rb_threadTkWaitCommand(clientData, interp, objc, objv) #endif if (window == NULL) { - Tcl_AppendResult(interp, ": thread_tkwait: ", - "no main-window (not Tk application?)", + Tcl_AppendResult(interp, ": thread_tkwait: ", + "no main-window (not Tk application?)", (char*)NULL); rb_thread_critical = thr_crit_bup; @@ -5136,7 +5136,7 @@ delete_slaves(ip) if (!Tcl_InterpDeleted(ip) && Tcl_Eval(ip, "interp slaves") == TCL_OK) { slave_list = ip->result; - if (Tcl_SplitList((Tcl_Interp*)NULL, + if (Tcl_SplitList((Tcl_Interp*)NULL, slave_list, &argc, &argv) == TCL_OK) { for(i = 0; i < argc; i++) { slave_name = argv[i]; @@ -5181,7 +5181,7 @@ ip_null_proc(ClientData clientData, Tcl_Interp *interp, #else ip_null_proc(clientData, interp, argc, argv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int argc; Tcl_Obj *CONST argv[]; #endif @@ -5209,10 +5209,10 @@ ip_finalize(ip) int thr_crit_bup; VALUE rb_debug_bup, rb_verbose_bup; - /* When ruby is exiting, printing debug messages in some callback - operations from Tcl-IP sometimes cause SEGV. I don't know the + /* When ruby is exiting, printing debug messages in some callback + operations from Tcl-IP sometimes cause SEGV. I don't know the reason. But I got SEGV when calling "rb_io_write(rb_stdout, ...)". - So, in some part of this function, debug mode and verbose mode + So, in some part of this function, debug mode and verbose mode are disabled. If you know the reason, please fix it. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) */ @@ -5248,33 +5248,33 @@ ip_finalize(ip) /* shut off some connections from Tcl-proc to Ruby */ if (at_exit) { - /* NOTE: Only when at exit. - Because, ruby removes objects, which depends on the deleted - interpreter, on some callback operations. + /* NOTE: Only when at exit. + Because, ruby removes objects, which depends on the deleted + interpreter, on some callback operations. It is important for GC. */ #if TCL_MAJOR_VERSION >= 8 - Tcl_CreateObjCommand(ip, "ruby", ip_null_proc, + Tcl_CreateObjCommand(ip, "ruby", ip_null_proc, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); - Tcl_CreateObjCommand(ip, "ruby_eval", ip_null_proc, + Tcl_CreateObjCommand(ip, "ruby_eval", ip_null_proc, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); - Tcl_CreateObjCommand(ip, "ruby_cmd", ip_null_proc, + Tcl_CreateObjCommand(ip, "ruby_cmd", ip_null_proc, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ - Tcl_CreateCommand(ip, "ruby", ip_null_proc, + Tcl_CreateCommand(ip, "ruby", ip_null_proc, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); - Tcl_CreateCommand(ip, "ruby_eval", ip_null_proc, + Tcl_CreateCommand(ip, "ruby_eval", ip_null_proc, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); - Tcl_CreateCommand(ip, "ruby_cmd", ip_null_proc, + Tcl_CreateCommand(ip, "ruby_cmd", ip_null_proc, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #endif - /* + /* rb_thread_critical = thr_crit_bup; return; */ } /* delete root widget */ -#ifdef RUBY_VM +#ifdef RUBY_VM /* cause SEGV on Ruby 1.9 */ #else DUMP1("check `destroy'"); @@ -5287,13 +5287,13 @@ ip_finalize(ip) DUMP1("destroy root widget"); if (tk_stubs_init_p() && Tk_MainWindow(ip) != (Tk_Window)NULL) { /* - * On Ruby VM, this code piece may be not called, because - * Tk_MainWindow() returns NULL on a native thread except + * On Ruby VM, this code piece may be not called, because + * Tk_MainWindow() returns NULL on a native thread except * the thread which initialize Tk environment. * Of course, that is a problem. But maybe not so serious. * All widgets are destroyed when the Tcl interp is deleted. - * At then, Ruby may raise exceptions on the delete hook - * callbacks which registered for the deleted widgets, and + * At then, Ruby may raise exceptions on the delete hook + * callbacks which registered for the deleted widgets, and * may fail to clear objects which depends on the widgets. * Although it is the problem, it is possibly avoidable by * rescuing exceptions and the finalize hook of the interp. @@ -5354,13 +5354,13 @@ ip_free(ptr) thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; - if ( ptr->ip != (Tcl_Interp*)NULL + if ( ptr->ip != (Tcl_Interp*)NULL && !Tcl_InterpDeleted(ptr->ip) - && Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL + && Tcl_GetMaster(ptr->ip) != (Tcl_Interp*)NULL && !Tcl_InterpDeleted(Tcl_GetMaster(ptr->ip)) ) { - DUMP2("parent IP(%lx) is not deleted", + DUMP2("parent IP(%lx) is not deleted", (unsigned long)Tcl_GetMaster(ptr->ip)); - DUMP2("slave IP(%lx) should not be deleted", + DUMP2("slave IP(%lx) should not be deleted", (unsigned long)ptr->ip); free(ptr); /* ckfree((char*)ptr); */ @@ -5379,8 +5379,8 @@ ip_free(ptr) if (!Tcl_InterpDeleted(ptr->ip)) { ip_finalize(ptr->ip); - Tcl_DeleteInterp(ptr->ip); - Tcl_Release(ptr->ip); + Tcl_DeleteInterp(ptr->ip); + Tcl_Release(ptr->ip); } ptr->ip = (Tcl_Interp*)NULL; @@ -5411,66 +5411,66 @@ ip_replace_wait_commands(interp, mainWin) /* replace 'vwait' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"vwait\")"); - Tcl_CreateObjCommand(interp, "vwait", ip_rbVwaitObjCmd, + Tcl_CreateObjCommand(interp, "vwait", ip_rbVwaitObjCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"vwait\")"); - Tcl_CreateCommand(interp, "vwait", ip_rbVwaitCommand, + Tcl_CreateCommand(interp, "vwait", ip_rbVwaitCommand, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #endif /* replace 'tkwait' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"tkwait\")"); - Tcl_CreateObjCommand(interp, "tkwait", ip_rbTkWaitObjCmd, + Tcl_CreateObjCommand(interp, "tkwait", ip_rbTkWaitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"tkwait\")"); - Tcl_CreateCommand(interp, "tkwait", ip_rbTkWaitCommand, + Tcl_CreateCommand(interp, "tkwait", ip_rbTkWaitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif /* add 'thread_vwait' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"thread_vwait\")"); - Tcl_CreateObjCommand(interp, "thread_vwait", ip_rb_threadVwaitObjCmd, + Tcl_CreateObjCommand(interp, "thread_vwait", ip_rb_threadVwaitObjCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"thread_vwait\")"); - Tcl_CreateCommand(interp, "thread_vwait", ip_rb_threadVwaitCommand, + Tcl_CreateCommand(interp, "thread_vwait", ip_rb_threadVwaitCommand, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #endif /* add 'thread_tkwait' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"thread_tkwait\")"); - Tcl_CreateObjCommand(interp, "thread_tkwait", ip_rb_threadTkWaitObjCmd, + Tcl_CreateObjCommand(interp, "thread_tkwait", ip_rb_threadTkWaitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"thread_tkwait\")"); - Tcl_CreateCommand(interp, "thread_tkwait", ip_rb_threadTkWaitCommand, + Tcl_CreateCommand(interp, "thread_tkwait", ip_rb_threadTkWaitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif /* replace 'update' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"update\")"); - Tcl_CreateObjCommand(interp, "update", ip_rbUpdateObjCmd, + Tcl_CreateObjCommand(interp, "update", ip_rbUpdateObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"update\")"); - Tcl_CreateCommand(interp, "update", ip_rbUpdateCommand, + Tcl_CreateCommand(interp, "update", ip_rbUpdateCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif /* add 'thread_update' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"thread_update\")"); - Tcl_CreateObjCommand(interp, "thread_update", ip_rb_threadUpdateObjCmd, + Tcl_CreateObjCommand(interp, "thread_update", ip_rb_threadUpdateObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"thread_update\")"); - Tcl_CreateCommand(interp, "thread_update", ip_rb_threadUpdateCommand, + Tcl_CreateCommand(interp, "thread_update", ip_rb_threadUpdateCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif } @@ -5480,7 +5480,7 @@ ip_replace_wait_commands(interp, mainWin) static int ip_rb_replaceSlaveTkCmdsObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; #else /* TCL_MAJOR_VERSION < 8 */ @@ -5519,7 +5519,7 @@ ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv) slave = Tcl_GetSlave(interp, slave_name); if (slave == NULL) { - Tcl_AppendResult(interp, "cannot find slave \"", + Tcl_AppendResult(interp, "cannot find slave \"", slave_name, "\"", (char *)NULL); return TCL_ERROR; } @@ -5528,11 +5528,11 @@ ip_rb_replaceSlaveTkCmdsCommand(clientData, interp, objc, objv) /* replace 'exit' command --> 'interp_exit' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateObjCommand(slave, "exit", ip_InterpExitObjCmd, + Tcl_CreateObjCommand(slave, "exit", ip_InterpExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateCommand(slave, "exit", ip_InterpExitCommand, + Tcl_CreateCommand(slave, "exit", ip_InterpExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif @@ -5549,7 +5549,7 @@ static int ip_rbNamespaceObjCmd _((ClientData, Tcl_Interp *, int, static int ip_rbNamespaceObjCmd(clientData, interp, objc, objv) ClientData clientData; - Tcl_Interp *interp; + Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { @@ -5558,7 +5558,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv) if (!Tcl_GetCommandInfo(interp, "__orig_namespace_command__", &(info))) { Tcl_ResetResult(interp); - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "invalid command name \"namespace\"", (char*)NULL); return TCL_ERROR; } @@ -5585,7 +5585,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv) } argv[objc] = (char *)NULL; - ret = (*(info.proc))(info.clientData, interp, + ret = (*(info.proc))(info.clientData, interp, objc, (CONST84 char **)argv); #if 0 /* use Tcl_EventuallyFree */ @@ -5609,7 +5609,7 @@ ip_rbNamespaceObjCmd(clientData, interp, objc, objv) static void ip_wrap_namespace_command(interp) - Tcl_Interp *interp; + Tcl_Interp *interp; { #if TCL_MAJOR_VERSION >= 8 Tcl_CmdInfo orig_info; @@ -5619,16 +5619,16 @@ ip_wrap_namespace_command(interp) } if (orig_info.isNativeObjectProc) { - Tcl_CreateObjCommand(interp, "__orig_namespace_command__", - orig_info.objProc, orig_info.objClientData, + Tcl_CreateObjCommand(interp, "__orig_namespace_command__", + orig_info.objProc, orig_info.objClientData, orig_info.deleteProc); } else { - Tcl_CreateCommand(interp, "__orig_namespace_command__", - orig_info.proc, orig_info.clientData, + Tcl_CreateCommand(interp, "__orig_namespace_command__", + orig_info.proc, orig_info.clientData, orig_info.deleteProc); } - Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd, + Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd, (ClientData) 0, (Tcl_CmdDeleteProc *)NULL); #endif } @@ -5673,8 +5673,8 @@ ip_init(argc, argv, self) /* security check */ if (rb_safe_level() >= 4) { - rb_raise(rb_eSecurityError, - "Cannot create a TclTkIp object at level %d", + rb_raise(rb_eSecurityError, + "Cannot create a TclTkIp object at level %d", rb_safe_level()); } @@ -5717,7 +5717,7 @@ ip_init(argc, argv, self) #if TCL_MAJOR_VERSION >= 8 #if TCL_NAMESPACE_DEBUG DUMP1("get current namespace"); - if ((ptr->default_ns = Tcl_GetCurrentNamespace(ptr->ip)) + if ((ptr->default_ns = Tcl_GetCurrentNamespace(ptr->ip)) == (Tcl_Namespace*)NULL) { rb_raise(rb_eRuntimeError, "a new Tk interpreter has a NULL namespace"); } @@ -5728,7 +5728,7 @@ ip_init(argc, argv, self) DUMP2("IP ref_count = %d", ptr->ref_count); current_interp = ptr->ip; - ptr->has_orig_exit + ptr->has_orig_exit = Tcl_GetCommandInfo(ptr->ip, "exit", &(ptr->orig_exit_info)); /* from Tcl_AppInit() */ @@ -5757,7 +5757,7 @@ ip_init(argc, argv, self) Tcl_SetVar(ptr->ip, "argv0", "ruby", TCL_GLOBAL_ONLY); } else { /* Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), 0); */ - Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), + Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), TCL_GLOBAL_ONLY); } } @@ -5777,10 +5777,10 @@ ip_init(argc, argv, self) case NO_Tk_Init: rb_raise(rb_eLoadError, "tcltklib: can't find Tk_Init()"); case FAIL_Tk_Init: - rb_raise(rb_eRuntimeError, "tcltklib: fail to Tk_Init(). %s", + rb_raise(rb_eRuntimeError, "tcltklib: fail to Tk_Init(). %s", Tcl_GetStringResult(ptr->ip)); case FAIL_Tk_InitStubs: - rb_raise(rb_eRuntimeError, "tcltklib: fail to Tk_InitStubs(). %s", + rb_raise(rb_eRuntimeError, "tcltklib: fail to Tk_InitStubs(). %s", Tcl_GetStringResult(ptr->ip)); default: rb_raise(rb_eRuntimeError, "tcltklib: unknown error(%d) on ruby_tk_stubs_init", st); @@ -5829,23 +5829,23 @@ ip_init(argc, argv, self) /* add 'interp_exit', 'ruby_exit' and replace 'exit' command */ #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"interp_exit\")"); - Tcl_CreateObjCommand(ptr->ip, "interp_exit", ip_InterpExitObjCmd, + Tcl_CreateObjCommand(ptr->ip, "interp_exit", ip_InterpExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); DUMP1("Tcl_CreateObjCommand(\"ruby_exit\")"); - Tcl_CreateObjCommand(ptr->ip, "ruby_exit", ip_RubyExitObjCmd, + Tcl_CreateObjCommand(ptr->ip, "ruby_exit", ip_RubyExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"ruby_exit\""); - Tcl_CreateObjCommand(ptr->ip, "exit", ip_RubyExitObjCmd, + Tcl_CreateObjCommand(ptr->ip, "exit", ip_RubyExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"interp_exit\")"); - Tcl_CreateCommand(ptr->ip, "interp_exit", ip_InterpExitCommand, + Tcl_CreateCommand(ptr->ip, "interp_exit", ip_InterpExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); DUMP1("Tcl_CreateCommand(\"ruby_exit\")"); - Tcl_CreateCommand(ptr->ip, "ruby_exit", ip_RubyExitCommand, + Tcl_CreateCommand(ptr->ip, "ruby_exit", ip_RubyExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); DUMP1("Tcl_CreateCommand(\"exit\") --> \"ruby_exit\""); - Tcl_CreateCommand(ptr->ip, "exit", ip_RubyExitCommand, + Tcl_CreateCommand(ptr->ip, "exit", ip_RubyExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif @@ -5857,12 +5857,12 @@ ip_init(argc, argv, self) /* define command to replace commands which depend on slave's MainWindow */ #if TCL_MAJOR_VERSION >= 8 - Tcl_CreateObjCommand(ptr->ip, "__replace_slave_tk_commands__", - ip_rb_replaceSlaveTkCmdsObjCmd, + Tcl_CreateObjCommand(ptr->ip, "__replace_slave_tk_commands__", + ip_rb_replaceSlaveTkCmdsObjCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ - Tcl_CreateCommand(ptr->ip, "__replace_slave_tk_commands__", - ip_rb_replaceSlaveTkCmdsCommand, + Tcl_CreateCommand(ptr->ip, "__replace_slave_tk_commands__", + ip_rb_replaceSlaveTkCmdsCommand, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #endif @@ -5893,7 +5893,7 @@ ip_create_slave_core(interp, argc, argv) /* ip is deleted? */ if (deleted_ip(master)) { - return rb_exc_new2(rb_eRuntimeError, + return rb_exc_new2(rb_eRuntimeError, "deleted master cannot create a new slave"); } @@ -5938,7 +5938,7 @@ ip_create_slave_core(interp, argc, argv) slave->ip = Tcl_CreateSlave(master->ip, StringValuePtr(name), safe); if (slave->ip == NULL) { rb_thread_critical = thr_crit_bup; - return rb_exc_new2(rb_eRuntimeError, + return rb_exc_new2(rb_eRuntimeError, "fail to create the new slave interpreter"); } #if TCL_MAJOR_VERSION >= 8 @@ -5948,18 +5948,18 @@ ip_create_slave_core(interp, argc, argv) #endif rbtk_preserve_ip(slave); - slave->has_orig_exit + slave->has_orig_exit = Tcl_GetCommandInfo(slave->ip, "exit", &(slave->orig_exit_info)); /* replace 'exit' command --> 'interp_exit' command */ mainWin = (tk_stubs_init_p())? Tk_MainWindow(slave->ip): (Tk_Window)NULL; #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateObjCommand(slave->ip, "exit", ip_InterpExitObjCmd, + Tcl_CreateObjCommand(slave->ip, "exit", ip_InterpExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateCommand(slave->ip, "exit", ip_InterpExitCommand, + Tcl_CreateCommand(slave->ip, "exit", ip_InterpExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif @@ -5971,12 +5971,12 @@ ip_create_slave_core(interp, argc, argv) /* define command to replace cmds which depend on slave-slave's MainWin */ #if TCL_MAJOR_VERSION >= 8 - Tcl_CreateObjCommand(slave->ip, "__replace_slave_tk_commands__", - ip_rb_replaceSlaveTkCmdsObjCmd, + Tcl_CreateObjCommand(slave->ip, "__replace_slave_tk_commands__", + ip_rb_replaceSlaveTkCmdsObjCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ - Tcl_CreateCommand(slave->ip, "__replace_slave_tk_commands__", - ip_rb_replaceSlaveTkCmdsCommand, + Tcl_CreateCommand(slave->ip, "__replace_slave_tk_commands__", + ip_rb_replaceSlaveTkCmdsCommand, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #endif @@ -6001,7 +6001,7 @@ ip_create_slave(argc, argv, self) /* ip is deleted? */ if (deleted_ip(master)) { - rb_raise(rb_eRuntimeError, + rb_raise(rb_eRuntimeError, "deleted master cannot create a new slave interpreter"); } @@ -6110,7 +6110,7 @@ ip_create_console(self) VALUE self; { struct tcltkip *ptr = get_ip(self); - + /* ip is deleted? */ if (deleted_ip(ptr)) { rb_raise(rb_eRuntimeError, "interpreter is deleted"); @@ -6128,16 +6128,16 @@ ip_make_safe_core(interp, argc, argv) { struct tcltkip *ptr = get_ip(interp); Tk_Window mainWin; - + /* ip is deleted? */ if (deleted_ip(ptr)) { return rb_exc_new2(rb_eRuntimeError, "interpreter is deleted"); } if (Tcl_MakeSafe(ptr->ip) == TCL_ERROR) { - /* return rb_exc_new2(rb_eRuntimeError, + /* return rb_exc_new2(rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); */ - return create_ip_exc(interp, rb_eRuntimeError, + return create_ip_exc(interp, rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); } @@ -6147,11 +6147,11 @@ ip_make_safe_core(interp, argc, argv) mainWin = (tk_stubs_init_p())? Tk_MainWindow(ptr->ip): (Tk_Window)NULL; #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateObjCommand(ptr->ip, "exit", ip_InterpExitObjCmd, + Tcl_CreateObjCommand(ptr->ip, "exit", ip_InterpExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateCommand(ptr->ip, "exit", ip_InterpExitCommand, + Tcl_CreateCommand(ptr->ip, "exit", ip_InterpExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif @@ -6163,7 +6163,7 @@ ip_make_safe(self) VALUE self; { struct tcltkip *ptr = get_ip(self); - + /* ip is deleted? */ if (deleted_ip(ptr)) { rb_raise(rb_eRuntimeError, "interpreter is deleted"); @@ -6178,7 +6178,7 @@ ip_is_safe_p(self) VALUE self; { struct tcltkip *ptr = get_ip(self); - + /* ip is deleted? */ if (deleted_ip(ptr)) { rb_raise(rb_eRuntimeError, "interpreter is deleted"); @@ -6197,7 +6197,7 @@ ip_allow_ruby_exit_p(self) VALUE self; { struct tcltkip *ptr = get_ip(self); - + /* ip is deleted? */ if (deleted_ip(ptr)) { rb_raise(rb_eRuntimeError, "interpreter is deleted"); @@ -6226,14 +6226,14 @@ ip_allow_ruby_exit_set(self, val) } if (Tcl_IsSafe(ptr->ip)) { - rb_raise(rb_eSecurityError, + rb_raise(rb_eSecurityError, "insecure operation on a safe interpreter"); } /* - * Because of cross-threading, the following line may fail to find + * Because of cross-threading, the following line may fail to find * the MainWindow, even if the Tcl/Tk interpreter has one or more. - * But it has no problem. Current implementation of both type of + * But it has no problem. Current implementation of both type of * the "exit" command don't need maiinWin token. */ mainWin = (tk_stubs_init_p())? Tk_MainWindow(ptr->ip): (Tk_Window)NULL; @@ -6242,11 +6242,11 @@ ip_allow_ruby_exit_set(self, val) ptr->allow_ruby_exit = 1; #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"ruby_exit\""); - Tcl_CreateObjCommand(ptr->ip, "exit", ip_RubyExitObjCmd, + Tcl_CreateObjCommand(ptr->ip, "exit", ip_RubyExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"exit\") --> \"ruby_exit\""); - Tcl_CreateCommand(ptr->ip, "exit", ip_RubyExitCommand, + Tcl_CreateCommand(ptr->ip, "exit", ip_RubyExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif return Qtrue; @@ -6255,11 +6255,11 @@ ip_allow_ruby_exit_set(self, val) ptr->allow_ruby_exit = 0; #if TCL_MAJOR_VERSION >= 8 DUMP1("Tcl_CreateObjCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateObjCommand(ptr->ip, "exit", ip_InterpExitObjCmd, + Tcl_CreateObjCommand(ptr->ip, "exit", ip_InterpExitObjCmd, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #else /* TCL_MAJOR_VERSION < 8 */ DUMP1("Tcl_CreateCommand(\"exit\") --> \"interp_exit\""); - Tcl_CreateCommand(ptr->ip, "exit", ip_InterpExitCommand, + Tcl_CreateCommand(ptr->ip, "exit", ip_InterpExitCommand, (ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL); #endif return Qfalse; @@ -6506,7 +6506,7 @@ call_queue_handler(evPtr, flags) if (RTEST(rb_funcall(thread, ID_alive_p, 0)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { #else - if (RTEST(rb_thread_alive_p(thread)) + if (RTEST(rb_thread_alive_p(thread)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { #endif DUMP1("caller is not yet ready to receive the result -> pending"); @@ -6530,7 +6530,7 @@ call_queue_handler(evPtr, flags) if (rb_safe_level() != q->safe_level) { /* q_dat = Data_Wrap_Struct(rb_cData,0,-1,q); */ q_dat = Data_Wrap_Struct(rb_cData,call_queue_mark,-1,q); - ret = rb_funcall(rb_proc_new(callq_safelevel_handler, q_dat), + ret = rb_funcall(rb_proc_new(callq_safelevel_handler, q_dat), ID_call, 0); rb_gc_force_recycle(q_dat); q_dat = (VALUE)NULL; @@ -6611,11 +6611,11 @@ tk_funcall(func, argc, argv, obj) #ifdef RUBY_USE_NATIVE_THREAD if (ptr) { /* on Tcl interpreter */ - is_tk_evloop_thread = (ptr->tk_thread_id == (Tcl_ThreadId) 0 + is_tk_evloop_thread = (ptr->tk_thread_id == (Tcl_ThreadId) 0 || ptr->tk_thread_id == Tcl_GetCurrentThread()); } else { /* on Tcl/Tk library */ - is_tk_evloop_thread = (tk_eventloop_thread_id == (Tcl_ThreadId) 0 + is_tk_evloop_thread = (tk_eventloop_thread_id == (Tcl_ThreadId) 0 || tk_eventloop_thread_id == Tcl_GetCurrentThread()); } #else @@ -6686,15 +6686,15 @@ tk_funcall(func, argc, argv, obj) DUMP1("add handler"); #ifdef RUBY_USE_NATIVE_THREAD if (ptr && ptr->tk_thread_id) { - /* Tcl_ThreadQueueEvent(ptr->tk_thread_id, + /* Tcl_ThreadQueueEvent(ptr->tk_thread_id, &(callq->ev), TCL_QUEUE_HEAD); */ - Tcl_ThreadQueueEvent(ptr->tk_thread_id, + Tcl_ThreadQueueEvent(ptr->tk_thread_id, (Tcl_Event*)callq, TCL_QUEUE_HEAD); Tcl_ThreadAlert(ptr->tk_thread_id); } else if (tk_eventloop_thread_id) { - /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id, + /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id, &(callq->ev), TCL_QUEUE_HEAD); */ - Tcl_ThreadQueueEvent(tk_eventloop_thread_id, + Tcl_ThreadQueueEvent(tk_eventloop_thread_id, (Tcl_Event*)callq, TCL_QUEUE_HEAD); Tcl_ThreadAlert(tk_eventloop_thread_id); } else { @@ -6768,7 +6768,7 @@ tk_funcall(func, argc, argv, obj) if (rb_obj_is_kind_of(ret, rb_eException)) { DUMP1("raise exception"); /* rb_exc_raise(ret); */ - rb_exc_raise(rb_exc_new3(rb_obj_class(ret), + rb_exc_raise(rb_exc_new3(rb_obj_class(ret), rb_funcall(ret, ID_to_s, 0, 0))); } @@ -6845,7 +6845,7 @@ ip_eval_real(self, cmd_str, cmd_len) switch(status) { case TAG_RAISE: if (NIL_P(rb_errinfo())) { - rbtk_pending_exception = rb_exc_new2(rb_eException, + rbtk_pending_exception = rb_exc_new2(rb_eException, "unknown exception"); } else { rbtk_pending_exception = rb_errinfo(); @@ -6878,18 +6878,18 @@ ip_eval_real(self, cmd_str, cmd_len) switch (ptr->return_value) { case TCL_RETURN: - exc = create_ip_exc(self, eTkCallbackReturn, + exc = create_ip_exc(self, eTkCallbackReturn, "ip_eval_real receives TCL_RETURN"); case TCL_BREAK: - exc = create_ip_exc(self, eTkCallbackBreak, + exc = create_ip_exc(self, eTkCallbackBreak, "ip_eval_real receives TCL_BREAK"); case TCL_CONTINUE: - exc = create_ip_exc(self, eTkCallbackContinue, + exc = create_ip_exc(self, eTkCallbackContinue, "ip_eval_real receives TCL_CONTINUE"); default: - exc = create_ip_exc(self, rb_eRuntimeError, "%s", + exc = create_ip_exc(self, rb_eRuntimeError, "%s", Tcl_GetStringResult(ptr->ip)); - } + } rbtk_release_ip(ptr); rb_thread_critical = thr_crit_bup; @@ -6938,17 +6938,17 @@ ip_eval_real(self, cmd_str, cmd_len) switch (ptr->return_value) { case TCL_RETURN: - exc = create_ip_exc(self, eTkCallbackReturn, + exc = create_ip_exc(self, eTkCallbackReturn, "ip_eval_real receives TCL_RETURN"); case TCL_BREAK: - exc = create_ip_exc(self, eTkCallbackBreak, + exc = create_ip_exc(self, eTkCallbackBreak, "ip_eval_real receives TCL_BREAK"); case TCL_CONTINUE: - exc = create_ip_exc(self, eTkCallbackContinue, + exc = create_ip_exc(self, eTkCallbackContinue, "ip_eval_real receives TCL_CONTINUE"); default: exc = create_ip_exc(self, rb_eRuntimeError, "%s", ptr->ip->result); - } + } rbtk_release_ip(ptr); return exc; @@ -7002,7 +7002,7 @@ eval_queue_handler(evPtr, flags) if (RTEST(rb_funcall(thread, ID_alive_p, 0)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { #else - if (RTEST(rb_thread_alive_p(thread)) + if (RTEST(rb_thread_alive_p(thread)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { #endif DUMP1("caller is not yet ready to receive the result -> pending"); @@ -7033,7 +7033,7 @@ eval_queue_handler(evPtr, flags) #endif /* q_dat = Data_Wrap_Struct(rb_cData,0,-1,q); */ q_dat = Data_Wrap_Struct(rb_cData,eval_queue_mark,-1,q); - ret = rb_funcall(rb_proc_new(evq_safelevel_handler, q_dat), + ret = rb_funcall(rb_proc_new(evq_safelevel_handler, q_dat), ID_call, 0); rb_gc_force_recycle(q_dat); q_dat = (VALUE)NULL; @@ -7119,7 +7119,7 @@ ip_eval(self, str) if ( #ifdef RUBY_USE_NATIVE_THREAD (ptr->tk_thread_id == 0 || ptr->tk_thread_id == Tcl_GetCurrentThread()) - && + && #endif (NIL_P(eventloop_thread) || current == eventloop_thread) ) { @@ -7187,7 +7187,7 @@ ip_eval(self, str) Tcl_ThreadAlert(ptr->tk_thread_id); } else if (tk_eventloop_thread_id) { Tcl_ThreadQueueEvent(tk_eventloop_thread_id, (Tcl_Event*)evq, position); - /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id, + /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id, &(evq->ev), position); */ Tcl_ThreadAlert(tk_eventloop_thread_id); } else { @@ -7254,7 +7254,7 @@ ip_eval(self, str) if (rb_obj_is_kind_of(ret, rb_eException)) { DUMP1("raise exception"); /* rb_exc_raise(ret); */ - rb_exc_raise(rb_exc_new3(rb_obj_class(ret), + rb_exc_raise(rb_exc_new3(rb_obj_class(ret), rb_funcall(ret, ID_to_s, 0, 0))); } @@ -7269,7 +7269,7 @@ ip_cancel_eval_core(interp, msg, flag) int flag; { #if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6) - rb_raise(rb_eNotImpError, + rb_raise(rb_eNotImpError, "cancel_eval is supported Tcl/Tk8.6 or later."); #else Tcl_Obj *msg_obj; @@ -7495,7 +7495,7 @@ lib_toUTF8_core(ip_obj, src, encodename) if (!RSTRING_LEN(enc)) { encoding = (Tcl_Encoding)NULL; } else { - encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, + encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc)); if (encoding == (Tcl_Encoding)NULL) { rb_warning("Tk-interp has unknown encoding information (@encoding:'%s')", RSTRING_PTR(enc)); @@ -7514,7 +7514,7 @@ lib_toUTF8_core(ip_obj, src, encodename) return str; } /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(enc)); */ - encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, + encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc)); if (encoding == (Tcl_Encoding)NULL) { rb_warning("string has unknown encoding information (@encoding:'%s')", RSTRING_PTR(enc)); @@ -7537,10 +7537,10 @@ lib_toUTF8_core(ip_obj, src, encodename) encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(encodename)); if (encoding == (Tcl_Encoding)NULL) { /* - rb_warning("unknown encoding name '%s'", + rb_warning("unknown encoding name '%s'", RSTRING_PTR(encodename)); */ - rb_raise(rb_eArgError, "unknown encoding name '%s'", + rb_raise(rb_eArgError, "unknown encoding name '%s'", RSTRING_PTR(encodename)); } } @@ -7686,7 +7686,7 @@ lib_fromUTF8_core(ip_obj, src, encodename) if (!RSTRING_LEN(enc)) { encoding = (Tcl_Encoding)NULL; } else { - encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, + encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(enc)); if (encoding == (Tcl_Encoding)NULL) { rb_warning("Tk-interp has unknown encoding information (@encoding:'%s')", RSTRING_PTR(enc)); @@ -7724,12 +7724,12 @@ lib_fromUTF8_core(ip_obj, src, encodename) /* encoding = Tcl_GetEncoding(interp, RSTRING_PTR(encodename)); */ encoding = Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(encodename)); if (encoding == (Tcl_Encoding)NULL) { - /* - rb_warning("unknown encoding name '%s'", + /* + rb_warning("unknown encoding name '%s'", RSTRING_PTR(encodename)); encodename = Qnil; */ - rb_raise(rb_eArgError, "unknown encoding name '%s'", + rb_raise(rb_eArgError, "unknown encoding name '%s'", RSTRING_PTR(encodename)); } } @@ -7937,9 +7937,9 @@ lib_set_system_encoding(self, enc_name) } enc_name = rb_funcall(enc_name, ID_to_s, 0, 0); - if (Tcl_SetSystemEncoding((Tcl_Interp *)NULL, + if (Tcl_SetSystemEncoding((Tcl_Interp *)NULL, StringValuePtr(enc_name)) != TCL_OK) { - rb_raise(rb_eArgError, "unknown encoding name '%s'", + rb_raise(rb_eArgError, "unknown encoding name '%s'", RSTRING_PTR(enc_name)); } @@ -7999,16 +7999,16 @@ invoke_tcl_proc(arg) /* Invoke the C procedure */ #if TCL_MAJOR_VERSION >= 8 if (inf->cmdinfo.isNativeObjectProc) { - inf->ptr->return_value - = (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData, + inf->ptr->return_value + = (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData, inf->ptr->ip, inf->objc, inf->objv); } else #endif { #if TCL_MAJOR_VERSION >= 8 - inf->ptr->return_value - = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip, + inf->ptr->return_value + = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip, argc, (CONST84 char **)argv); #if 0 /* use Tcl_EventuallyFree */ @@ -8023,8 +8023,8 @@ invoke_tcl_proc(arg) #endif #else /* TCL_MAJOR_VERSION < 8 */ - inf->ptr->return_value - = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip, + inf->ptr->return_value + = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip, inf->argc, inf->argv); #endif } @@ -8092,11 +8092,11 @@ ip_invoke_core(interp, argc, argv) if (!Tcl_GetCommandInfo(ptr->ip, cmd, &info)) { DUMP1("error Tcl_GetCommandInfo"); DUMP1("try auto_load (call 'unknown' command)"); - if (!Tcl_GetCommandInfo(ptr->ip, + if (!Tcl_GetCommandInfo(ptr->ip, #if TCL_MAJOR_VERSION >= 8 - "::unknown", + "::unknown", #else - "unknown", + "unknown", #endif &info)) { DUMP1("fail to get 'unknown' command"); @@ -8105,7 +8105,7 @@ ip_invoke_core(interp, argc, argv) /* Tcl_Release(ptr->ip); */ rbtk_release_ip(ptr); /*rb_ip_raise(obj,rb_eNameError,"invalid command name `%s'",cmd);*/ - return create_ip_exc(interp, rb_eNameError, + return create_ip_exc(interp, rb_eNameError, "invalid command name `%s'", cmd); } else { if (event_loop_abort_on_exc < 0) { @@ -8173,13 +8173,13 @@ ip_invoke_core(interp, argc, argv) switch(status) { case TAG_RAISE: if (NIL_P(rb_errinfo())) { - rbtk_pending_exception = rb_exc_new2(rb_eException, + rbtk_pending_exception = rb_exc_new2(rb_eException, "unknown exception"); } else { rbtk_pending_exception = rb_errinfo(); } break; - + case TAG_FATAL: if (NIL_P(rb_errinfo())) { rbtk_pending_exception = rb_exc_new2(rb_eFatal, "FATAL"); @@ -8213,7 +8213,7 @@ ip_invoke_core(interp, argc, argv) /* Invoke the C procedure */ #if TCL_MAJOR_VERSION >= 8 if (info.isNativeObjectProc) { - ptr->return_value = (*info.objProc)(info.objClientData, ptr->ip, + ptr->return_value = (*info.objProc)(info.objClientData, ptr->ip, objc, objv); #if 0 /* get the string value from the result object */ @@ -8226,7 +8226,7 @@ ip_invoke_core(interp, argc, argv) #endif { #if TCL_MAJOR_VERSION >= 8 - ptr->return_value = (*info.proc)(info.clientData, ptr->ip, + ptr->return_value = (*info.proc)(info.clientData, ptr->ip, argc, (CONST84 char **)argv); #if 0 /* use Tcl_EventuallyFree */ @@ -8241,7 +8241,7 @@ ip_invoke_core(interp, argc, argv) #endif #else /* TCL_MAJOR_VERSION < 8 */ - ptr->return_value = (*info.proc)(info.clientData, ptr->ip, + ptr->return_value = (*info.proc)(info.clientData, ptr->ip, argc, argv); #endif } @@ -8289,18 +8289,18 @@ ip_invoke_core(interp, argc, argv) if (event_loop_abort_on_exc > 0 && !Tcl_InterpDeleted(ptr->ip)) { switch (ptr->return_value) { case TCL_RETURN: - return create_ip_exc(interp, eTkCallbackReturn, + return create_ip_exc(interp, eTkCallbackReturn, "ip_invoke_core receives TCL_RETURN"); case TCL_BREAK: - return create_ip_exc(interp, eTkCallbackBreak, + return create_ip_exc(interp, eTkCallbackBreak, "ip_invoke_core receives TCL_BREAK"); case TCL_CONTINUE: - return create_ip_exc(interp, eTkCallbackContinue, + return create_ip_exc(interp, eTkCallbackContinue, "ip_invoke_core receives TCL_CONTINUE"); default: - return create_ip_exc(interp, rb_eRuntimeError, "%s", + return create_ip_exc(interp, rb_eRuntimeError, "%s", Tcl_GetStringResult(ptr->ip)); - } + } } else { if (event_loop_abort_on_exc < 0) { @@ -8492,7 +8492,7 @@ invoke_queue_handler(evPtr, flags) if (RTEST(rb_funcall(thread, ID_alive_p, 0)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { #else - if (RTEST(rb_thread_alive_p(thread)) + if (RTEST(rb_thread_alive_p(thread)) && ! RTEST(rb_funcall(thread, ID_stop_p, 0))) { #endif DUMP1("caller is not yet ready to receive the result -> pending"); @@ -8516,7 +8516,7 @@ invoke_queue_handler(evPtr, flags) if (rb_safe_level() != q->safe_level) { /* q_dat = Data_Wrap_Struct(rb_cData,0,0,q); */ q_dat = Data_Wrap_Struct(rb_cData,invoke_queue_mark,-1,q); - ret = rb_funcall(rb_proc_new(ivq_safelevel_handler, q_dat), + ret = rb_funcall(rb_proc_new(ivq_safelevel_handler, q_dat), ID_call, 0); rb_gc_force_recycle(q_dat); q_dat = (VALUE)NULL; @@ -8609,7 +8609,7 @@ ip_invoke_with_position(argc, argv, obj, position) if ( #ifdef RUBY_USE_NATIVE_THREAD (ptr->tk_thread_id == 0 || ptr->tk_thread_id == Tcl_GetCurrentThread()) - && + && #endif (NIL_P(eventloop_thread) || current == eventloop_thread) ) { @@ -8669,9 +8669,9 @@ ip_invoke_with_position(argc, argv, obj, position) Tcl_ThreadQueueEvent(ptr->tk_thread_id, (Tcl_Event*)ivq, position); Tcl_ThreadAlert(ptr->tk_thread_id); } else if (tk_eventloop_thread_id) { - /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id, + /* Tcl_ThreadQueueEvent(tk_eventloop_thread_id, &(ivq->ev), position); */ - Tcl_ThreadQueueEvent(tk_eventloop_thread_id, + Tcl_ThreadQueueEvent(tk_eventloop_thread_id, (Tcl_Event*)ivq, position); Tcl_ThreadAlert(tk_eventloop_thread_id); } else { @@ -8735,7 +8735,7 @@ ip_invoke_with_position(argc, argv, obj, position) if (rb_obj_is_kind_of(ret, rb_eException)) { DUMP1("raise exception"); /* rb_exc_raise(ret); */ - rb_exc_raise(rb_exc_new3(rb_obj_class(ret), + rb_exc_raise(rb_exc_new3(rb_obj_class(ret), rb_funcall(ret, ID_to_s, 0, 0))); } @@ -8798,7 +8798,7 @@ ip_get_variable2_core(interp, argc, argv) index = argv[1]; flag = argv[2]; - /* + /* StringValue(varname); if (!NIL_P(index)) StringValue(index); */ @@ -8825,9 +8825,9 @@ ip_get_variable2_core(interp, argc, argv) if (ret == (Tcl_Obj*)NULL) { volatile VALUE exc; - /* exc = rb_exc_new2(rb_eRuntimeError, + /* exc = rb_exc_new2(rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); */ - exc = create_ip_exc(interp, rb_eRuntimeError, + exc = create_ip_exc(interp, rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); /* Tcl_Release(ptr->ip); */ rbtk_release_ip(ptr); @@ -8856,7 +8856,7 @@ ip_get_variable2_core(interp, argc, argv) } else { /* Tcl_Preserve(ptr->ip); */ rbtk_preserve_ip(ptr); - ret = Tcl_GetVar2(ptr->ip, RSTRING_PTR(varname), + ret = Tcl_GetVar2(ptr->ip, RSTRING_PTR(varname), NIL_P(index) ? NULL : RSTRING_PTR(index), FIX2INT(flag)); } @@ -8964,9 +8964,9 @@ ip_set_variable2_core(interp, argc, argv) if (ret == (Tcl_Obj*)NULL) { volatile VALUE exc; - /* exc = rb_exc_new2(rb_eRuntimeError, + /* exc = rb_exc_new2(rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); */ - exc = create_ip_exc(interp, rb_eRuntimeError, + exc = create_ip_exc(interp, rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); /* Tcl_Release(ptr->ip); */ rbtk_release_ip(ptr); @@ -8996,8 +8996,8 @@ ip_set_variable2_core(interp, argc, argv) } else { /* Tcl_Preserve(ptr->ip); */ rbtk_preserve_ip(ptr); - ret = Tcl_SetVar2(ptr->ip, RSTRING_PTR(varname), - NIL_P(index) ? NULL : RSTRING_PTR(index), + ret = Tcl_SetVar2(ptr->ip, RSTRING_PTR(varname), + NIL_P(index) ? NULL : RSTRING_PTR(index), RSTRING_PTR(value), FIX2INT(flag)); } @@ -9068,7 +9068,7 @@ ip_unset_variable2_core(interp, argc, argv) index = argv[1]; flag = argv[2]; - /* + /* StringValue(varname); if (!NIL_P(index)) StringValue(index); */ @@ -9078,15 +9078,15 @@ ip_unset_variable2_core(interp, argc, argv) return Qtrue; } - ptr->return_value = Tcl_UnsetVar2(ptr->ip, RSTRING_PTR(varname), + ptr->return_value = Tcl_UnsetVar2(ptr->ip, RSTRING_PTR(varname), NIL_P(index) ? NULL : RSTRING_PTR(index), FIX2INT(flag)); if (ptr->return_value == TCL_ERROR) { if (FIX2INT(flag) & TCL_LEAVE_ERR_MSG) { - /* return rb_exc_new2(rb_eRuntimeError, + /* return rb_exc_new2(rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); */ - return create_ip_exc(interp, rb_eRuntimeError, + return create_ip_exc(interp, rb_eRuntimeError, Tcl_GetStringResult(ptr->ip)); } return Qfalse; @@ -9134,7 +9134,7 @@ ip_get_global_var(self, varname) VALUE self; VALUE varname; { - return ip_get_variable(self, varname, + return ip_get_variable(self, varname, INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); } @@ -9144,7 +9144,7 @@ ip_get_global_var2(self, varname, index) VALUE varname; VALUE index; { - return ip_get_variable2(self, varname, index, + return ip_get_variable2(self, varname, index, INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); } @@ -9154,7 +9154,7 @@ ip_set_global_var(self, varname, value) VALUE varname; VALUE value; { - return ip_set_variable(self, varname, value, + return ip_set_variable(self, varname, value, INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); } @@ -9165,7 +9165,7 @@ ip_set_global_var2(self, varname, index, value) VALUE index; VALUE value; { - return ip_set_variable2(self, varname, index, value, + return ip_set_variable2(self, varname, index, value, INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); } @@ -9174,7 +9174,7 @@ ip_unset_global_var(self, varname) VALUE self; VALUE varname; { - return ip_unset_variable(self, varname, + return ip_unset_variable(self, varname, INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); } @@ -9184,7 +9184,7 @@ ip_unset_global_var2(self, varname, index) VALUE varname; VALUE index; { - return ip_unset_variable2(self, varname, index, + return ip_unset_variable2(self, varname, index, INT2FIX(TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); } @@ -9291,7 +9291,7 @@ lib_split_tklist_core(ip_obj, list_str) int argc; char **argv; - if (Tcl_SplitList(interp, RSTRING_PTR(list_str), + if (Tcl_SplitList(interp, RSTRING_PTR(list_str), &argc, &argv) == TCL_ERROR) { if (interp == (Tcl_Interp*)NULL) { rb_raise(rb_eRuntimeError, "can't get elements from list"); @@ -9376,7 +9376,7 @@ lib_merge_tklist(argc, argv, obj) if (OBJ_TAINTED(argv[num])) taint_flag = 1; dst = StringValuePtr(argv[num]); #if TCL_MAJOR_VERSION >= 8 - len += Tcl_ScanCountedElement(dst, RSTRING_LEN(argv[num]), + len += Tcl_ScanCountedElement(dst, RSTRING_LEN(argv[num]), &flagPtr[num]) + 1; #else /* TCL_MAJOR_VERSION < 8 */ len += Tcl_ScanElement(dst, &flagPtr[num]) + 1; @@ -9392,8 +9392,8 @@ lib_merge_tklist(argc, argv, obj) dst = result; for(num = 0; num < argc; num++) { #if TCL_MAJOR_VERSION >= 8 - len = Tcl_ConvertCountedElement(RSTRING_PTR(argv[num]), - RSTRING_LEN(argv[num]), + len = Tcl_ConvertCountedElement(RSTRING_PTR(argv[num]), + RSTRING_LEN(argv[num]), dst, flagPtr[num]); #else /* TCL_MAJOR_VERSION < 8 */ len = Tcl_ConvertElement(RSTRING_PTR(argv[num]), dst, flagPtr[num]); @@ -9457,10 +9457,10 @@ lib_conv_listelement(self, src) StringValue(src); #if TCL_MAJOR_VERSION >= 8 - len = Tcl_ScanCountedElement(RSTRING_PTR(src), RSTRING_LEN(src), + len = Tcl_ScanCountedElement(RSTRING_PTR(src), RSTRING_LEN(src), &scan_flag); dst = rb_str_new(0, len + 1); - len = Tcl_ConvertCountedElement(RSTRING_PTR(src), RSTRING_LEN(src), + len = Tcl_ConvertCountedElement(RSTRING_PTR(src), RSTRING_LEN(src), RSTRING_PTR(dst), scan_flag); #else /* TCL_MAJOR_VERSION < 8 */ len = Tcl_ScanElement(RSTRING_PTR(src), &scan_flag); @@ -9482,9 +9482,9 @@ lib_getversion(self) { set_tcltk_version(); - return rb_ary_new3(4, INT2NUM(tcltk_version.major), - INT2NUM(tcltk_version.minor), - INT2NUM(tcltk_version.type), + return rb_ary_new3(4, INT2NUM(tcltk_version.major), + INT2NUM(tcltk_version.minor), + INT2NUM(tcltk_version.type), INT2NUM(tcltk_version.patchlevel)); } @@ -9512,7 +9512,7 @@ tcltklib_compile_info() { volatile VALUE ret; int size; - char form[] + char form[] = "tcltklib %s :: Ruby%s (%s) %s pthread :: Tcl%s(%s)/Tk%s(%s) %s"; char *info; @@ -9520,31 +9520,31 @@ tcltklib_compile_info() + strlen(TCLTKLIB_RELEASE_DATE) + strlen(RUBY_VERSION) + strlen(RUBY_RELEASE_DATE) - + strlen("without") + + strlen("without") + strlen(TCL_PATCH_LEVEL) + strlen("without stub") + strlen(TK_PATCH_LEVEL) - + strlen("without stub") + + strlen("without stub") + strlen("unknown tcl_threads"); info = ALLOC_N(char, size); /* info = ckalloc(sizeof(char) * size); */ /* SEGV */ sprintf(info, form, - TCLTKLIB_RELEASE_DATE, - RUBY_VERSION, RUBY_RELEASE_DATE, + TCLTKLIB_RELEASE_DATE, + RUBY_VERSION, RUBY_RELEASE_DATE, #ifdef HAVE_NATIVETHREAD "with", #else "without", #endif - TCL_PATCH_LEVEL, + TCL_PATCH_LEVEL, #ifdef USE_TCL_STUBS "with stub", #else "without stub", #endif - TK_PATCH_LEVEL, + TK_PATCH_LEVEL, #ifdef USE_TK_STUBS "with stub", #else @@ -9587,7 +9587,7 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode) #if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 1) if (Tcl_GetEncoding((Tcl_Interp*)NULL, RSTRING_PTR(name)) == (Tcl_Encoding)NULL) { if (RTEST(error_mode)) { - rb_raise(rb_eArgError, "invalid Tk encoding name '%s'", + rb_raise(rb_eArgError, "invalid Tk encoding name '%s'", RSTRING_PTR(name)); } else { return Qnil; @@ -9646,7 +9646,7 @@ update_encoding_table(table, interp, error_mode) enc_list = Tcl_GetObjResult(ptr->ip); Tcl_IncrRefCount(enc_list); - if (Tcl_ListObjGetElements(ptr->ip, enc_list, + if (Tcl_ListObjGetElements(ptr->ip, enc_list, &objc, &objv) != TCL_OK) { Tcl_DecrRefCount(enc_list); /* rb_raise(rb_eRuntimeError, "failt to get Tcl's encoding names");*/ @@ -9793,7 +9793,7 @@ encoding_table_get_obj_core(table, enc, error_mode) { volatile VALUE obj = Qnil; - obj = rb_hash_lookup(table, + obj = rb_hash_lookup(table, encoding_table_get_name_core(table, enc, error_mode)); if (RTEST(rb_obj_is_kind_of(obj, cRubyEncoding))) { return obj; @@ -9867,7 +9867,7 @@ encoding_table_get_name_core(table, enc, error_mode) } /* update check */ - if (update_encoding_table(table, rb_ivar_get(table, ID_at_interp), + if (update_encoding_table(table, rb_ivar_get(table, ID_at_interp), error_mode)) { /* add new relations to the table */ /* RETRY: registered Ruby encoding? */ @@ -9951,7 +9951,7 @@ create_encoding_table_core(arg, interp) encobj = rb_enc_from_encoding(rb_enc_from_index(ENCODING_INDEX_BINARY)); rb_hash_aset(table, ENCODING_NAME_BINARY, encobj); rb_hash_aset(table, encobj, ENCODING_NAME_BINARY); - + /* Tcl stub check */ tcl_stubs_check(); @@ -10083,7 +10083,7 @@ static VALUE create_encoding_table(interp) VALUE interp; { - return rb_funcall(rb_proc_new(create_encoding_table_core, interp), + return rb_funcall(rb_proc_new(create_encoding_table_core, interp), ID_call, 0); } @@ -10109,7 +10109,7 @@ ip_get_encoding_table(interp) /*###############################################*/ /* - * The following is based on tkMenu.[ch] + * The following is based on tkMenu.[ch] * of Tcl/Tk (Tk8.0 -- Tk8.5b1) source code. */ #if TCL_MAJOR_VERSION >= 8 @@ -10172,10 +10172,10 @@ ip_make_menu_embeddable_core(interp, argc, argv) #if 0 /* was available on Tk8.0 -- Tk8.4 */ menuRefPtr = TkFindMenuReferences(ptr->ip, RSTRING_PTR(menu_path)); #else /* based on Tk8.0 -- Tk8.5b1 */ - if ((menuTablePtr + if ((menuTablePtr = (Tcl_HashTable *) Tcl_GetAssocData(ptr->ip, MENU_HASH_KEY, NULL)) != NULL) { - if ((hashEntryPtr + if ((hashEntryPtr = Tcl_FindHashEntry(menuTablePtr, RSTRING_PTR(menu_path))) != NULL) { menuRefPtr = (struct dummy_TkMenuRef *) Tcl_GetHashValue(hashEntryPtr); @@ -10188,12 +10188,12 @@ ip_make_menu_embeddable_core(interp, argc, argv) } if (menuRefPtr->menuPtr == (struct dummy_TkMenu *) NULL) { - rb_raise(rb_eRuntimeError, + rb_raise(rb_eRuntimeError, "invalid menu widget (maybe already destroyed)"); } if ((menuRefPtr->menuPtr)->menuType != MENUBAR) { - rb_raise(rb_eRuntimeError, + rb_raise(rb_eRuntimeError, "target menu widget must be a MENUBAR type"); } @@ -10212,7 +10212,7 @@ ip_make_menu_embeddable_core(interp, argc, argv) #if 0 /* was available on Tk8.0 -- Tk8.4 */ TkEventuallyRecomputeMenu(menuRefPtr->menuPtr); - TkEventuallyRedrawMenu(menuRefPtr->menuPtr, + TkEventuallyRedrawMenu(menuRefPtr->menuPtr, (struct dummy_TkMenuEntry *)NULL); #else /* based on Tk8.0 -- Tk8.5b1 */ memset((void *) &event, 0, sizeof(event)); @@ -10295,10 +10295,10 @@ Init_tcltklib() rb_define_const(lib, "COMPILE_INFO", tcltklib_compile_info()); - rb_define_const(lib, "RELEASE_DATE", + rb_define_const(lib, "RELEASE_DATE", rb_obj_freeze(rb_str_new2(tcltklib_release_date))); - rb_define_const(lib, "FINALIZE_PROC_NAME", + rb_define_const(lib, "FINALIZE_PROC_NAME", rb_str_new2(finalize_hook_name)); /* --------------------------------------------------------------- */ @@ -10316,7 +10316,7 @@ Init_tcltklib() #endif #endif #endif - rb_define_const(lib, "WINDOWING_SYSTEM", + rb_define_const(lib, "WINDOWING_SYSTEM", rb_obj_freeze(rb_str_new2(TK_WINDOWING_SYSTEM))); /* --------------------------------------------------------------- */ @@ -10350,7 +10350,7 @@ Init_tcltklib() /* --------------------------------------------------------------- */ rb_define_module_function(lib, "get_version", lib_getversion, -1); - rb_define_module_function(lib, "get_release_type_name", + rb_define_module_function(lib, "get_release_type_name", lib_get_reltype_name, -1); rb_define_const(release_type, "ALPHA", INT2FIX(TCL_ALPHA_RELEASE)); @@ -10402,53 +10402,53 @@ Init_tcltklib() /* --------------------------------------------------------------- */ rb_define_module_function(lib, "mainloop", lib_mainloop, -1); - rb_define_module_function(lib, "mainloop_thread?", + rb_define_module_function(lib, "mainloop_thread?", lib_evloop_thread_p, 0); - rb_define_module_function(lib, "mainloop_watchdog", + rb_define_module_function(lib, "mainloop_watchdog", lib_mainloop_watchdog, -1); - rb_define_module_function(lib, "do_thread_callback", + rb_define_module_function(lib, "do_thread_callback", lib_thread_callback, -1); rb_define_module_function(lib, "do_one_event", lib_do_one_event, -1); - rb_define_module_function(lib, "mainloop_abort_on_exception", + rb_define_module_function(lib, "mainloop_abort_on_exception", lib_evloop_abort_on_exc, 0); - rb_define_module_function(lib, "mainloop_abort_on_exception=", + rb_define_module_function(lib, "mainloop_abort_on_exception=", lib_evloop_abort_on_exc_set, 1); - rb_define_module_function(lib, "set_eventloop_window_mode", + rb_define_module_function(lib, "set_eventloop_window_mode", set_eventloop_window_mode, 1); - rb_define_module_function(lib, "get_eventloop_window_mode", + rb_define_module_function(lib, "get_eventloop_window_mode", get_eventloop_window_mode, 0); rb_define_module_function(lib, "set_eventloop_tick",set_eventloop_tick,1); rb_define_module_function(lib, "get_eventloop_tick",get_eventloop_tick,0); rb_define_module_function(lib, "set_no_event_wait", set_no_event_wait, 1); rb_define_module_function(lib, "get_no_event_wait", get_no_event_wait, 0); - rb_define_module_function(lib, "set_eventloop_weight", + rb_define_module_function(lib, "set_eventloop_weight", set_eventloop_weight, 2); rb_define_module_function(lib, "set_max_block_time", set_max_block_time,1); - rb_define_module_function(lib, "get_eventloop_weight", + rb_define_module_function(lib, "get_eventloop_weight", get_eventloop_weight, 0); - rb_define_module_function(lib, "num_of_mainwindows", + rb_define_module_function(lib, "num_of_mainwindows", lib_num_of_mainwindows, 0); /* --------------------------------------------------------------- */ rb_define_module_function(lib, "_split_tklist", lib_split_tklist, 1); rb_define_module_function(lib, "_merge_tklist", lib_merge_tklist, -1); - rb_define_module_function(lib, "_conv_listelement", + rb_define_module_function(lib, "_conv_listelement", lib_conv_listelement, 1); rb_define_module_function(lib, "_toUTF8", lib_toUTF8, -1); rb_define_module_function(lib, "_fromUTF8", lib_fromUTF8, -1); - rb_define_module_function(lib, "_subst_UTF_backslash", + rb_define_module_function(lib, "_subst_UTF_backslash", lib_UTF_backslash, 1); - rb_define_module_function(lib, "_subst_Tcl_backslash", + rb_define_module_function(lib, "_subst_Tcl_backslash", lib_Tcl_backslash, 1); - rb_define_module_function(lib, "encoding_system", + rb_define_module_function(lib, "encoding_system", lib_get_system_encoding, 0); - rb_define_module_function(lib, "encoding_system=", + rb_define_module_function(lib, "encoding_system=", lib_set_system_encoding, 1); - rb_define_module_function(lib, "encoding", + rb_define_module_function(lib, "encoding", lib_get_system_encoding, 0); - rb_define_module_function(lib, "encoding=", + rb_define_module_function(lib, "encoding=", lib_set_system_encoding, 1); /* --------------------------------------------------------------- */ @@ -10480,7 +10480,7 @@ Init_tcltklib() /* --------------------------------------------------------------- */ - rb_define_method(ip, "create_dummy_encoding_for_tk", + rb_define_method(ip, "create_dummy_encoding_for_tk", create_dummy_encoding_for_tk, 1); rb_define_method(ip, "encoding_table", ip_get_encoding_table, 0); @@ -10514,9 +10514,9 @@ Init_tcltklib() rb_define_method(ip, "mainloop", ip_mainloop, -1); rb_define_method(ip, "mainloop_watchdog", ip_mainloop_watchdog, -1); rb_define_method(ip, "do_one_event", ip_do_one_event, -1); - rb_define_method(ip, "mainloop_abort_on_exception", + rb_define_method(ip, "mainloop_abort_on_exception", ip_evloop_abort_on_exc, 0); - rb_define_method(ip, "mainloop_abort_on_exception=", + rb_define_method(ip, "mainloop_abort_on_exception=", ip_evloop_abort_on_exc_set, 1); rb_define_method(ip, "set_eventloop_tick", ip_set_eventloop_tick, 1); rb_define_method(ip, "get_eventloop_tick", ip_get_eventloop_tick, 0); @@ -10534,7 +10534,7 @@ Init_tcltklib() #ifndef DEFAULT_EVENTLOOP_DEPTH #define DEFAULT_EVENTLOOP_DEPTH 7 -#endif +#endif eventloop_stack = rb_ary_new2(DEFAULT_EVENTLOOP_DEPTH); RbTk_OBJ_UNTRUST(eventloop_stack); @@ -10545,7 +10545,7 @@ Init_tcltklib() /* --------------------------------------------------------------- */ #ifdef HAVE_NATIVETHREAD - /* if ruby->nativethread-supprt and tcltklib->doen't, + /* if ruby->nativethread-supprt and tcltklib->doen't, the following will cause link-error. */ ruby_native_thread_p(); #endif diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c index 25011bb473b12f..019b5744aa6bdf 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -139,7 +139,7 @@ tk_do_callback(argc, argv, self) rb_scan_args(argc, argv, "1*", &id, &rest); return rb_apply(rb_hash_aref(CALLBACK_TABLE, id), ID_call, rest); #endif - return rb_funcall2(rb_hash_aref(CALLBACK_TABLE, argv[0]), + return rb_funcall2(rb_hash_aref(CALLBACK_TABLE, argv[0]), ID_call, argc - 1, argv + 1); } @@ -193,12 +193,12 @@ tk_uninstall_cmd(self, cmd_id) if (strncmp(cmd_id_head, RSTRING_PTR(cmd_id), head_len) != 0) { return Qnil; } - if (strncmp(cmd_id_prefix, + if (strncmp(cmd_id_prefix, RSTRING_PTR(cmd_id) + head_len, prefix_len) != 0) { return Qnil; } - return rb_hash_delete(CALLBACK_TABLE, + return rb_hash_delete(CALLBACK_TABLE, rb_str_new2(RSTRING_PTR(cmd_id) + head_len)); } @@ -681,7 +681,7 @@ push_kv_enc(key, val, args) #if 0 rb_ary_push(ary, key2keyname(key)); if (val != TK_None) { - rb_ary_push(ary, get_eval_string_core(val, Qtrue, + rb_ary_push(ary, get_eval_string_core(val, Qtrue, RARRAY_PTR(args)[1])); } #endif @@ -813,7 +813,7 @@ get_eval_string_core(obj, enc_flag, self) case T_SYMBOL: if (RTEST(enc_flag)) { if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) { - return rb_funcall(self, ID_toUTF8, 1, + return rb_funcall(self, ID_toUTF8, 1, rb_str_new2(rb_id2name(SYM2ID(obj)))); } else { return fromDefaultEnc_toUTF8(rb_str_new2(rb_id2name(SYM2ID(obj))), self); @@ -851,7 +851,7 @@ get_eval_string_core(obj, enc_flag, self) default: if (rb_obj_is_kind_of(obj, cTkObject)) { /* return rb_str_new3(rb_funcall(obj, ID_path, 0, 0)); */ - return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0), + return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0), enc_flag, self); } @@ -869,18 +869,18 @@ get_eval_string_core(obj, enc_flag, self) if (rb_obj_respond_to(obj, ID_to_eval, Qtrue)) { /* return rb_funcall(obj, ID_to_eval, 0, 0); */ - return get_eval_string_core(rb_funcall(obj, ID_to_eval, 0, 0), + return get_eval_string_core(rb_funcall(obj, ID_to_eval, 0, 0), enc_flag, self); } else if (rb_obj_respond_to(obj, ID_path, Qtrue)) { /* return rb_funcall(obj, ID_path, 0, 0); */ - return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0), + return get_eval_string_core(rb_funcall(obj, ID_path, 0, 0), enc_flag, self); } else if (rb_obj_respond_to(obj, ID_to_s, Qtrue)) { return rb_funcall(obj, ID_to_s, 0, 0); } } - rb_warning("fail to convert '%s' to string for Tk", + rb_warning("fail to convert '%s' to string for Tk", RSTRING_PTR(rb_funcall(obj, rb_intern("inspect"), 0, 0))); return obj; @@ -1023,7 +1023,7 @@ static VALUE tkstr_invalid_numstr(value) VALUE value; { - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "invalid value for Number: '%s'", RSTRING_PTR(value)); return Qnil; /*dummy*/ } @@ -1032,8 +1032,8 @@ static VALUE tkstr_rescue_float(value) VALUE value; { - return rb_rescue2(tkstr_to_float, value, - tkstr_invalid_numstr, value, + return rb_rescue2(tkstr_to_float, value, + tkstr_invalid_numstr, value, rb_eArgError, 0); } @@ -1045,8 +1045,8 @@ tkstr_to_number(value) if (RSTRING_PTR(value) == (char*)NULL) return INT2FIX(0); - return rb_rescue2(tkstr_to_int, value, - tkstr_rescue_float, value, + return rb_rescue2(tkstr_to_int, value, + tkstr_rescue_float, value, rb_eArgError, 0); } @@ -1095,8 +1095,8 @@ tcl2rb_num_or_str(self, value) if (RSTRING_PTR(value) == (char*)NULL) return rb_tainted_str_new2(""); - return rb_rescue2(tkstr_to_number, value, - tkstr_to_str, value, + return rb_rescue2(tkstr_to_number, value, + tkstr_to_str, value, rb_eArgError, 0); } @@ -1181,8 +1181,8 @@ allocate_cbsubst_info() static void cbsubst_init() { - rb_const_set(cCB_SUBST, ID_SUBST_INFO, - Data_Wrap_Struct(cSUBST_INFO, subst_mark, subst_free, + rb_const_set(cCB_SUBST, ID_SUBST_INFO, + Data_Wrap_Struct(cSUBST_INFO, subst_mark, subst_free, allocate_cbsubst_info())); } @@ -1195,7 +1195,7 @@ cbsubst_initialize(argc, argv, self) struct cbsubst_info *inf; int idx, iv_idx; - Data_Get_Struct(rb_const_get(rb_obj_class(self), ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(rb_obj_class(self), ID_SUBST_INFO), struct cbsubst_info, inf); idx = 0; @@ -1235,7 +1235,7 @@ each_attr_def(key, value, klass) key_id = SYM2ID(key); break; default: - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "includes invalid key(s). expected a String or a Symbol"); } @@ -1247,7 +1247,7 @@ each_attr_def(key, value, klass) value_id = SYM2ID(value); break; default: - rb_raise(rb_eArgError, + rb_raise(rb_eArgError, "includes invalid value(s). expected a String or a Symbol"); } @@ -1267,7 +1267,7 @@ cbsubst_def_attr_aliases(self, tbl) rb_raise(rb_eArgError, "expected a Hash"); } - Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), struct cbsubst_info, inf); rb_hash_foreach(tbl, each_attr_def, self); @@ -1289,7 +1289,7 @@ cbsubst_sym_to_subst(self, sym) if (TYPE(sym) != T_SYMBOL) return sym; - Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), struct cbsubst_info, inf); if (!NIL_P(ret = rb_hash_aref(inf->aliases, sym))) { @@ -1341,7 +1341,7 @@ cbsubst_get_subst_arg(argc, argv, self) ID id; volatile VALUE arg_sym, ret; - Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), struct cbsubst_info, inf); ptr = buf = ALLOC_N(char, inf->full_subst_length + 1); @@ -1411,7 +1411,7 @@ cbsubst_get_subst_key(self, str) list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str); len = RARRAY_LEN(list); - Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), struct cbsubst_info, inf); ptr = buf = ALLOC_N(char, inf->full_subst_length + len + 1); @@ -1459,7 +1459,7 @@ cbsubst_get_all_subst_keys(self) int idx, len; volatile VALUE ret; - Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), struct cbsubst_info, inf); ptr = buf = ALLOC_N(char, inf->full_subst_length + 1); @@ -1569,7 +1569,7 @@ cbsubst_table_setup(argc, argv, self) chr = (unsigned char)(0x80 + idx); subst_inf->keylen[chr] = RSTRING_LEN(RARRAY_PTR(inf)[0]); #if HAVE_STRNDUP - subst_inf->key[chr] = strndup(RSTRING_PTR(RARRAY_PTR(inf)[0]), + subst_inf->key[chr] = strndup(RSTRING_PTR(RARRAY_PTR(inf)[0]), RSTRING_LEN(RARRAY_PTR(inf)[0])); #else subst_inf->key[chr] = malloc(RSTRING_LEN(RARRAY_PTR(inf)[0]) + 1); @@ -1602,15 +1602,15 @@ cbsubst_table_setup(argc, argv, self) for(idx = 0; idx < len; idx++) { inf = RARRAY_PTR(proc_inf)[idx]; if (TYPE(inf) != T_ARRAY) continue; - rb_hash_aset(subst_inf->proc, - ((TYPE(RARRAY_PTR(inf)[0]) == T_STRING)? - INT2FIX(*(RSTRING_PTR(RARRAY_PTR(inf)[0]))) : - RARRAY_PTR(inf)[0]), + rb_hash_aset(subst_inf->proc, + ((TYPE(RARRAY_PTR(inf)[0]) == T_STRING)? + INT2FIX(*(RSTRING_PTR(RARRAY_PTR(inf)[0]))) : + RARRAY_PTR(inf)[0]), RARRAY_PTR(inf)[1]); } - rb_const_set(self, ID_SUBST_INFO, - Data_Wrap_Struct(cSUBST_INFO, subst_mark, + rb_const_set(self, ID_SUBST_INFO, + Data_Wrap_Struct(cSUBST_INFO, subst_mark, subst_free, subst_inf)); return self; @@ -1645,7 +1645,7 @@ cbsubst_scan_args(self, arg_key, val_ary) old_gc = rb_gc_disable(); - Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), + Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), struct cbsubst_info, inf); for(idx = 0; idx < vallen; idx++) { @@ -1664,7 +1664,7 @@ cbsubst_scan_args(self, arg_key, val_ary) if (NIL_P(proc)) { rb_ary_push(dst, RARRAY_PTR(val_ary)[idx]); } else { - rb_ary_push(dst, rb_funcall(proc, ID_call, 1, + rb_ary_push(dst, rb_funcall(proc, ID_call, 1, RARRAY_PTR(val_ary)[idx])); } } @@ -1720,7 +1720,7 @@ Init_tkutil() /* --------------------- */ - rb_define_const(mTK, "RELEASE_DATE", + rb_define_const(mTK, "RELEASE_DATE", rb_obj_freeze(rb_str_new2(tkutil_release_date))); /* --------------------- */ @@ -1750,19 +1750,19 @@ Init_tkutil() ID_SUBST_INFO = rb_intern("SUBST_INFO"); rb_define_singleton_method(cCB_SUBST, "ret_val", cbsubst_ret_val, 1); rb_define_singleton_method(cCB_SUBST, "scan_args", cbsubst_scan_args, 2); - rb_define_singleton_method(cCB_SUBST, "_sym2subst", + rb_define_singleton_method(cCB_SUBST, "_sym2subst", cbsubst_sym_to_subst, 1); - rb_define_singleton_method(cCB_SUBST, "subst_arg", + rb_define_singleton_method(cCB_SUBST, "subst_arg", cbsubst_get_subst_arg, -1); - rb_define_singleton_method(cCB_SUBST, "_get_subst_key", + rb_define_singleton_method(cCB_SUBST, "_get_subst_key", cbsubst_get_subst_key, 1); - rb_define_singleton_method(cCB_SUBST, "_get_all_subst_keys", + rb_define_singleton_method(cCB_SUBST, "_get_all_subst_keys", cbsubst_get_all_subst_keys, 0); - rb_define_singleton_method(cCB_SUBST, "_setup_subst_table", + rb_define_singleton_method(cCB_SUBST, "_setup_subst_table", cbsubst_table_setup, -1); - rb_define_singleton_method(cCB_SUBST, "_get_extra_args_tbl", + rb_define_singleton_method(cCB_SUBST, "_get_extra_args_tbl", cbsubst_get_extra_args_tbl, 0); - rb_define_singleton_method(cCB_SUBST, "_define_attribute_aliases", + rb_define_singleton_method(cCB_SUBST, "_define_attribute_aliases", cbsubst_def_attr_aliases, 1); rb_define_method(cCB_SUBST, "initialize", cbsubst_initialize, -1); @@ -1811,9 +1811,9 @@ Init_tkutil() rb_define_singleton_method(mTK, "uninstall_cmd", tk_uninstall_cmd, 1); rb_define_singleton_method(mTK, "_symbolkey2str", tk_symbolkey2str, 1); rb_define_singleton_method(mTK, "hash_kv", tk_hash_kv, -1); - rb_define_singleton_method(mTK, "_get_eval_string", + rb_define_singleton_method(mTK, "_get_eval_string", tk_get_eval_string, -1); - rb_define_singleton_method(mTK, "_get_eval_enc_str", + rb_define_singleton_method(mTK, "_get_eval_enc_str", tk_get_eval_enc_str, 1); rb_define_singleton_method(mTK, "_conv_args", tk_conv_args, -1); diff --git a/ext/win32ole/depend b/ext/win32ole/depend index 4bf5ab5b941465..3b1d7e9a9717b7 100644 --- a/ext/win32ole/depend +++ b/ext/win32ole/depend @@ -1 +1 @@ -win32ole.o : win32ole.c $(hdrdir)/ruby.h $(hdrdir)/config.h $(hdrdir)/defines.h +win32ole.o : win32ole.c $(hdrdir)/ruby.h $(hdrdir)/config.h $(hdrdir)/defines.h diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 080d3aa2d2adc7..980c874800586b 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -85,7 +85,7 @@ #endif /* - * unfortunately IID_IMultiLanguage2 is not included in any libXXX.a + * unfortunately IID_IMultiLanguage2 is not included in any libXXX.a * in Cygwin(mingw32). */ #if defined(__CYGWIN__) || defined(__MINGW32__) @@ -567,7 +567,7 @@ static VALUE folevariant_vartype(VALUE self); static VALUE folevariant_set_value(VALUE self, VALUE val); static void init_enc2cp(); static void free_enc2cp(); - + static HRESULT (STDMETHODCALLTYPE mf_QueryInterface)( IMessageFilter __RPC_FAR * This, /* [in] */ REFIID riid, @@ -582,13 +582,13 @@ static HRESULT (STDMETHODCALLTYPE mf_QueryInterface)( return E_NOINTERFACE; } -static ULONG (STDMETHODCALLTYPE mf_AddRef)( +static ULONG (STDMETHODCALLTYPE mf_AddRef)( IMessageFilter __RPC_FAR * This) { return 1; } - -static ULONG (STDMETHODCALLTYPE mf_Release)( + +static ULONG (STDMETHODCALLTYPE mf_Release)( IMessageFilter __RPC_FAR * This) { return 1; @@ -662,7 +662,7 @@ static DWORD (STDMETHODCALLTYPE mf_MessagePending)( } return PENDINGMSG_WAITNOPROCESS; } - + typedef struct _Win32OLEIDispatch { IDispatch dispatch; @@ -670,7 +670,7 @@ typedef struct _Win32OLEIDispatch VALUE obj; } Win32OLEIDispatch; -static HRESULT ( STDMETHODCALLTYPE QueryInterface )( +static HRESULT ( STDMETHODCALLTYPE QueryInterface )( IDispatch __RPC_FAR * This, /* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) @@ -685,15 +685,15 @@ static HRESULT ( STDMETHODCALLTYPE QueryInterface )( } return E_NOINTERFACE; } - -static ULONG ( STDMETHODCALLTYPE AddRef )( + +static ULONG ( STDMETHODCALLTYPE AddRef )( IDispatch __RPC_FAR * This) { Win32OLEIDispatch* p = (Win32OLEIDispatch*)This; return ++(p->refcount); } - -static ULONG ( STDMETHODCALLTYPE Release )( + +static ULONG ( STDMETHODCALLTYPE Release )( IDispatch __RPC_FAR * This) { Win32OLEIDispatch* p = (Win32OLEIDispatch*)This; @@ -705,15 +705,15 @@ static ULONG ( STDMETHODCALLTYPE Release )( } return u; } - -static HRESULT ( STDMETHODCALLTYPE GetTypeInfoCount )( + +static HRESULT ( STDMETHODCALLTYPE GetTypeInfoCount )( IDispatch __RPC_FAR * This, /* [out] */ UINT __RPC_FAR *pctinfo) { return E_NOTIMPL; } - -static HRESULT ( STDMETHODCALLTYPE GetTypeInfo )( + +static HRESULT ( STDMETHODCALLTYPE GetTypeInfo )( IDispatch __RPC_FAR * This, /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, @@ -722,8 +722,8 @@ static HRESULT ( STDMETHODCALLTYPE GetTypeInfo )( return E_NOTIMPL; } - -static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )( + +static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )( IDispatch __RPC_FAR * This, /* [in] */ REFIID riid, /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, @@ -739,8 +739,8 @@ static HRESULT ( STDMETHODCALLTYPE GetIDsOfNames )( free(psz); return S_OK; } - -static /* [local] */ HRESULT ( STDMETHODCALLTYPE Invoke )( + +static /* [local] */ HRESULT ( STDMETHODCALLTYPE Invoke )( IDispatch __RPC_FAR * This, /* [in] */ DISPID dispIdMember, /* [in] */ REFIID riid, @@ -834,7 +834,7 @@ vtdate2rbtime(double date) static UINT ole_encoding2cp(rb_encoding *enc) { /* - * Is there any better solution to convert + * Is there any better solution to convert * Ruby encoding to Windows codepage??? */ ENC_MACHING_CP(enc, "Big5", 950); @@ -843,7 +843,7 @@ static UINT ole_encoding2cp(rb_encoding *enc) ENC_MACHING_CP(enc, "CP852", 852); ENC_MACHING_CP(enc, "CP855", 855); ENC_MACHING_CP(enc, "CP949", 949); - ENC_MACHING_CP(enc, "EUC-JP", 20932); + ENC_MACHING_CP(enc, "EUC-JP", 20932); ENC_MACHING_CP(enc, "EUC-KR", 51949); ENC_MACHING_CP(enc, "EUC-TW", 51950); ENC_MACHING_CP(enc, "GB18030", 54936); @@ -1018,7 +1018,7 @@ ole_cp2encoding(UINT cp) case CP_UTF7: case CP_UTF8: break; - case 51932: + case 51932: load_conv_function51932(); break; default: @@ -1059,7 +1059,7 @@ ole_wc2mb(LPWSTR pw) } size = WideCharToMultiByte(cWIN32OLE_cp, 0, pw, -1, NULL, 0, NULL, NULL); if (size) { - pm = ALLOC_N(char, size + 1); + pm = ALLOC_N(char, size + 1); WideCharToMultiByte(cWIN32OLE_cp, 0, pw, -1, pm, size, NULL, NULL); pm[size] = '\0'; } @@ -1068,7 +1068,7 @@ ole_wc2mb(LPWSTR pw) *pm = '\0'; } return pm; -} +} static VALUE ole_hresult2msg(HRESULT hr) @@ -1180,10 +1180,10 @@ ole_uninitialize() } static void -ole_initialize() +ole_initialize() { HRESULT hr; - + if(g_ole_initialized == FALSE) { hr = OleInitialize(NULL); if(FAILED(hr)) { @@ -1434,7 +1434,7 @@ get_ptr_of_variant(VARIANT *pvar) } static VALUE -is_all_index_under(long *pid, long *pub, long dim) +is_all_index_under(long *pid, long *pub, long dim) { long i = 0; for (i = 0; i < dim; i++) { @@ -1496,7 +1496,7 @@ dimension(VALUE val) { return dim; } -static long +static long ary_len_of_dim(VALUE ary, long dim) { long ary_len = 0; long ary_len1 = 0; @@ -1865,7 +1865,7 @@ ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar) hr = VariantCopy(&(pvar->var), &(pvar->realvar)); } } else { - if (psa) + if (psa) SafeArrayDestroy(psa); } } else if (vt & VT_ARRAY) { @@ -1911,7 +1911,7 @@ ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar) ole_set_byref(&(pvar->realvar), &(pvar->var), vt); } else if (vt & VT_BYREF) { if ( (vt & ~VT_BYREF) != V_VT(&(pvar->realvar))) { - hr = VariantChangeTypeEx(&(pvar->realvar), &(pvar->realvar), + hr = VariantChangeTypeEx(&(pvar->realvar), &(pvar->realvar), cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF)); } if (SUCCEEDED(hr)) { @@ -1921,7 +1921,7 @@ ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar) if (vt == V_VT(&(pvar->realvar))) { hr = VariantCopy(&(pvar->var), &(pvar->realvar)); } else { - hr = VariantChangeTypeEx(&(pvar->var), &(pvar->realvar), + hr = VariantChangeTypeEx(&(pvar->var), &(pvar->realvar), cWIN32OLE_lcid, 0, vt); } } @@ -1941,7 +1941,7 @@ ole_val2variant2(VALUE val, VARIANT *var) } static VALUE -make_inspect(const char *class_name, VALUE detail) +make_inspect(const char *class_name, VALUE detail) { VALUE str; str = rb_str_new2("#<"); @@ -1953,7 +1953,7 @@ make_inspect(const char *class_name, VALUE detail) } static VALUE -default_inspect(VALUE self, const char *class_name) +default_inspect(VALUE self, const char *class_name) { VALUE detail = rb_funcall(self, rb_intern("to_s"), 0); return make_inspect(class_name, detail); @@ -2093,58 +2093,58 @@ ole_variant2val(VARIANT *pvar) case VT_NULL: break; case VT_I1: - if(V_ISBYREF(pvar)) + if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_I1REF(pvar)); - else + else obj = INT2NUM((long)V_I1(pvar)); break; case VT_UI1: - if(V_ISBYREF(pvar)) + if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_UI1REF(pvar)); - else + else obj = INT2NUM((long)V_UI1(pvar)); break; case VT_I2: if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_I2REF(pvar)); - else + else obj = INT2NUM((long)V_I2(pvar)); break; case VT_UI2: if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_UI2REF(pvar)); - else + else obj = INT2NUM((long)V_UI2(pvar)); break; case VT_I4: if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_I4REF(pvar)); - else + else obj = INT2NUM((long)V_I4(pvar)); break; case VT_UI4: if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_UI4REF(pvar)); - else + else obj = INT2NUM((long)V_UI4(pvar)); break; case VT_INT: if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_INTREF(pvar)); - else + else obj = INT2NUM((long)V_INT(pvar)); break; case VT_UINT: if(V_ISBYREF(pvar)) obj = INT2NUM((long)*V_UINTREF(pvar)); - else + else obj = INT2NUM((long)V_UINT(pvar)); break; @@ -2153,7 +2153,7 @@ ole_variant2val(VARIANT *pvar) if(V_ISBYREF(pvar)) #if (_MSC_VER >= 1300) obj = I8_2_NUM(*V_I8REF(pvar)); -#else +#else obj = Qnil; #endif else @@ -2264,7 +2264,7 @@ ole_variant2val(VARIANT *pvar) HRESULT hr; VARIANT variant; VariantInit(&variant); - hr = VariantChangeTypeEx(&variant, pvar, + hr = VariantChangeTypeEx(&variant, pvar, cWIN32OLE_lcid, 0, VT_BSTR); if (SUCCEEDED(hr) && V_VT(&variant) == VT_BSTR) { obj = ole_wc2vstr(V_BSTR(&variant), FALSE); @@ -2310,7 +2310,7 @@ reg_get_val(HKEY hkey, const char *subkey) DWORD dwtype = 0; LONG size = 0; VALUE val = Qnil; - LONG err = RegQueryValueEx(hkey, subkey, NULL, &dwtype, NULL, &size); + LONG err = RegQueryValueEx(hkey, subkey, NULL, &dwtype, NULL, &size); if (err == ERROR_SUCCESS) { pbuf = ALLOC_N(char, size + 1); @@ -2424,7 +2424,7 @@ typelib_file_from_typelib(VALUE ole) break; err = reg_open_vkey(hversion, lang, &hlang); if (err == ERROR_SUCCESS) { - if ((file = reg_get_typelib_file_path(hlang)) != Qnil) + if ((file = reg_get_typelib_file_path(hlang)) != Qnil) found = TRUE; RegCloseKey(hlang); } @@ -2580,17 +2580,17 @@ ole_create_dcom(int argc, VALUE *argv, VALUE self) hr = CLSIDFromString(pbuf, &clsid); SysFreeString(pbuf); if (FAILED(hr)) - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "unknown OLE server: `%s'", StringValuePtr(ole)); - memset(&serverinfo, 0, sizeof(COSERVERINFO)); + memset(&serverinfo, 0, sizeof(COSERVERINFO)); serverinfo.pwszName = ole_vstr2wc(host); memset(&multi_qi, 0, sizeof(MULTI_QI)); multi_qi.pIID = &IID_IDispatch; hr = gCoCreateInstanceEx(&clsid, NULL, clsctx, &serverinfo, 1, &multi_qi); SysFreeString(serverinfo.pwszName); if (FAILED(hr)) - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "failed to create DCOM server `%s' in `%s'", StringValuePtr(ole), StringValuePtr(host)); @@ -2609,12 +2609,12 @@ ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self) HRESULT hr; OLECHAR *pbuf; ULONG eaten = 0; - + ole_initialize(); hr = CreateBindCtx(0, &pBindCtx); if(FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "failed to create bind context"); } @@ -2627,7 +2627,7 @@ ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self) "failed to parse display name of moniker `%s'", StringValuePtr(moniker)); } - hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, + hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, &p); pDispatch = p; OLE_RELEASE(pMoniker); @@ -2644,10 +2644,10 @@ ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self) /* * call-seq: * WIN32OLE.connect( ole ) --> aWIN32OLE - * + * * Returns running OLE Automation object or WIN32OLE object from moniker. * 1st argument should be OLE program id or class id or moniker. - * + * * WIN32OLE.connect('Excel.Application') # => WIN32OLE object which represents running Excel. */ static VALUE @@ -2669,7 +2669,7 @@ fole_s_connect(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "1*", &svr_name, &others); SafeStringValue(svr_name); if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) { - rb_raise(rb_eSecurityError, "Insecure Object Connection - %s", + rb_raise(rb_eSecurityError, "Insecure Object Connection - %s", StringValuePtr(svr_name)); } @@ -2686,15 +2686,15 @@ fole_s_connect(int argc, VALUE *argv, VALUE self) hr = GetActiveObject(&clsid, 0, &pUnknown); if (FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "OLE server `%s' not running", StringValuePtr(svr_name)); } hr = pUnknown->lpVtbl->QueryInterface(pUnknown, &IID_IDispatch, &p); pDispatch = p; if(FAILED(hr)) { OLE_RELEASE(pUnknown); - ole_raise(hr, eWIN32OLERuntimeError, - "failed to create WIN32OLE server `%s'", + ole_raise(hr, eWIN32OLERuntimeError, + "failed to create WIN32OLE server `%s'", StringValuePtr(svr_name)); } @@ -2703,16 +2703,16 @@ fole_s_connect(int argc, VALUE *argv, VALUE self) return create_win32ole_object(self, pDispatch, argc, argv); } -/* +/* * call-seq: * WIN32OLE.const_load( ole, mod = WIN32OLE) - * + * * Defines the constants of OLE Automation server as mod's constants. * The first argument is WIN32OLE object or type library name. * If 2nd argument is omitted, the default is WIN32OLE. * The first letter of Ruby's constant variable name is upper case, * so constant variable name of WIN32OLE object is capitalized. - * For example, the 'xlTop' constant of Excel is changed to 'XlTop' + * For example, the 'xlTop' constant of Excel is changed to 'XlTop' * in WIN32OLE. * If the first letter of constant variabl is not [A-Z], then * the constant is defined as CONSTANTS hash element. @@ -2723,7 +2723,7 @@ fole_s_connect(int argc, VALUE *argv, VALUE self) * WIN32OLE.const_load(excel, EXCEL_CONST) * puts EXCEL_CONST::XlTop # => -4160 * puts EXCEL_CONST::CONSTANTS['_xlDialogChartSourceData'] # => 541 - * + * * WIN32OLE.const_load(excel) * puts WIN32OLE::XlTop # => -4160 * @@ -2745,7 +2745,7 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self) OLECHAR *pBuf; VALUE file; LCID lcid = cWIN32OLE_lcid; - + rb_secure(4); rb_scan_args(argc, argv, "11", &ole, &klass); if (TYPE(klass) != T_CLASS && @@ -2801,20 +2801,20 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self) static VALUE ole_types_from_typelib(ITypeLib *pTypeLib, VALUE classes) { - + long count; int i; HRESULT hr; BSTR bstr; ITypeInfo *pTypeInfo; VALUE type; - + rb_secure(4); count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib); for (i = 0; i < count; i++) { hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i, &bstr, NULL, NULL, NULL); - if (FAILED(hr)) + if (FAILED(hr)) continue; hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo); @@ -2844,8 +2844,8 @@ reference_count(struct oledata * pole) /* * call-seq: * WIN32OLE.ole_reference_count(aWIN32OLE) --> number - * - * Returns reference counter of Dispatch interface of WIN32OLE object. + * + * Returns reference counter of Dispatch interface of WIN32OLE object. * You should not use this method because this method * exists only for debugging WIN32OLE. */ @@ -2860,8 +2860,8 @@ fole_s_reference_count(VALUE self, VALUE obj) /* * call-seq: * WIN32OLE.ole_free(aWIN32OLE) --> number - * - * Invokes Release method of Dispatch interface of WIN32OLE object. + * + * Invokes Release method of Dispatch interface of WIN32OLE object. * You should not use this method because this method * exists only for debugging WIN32OLE. * The return value is reference counter of OLE object. @@ -2893,10 +2893,10 @@ ole_show_help(VALUE helpfile, VALUE helpcontext) pfnHtmlHelp = (FNHTMLHELP*)GetProcAddress(ghhctrl, "HtmlHelpA"); if (!pfnHtmlHelp) return hwnd; - hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile), + hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile), 0x0f, NUM2INT(helpcontext)); if (hwnd == 0) - hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile), + hwnd = pfnHtmlHelp(GetDesktopWindow(), StringValuePtr(helpfile), 0, NUM2INT(helpcontext)); return hwnd; } @@ -2904,7 +2904,7 @@ ole_show_help(VALUE helpfile, VALUE helpcontext) /* * call-seq: * WIN32OLE.ole_show_help(obj [,helpcontext]) - * + * * Displays helpfile. The 1st argument specifies WIN32OLE_TYPE * object or WIN32OLE_METHOD object or helpfile. * @@ -2944,10 +2944,10 @@ fole_s_show_help(int argc, VALUE *argv, VALUE self) return Qnil; } -/* +/* * call-seq: * WIN32OLE.codepage - * + * * Returns current codepage. * WIN32OLE.codepage # => WIN32OLE::CP_ACP */ @@ -2957,7 +2957,7 @@ fole_s_get_code_page(VALUE self) return INT2FIX(cWIN32OLE_cp); } -static BOOL CALLBACK +static BOOL CALLBACK installed_code_page_proc(LPTSTR str) { if (strtoul(str, NULL, 10) == g_cp_to_check) { g_cp_installed = TRUE; @@ -2966,7 +2966,7 @@ installed_code_page_proc(LPTSTR str) { return TRUE; } -static BOOL +static BOOL code_page_installed(UINT cp) { g_cp_installed = FALSE; @@ -2975,12 +2975,12 @@ code_page_installed(UINT cp) return g_cp_installed; } -/* +/* * call-seq: * WIN32OLE.codepage = CP - * - * Sets current codepage. - * The WIN32OLE.codepage is initialized according to + * + * Sets current codepage. + * The WIN32OLE.codepage is initialized according to * Encoding.default_internal. * If Encoding.default_internal is nil then WIN32OLE.codepage * is initialized according to Encoding.default_external. @@ -3008,7 +3008,7 @@ fole_s_set_code_page(VALUE self, VALUE vcp) * * lcid = WIN32OLE.locale */ -static VALUE +static VALUE fole_s_get_locale(VALUE self) { return INT2FIX(cWIN32OLE_lcid); @@ -3043,7 +3043,7 @@ lcid_installed(LCID lcid) * obj = WIN32OLE_VARIANT.new("$100,000", WIN32OLE::VARIANT::VT_CY) * */ -static VALUE +static VALUE fole_s_set_locale(VALUE self, VALUE vlcid) { LCID lcid = FIX2INT(vlcid); @@ -3062,12 +3062,12 @@ fole_s_set_locale(VALUE self, VALUE vlcid) return Qnil; } -/* +/* * call-seq: * WIN32OLE.create_guid - * + * * Creates GUID. - * WIN32OLE.create_guid # => {1CB530F1-F6B1-404D-BCE6-1959BF91F4A8} + * WIN32OLE.create_guid # => {1CB530F1-F6B1-404D-BCE6-1959BF91F4A8} */ static VALUE fole_s_create_guid(VALUE self) @@ -3093,11 +3093,11 @@ fole_s_create_guid(VALUE self) * WIN32OLE objects represent OLE Automation object in Ruby. * * By using WIN32OLE, you can access OLE server like VBScript. - * + * * Here is sample script. * * require 'win32ole' - * + * * excel = WIN32OLE.new('Excel.Application') * excel.visible = true * workbook = excel.Workbooks.Add(); @@ -3106,17 +3106,17 @@ fole_s_create_guid(VALUE self) * worksheet.Range("A2:B2").value = [5.2, 10]; * worksheet.Range("C2").value = 8; * worksheet.Range("D2").value = 20; - * + * * range = worksheet.Range("A1:D2"); * range.select * chart = workbook.Charts.Add; - * + * * workbook.saved = true; - * + * * excel.ActiveWorkbook.Close(0); * excel.Quit(); * - * Unfortunately, Win32OLE doesn't support the argument passed by + * Unfortunately, Win32OLE doesn't support the argument passed by * reference directly. * Instead, Win32OLE provides WIN32OLE::ARGV. * If you want to get the result value of argument passed by reference, @@ -3124,18 +3124,18 @@ fole_s_create_guid(VALUE self) * * oleobj.method(arg1, arg2, refargv3) * puts WIN32OLE::ARGV[2] # the value of refargv3 after called oleobj.method - * + * */ /* * call-seq: * WIN32OLE.new(server, [host]) -> WIN32OLE object - * + * * Returns a new WIN32OLE object(OLE Automation object). * The first argument server specifies OLE Automation server. * The first argument should be CLSID or PROGID. - * If second argument host specified, then returns OLE Automation - * object on host. + * If second argument host specified, then returns OLE Automation + * object on host. * * WIN32OLE.new('Excel.Application') # => Excel OLE Automation WIN32OLE object. * WIN32OLE.new('{00024500-0000-0000-C000-000000000046}') # => Excel OLE Automation WIN32OLE object. @@ -3177,7 +3177,7 @@ fole_initialize(int argc, VALUE *argv, VALUE self) } SysFreeString(pBuf); if(FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "unknown OLE server: `%s'", StringValuePtr(svr_name)); } @@ -3303,7 +3303,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) &wcmdname, 1, lcid, &DispID); SysFreeString(wcmdname); if(FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "unknown property or method: `%s'", StringValuePtr(cmd)); } @@ -3316,8 +3316,8 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) /* if last arg is hash object */ if(TYPE(param) == T_HASH) { - /*------------------------------------------ - hash object ==> named dispatch parameters + /*------------------------------------------ + hash object ==> named dispatch parameters --------------------------------------------*/ cNamedArgs = NUM2INT(rb_funcall(param, rb_intern("length"), 0)); op.dp.cArgs = cNamedArgs + argc - 2; @@ -3341,7 +3341,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) for(i = 0; i < op.dp.cArgs; i++ ) { VariantClear(&op.dp.rgvarg[i]); } - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "failed to get named argument info: `%s'", StringValuePtr(cmd)); } @@ -3356,7 +3356,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) } } /*-------------------------------------- - non hash args ==> dispatch parameters + non hash args ==> dispatch parameters ----------------------------------------*/ if(op.dp.cArgs > cNamedArgs) { realargs = ALLOCA_N(VARIANTARG, op.dp.cArgs-cNamedArgs+1); @@ -3384,9 +3384,9 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) op.dp.rgdispidNamedArgs = ALLOCA_N( DISPID, 1 ); op.dp.rgdispidNamedArgs[0] = DISPID_PROPERTYPUT; } - - hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, - &IID_NULL, lcid, wFlags, &op.dp, + + hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, + &IID_NULL, lcid, wFlags, &op.dp, &result, &excepinfo, &argErr); if (FAILED(hr)) { @@ -3402,7 +3402,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) } memset(&excepinfo, 0, sizeof(EXCEPINFO)); VariantInit(&result); - hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, + hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, &IID_NULL, lcid, wFlags, &op.dp, &result, &excepinfo, &argErr); @@ -3416,7 +3416,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) ole_freeexceptinfo(&excepinfo); } memset(&excepinfo, 0, sizeof(EXCEPINFO)); - hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, + hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, &IID_NULL, lcid, wFlags, &op.dp, NULL, &excepinfo, &argErr); @@ -3441,7 +3441,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) } memset(&excepinfo, 0, sizeof(EXCEPINFO)); VariantInit(&result); - hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, + hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID, &IID_NULL, lcid, wFlags, &op.dp, &result, &excepinfo, &argErr); @@ -3485,7 +3485,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) * call-seq: * WIN32OLE#invoke(method, [arg1,...]) => return value of method. * - * Runs OLE method. + * Runs OLE method. * The first argument specifies the method name of OLE Automation object. * The others specify argument of the method. * If you can not execute method directly, then use this method instead. @@ -3518,7 +3518,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind) Check_Type(args, T_ARRAY); Check_Type(types, T_ARRAY); - + memset(&excepinfo, 0, sizeof(EXCEPINFO)); memset(&dispParams, 0, sizeof(DISPPARAMS)); VariantInit(&result); @@ -3693,9 +3693,9 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind) /* * call-seq: * WIN32OLE#_invoke(dispid, args, types) - * + * * Runs the early binding method. - * The 1st argument specifies dispatch ID, + * The 1st argument specifies dispatch ID, * the 2nd argument specifies the array of arguments, * the 3rd argument specifies the array of the type of arguments. * @@ -3711,9 +3711,9 @@ fole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types) /* * call-seq: * WIN32OLE#_getproperty(dispid, args, types) - * + * * Runs the early binding method to get property. - * The 1st argument specifies dispatch ID, + * The 1st argument specifies dispatch ID, * the 2nd argument specifies the array of arguments, * the 3rd argument specifies the array of the type of arguments. * @@ -3729,9 +3729,9 @@ fole_getproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types) /* * call-seq: * WIN32OLE#_setproperty(dispid, args, types) - * + * * Runs the early binding method to set property. - * The 1st argument specifies dispatch ID, + * The 1st argument specifies dispatch ID, * the 2nd argument specifies the array of arguments, * the 3rd argument specifies the array of the type of arguments. * @@ -3746,13 +3746,13 @@ fole_setproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types) /* * call-seq: - * WIN32OLE[a1, a2, ...]=val - * + * WIN32OLE[a1, a2, ...]=val + * * Sets the value to WIN32OLE object specified by a1, a2, ... - * + * * dict = WIN32OLE.new('Scripting.Dictionary') * dict.add('ruby', 'RUBY') - * dict['ruby'] = 'Ruby' + * dict['ruby'] = 'Ruby' * puts dict['ruby'] # => 'Ruby' * * Remark: You can not use this method to set the property value. @@ -3771,7 +3771,7 @@ fole_setproperty_with_bracket(int argc, VALUE *argv, VALUE self) /* * call-seq: * WIN32OLE.setproperty('property', [arg1, arg2,...] val) - * + * * Sets property of OLE object. * When you want to set property with argument, you can use this method. * @@ -3789,14 +3789,14 @@ fole_setproperty(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE[a1,a2,...] - * + * WIN32OLE[a1,a2,...] + * * Returns the value of Collection specified by a1, a2,.... * * dict = WIN32OLE.new('Scripting.Dictionary') * dict.add('ruby', 'Ruby') * puts dict['ruby'] # => 'Ruby' (same as `puts dict.item('ruby')') - * + * * Remark: You can not use this method to get the property. * excel = WIN32OLE.new('Excel.Application') * # puts excel['Visible'] This is error !!! @@ -3844,13 +3844,13 @@ ole_propertyput(VALUE self, VALUE property, VALUE value) pBuf[0] = NULL; if(FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "unknown property or method: `%s'", StringValuePtr(property)); } /* set property value */ ole_val2variant(value, &propertyValue[0]); - hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, dispID, &IID_NULL, + hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, dispID, &IID_NULL, lcid, wFlags, &dispParams, NULL, &excepinfo, &argErr); @@ -3913,7 +3913,7 @@ ole_ienum_free(VALUE pEnumV) /* * call-seq: * WIN32OLE#each {|i|...} - * + * * Iterates over each item of OLE collection which has IEnumVARIANT interface. * * excel = WIN32OLE.new('Excel.Application') @@ -3947,7 +3947,7 @@ fole_each(VALUE self) dispParams.cNamedArgs = 0; dispParams.cArgs = 0; memset(&excepinfo, 0, sizeof(excepinfo)); - + OLEData_Get_Struct(self, pole); hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DISPID_NEWENUM, &IID_NULL, lcid, @@ -3984,7 +3984,7 @@ fole_each(VALUE self) /* * call-seq: * WIN32OLE#method_missing(id [,arg1, arg2, ...]) - * + * * Calls WIN32OLE#invoke method. */ static VALUE @@ -4097,7 +4097,7 @@ ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc); if (FAILED(hr)) continue; - + hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo, pFuncDesc->memid, &bstr, NULL, NULL, NULL); if (FAILED(hr)) { @@ -4106,7 +4106,7 @@ ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods, } if(pFuncDesc->invkind & mask) { method = folemethod_s_allocate(cWIN32OLE_METHOD); - olemethod_set_member(method, pTypeInfo, pOwnerTypeInfo, + olemethod_set_member(method, pTypeInfo, pOwnerTypeInfo, i, WC2VSTR(bstr)); rb_ary_push(methods, method); } @@ -4210,13 +4210,13 @@ ole_methods(VALUE self, int mask) /* * call-seq: * WIN32OLE#ole_methods - * - * Returns the array of WIN32OLE_METHOD object. + * + * Returns the array of WIN32OLE_METHOD object. * The element is OLE method of WIN32OLE object. * * excel = WIN32OLE.new('Excel.Application') * methods = excel.ole_methods - * + * */ static VALUE fole_methods(VALUE self) @@ -4227,7 +4227,7 @@ fole_methods(VALUE self) /* * call-seq: * WIN32OLE#ole_get_methods - * + * * Returns the array of WIN32OLE_METHOD object . * The element of the array is property (gettable) of WIN32OLE object. * @@ -4243,7 +4243,7 @@ fole_get_methods(VALUE self) /* * call-seq: * WIN32OLE#ole_put_methods - * + * * Returns the array of WIN32OLE_METHOD object . * The element of the array is property (settable) of WIN32OLE object. * @@ -4259,7 +4259,7 @@ fole_put_methods(VALUE self) /* * call-seq: * WIN32OLE#ole_func_methods - * + * * Returns the array of WIN32OLE_METHOD object . * The element of the array is property (settable) of WIN32OLE object. * @@ -4300,7 +4300,7 @@ ole_type_from_itypeinfo(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE#ole_type - * + * * Returns WIN32OLE_TYPE object. * * excel = WIN32OLE.new('Excel.Application') @@ -4348,7 +4348,7 @@ ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE#ole_typelib -> The WIN32OLE_TYPELIB object + * WIN32OLE#ole_typelib -> The WIN32OLE_TYPELIB object * * Returns the WIN32OLE_TYPELIB object. The object represents the * type library which contains the WIN32OLE object. @@ -4383,12 +4383,12 @@ fole_typelib(VALUE self) /* * call-seq: * WIN32OLE#ole_query_interface(iid) -> WIN32OLE object - * + * * Returns WIN32OLE object for a specific dispatch or dual * interface specified by iid. * * ie = WIN32OLE.new('InternetExplorer.Application') - * ie_web_app = ie.ole_query_interface('{0002DF05-0000-0000-C000-000000000046}') # => WIN32OLE object for dispinterface IWebBrowserApp + * ie_web_app = ie.ole_query_interface('{0002DF05-0000-0000-C000-000000000046}') # => WIN32OLE object for dispinterface IWebBrowserApp */ static VALUE fole_query_interface(VALUE self, VALUE str_iid) @@ -4399,12 +4399,12 @@ fole_query_interface(VALUE self, VALUE str_iid) struct oledata *pole; IDispatch *pDispatch; void *p; - + pBuf = ole_vstr2wc(str_iid); hr = CLSIDFromString(pBuf, &iid); SysFreeString(pBuf); if(FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "invalid iid: `%s'", StringValuePtr(str_iid)); } @@ -4417,8 +4417,8 @@ fole_query_interface(VALUE self, VALUE str_iid) hr = pole->pDispatch->lpVtbl->QueryInterface(pole->pDispatch, &iid, &p); if(FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, - "failed to get interface `%s'", + ole_raise(hr, eWIN32OLERuntimeError, + "failed to get interface `%s'", StringValuePtr(str_iid)); } @@ -4429,7 +4429,7 @@ fole_query_interface(VALUE self, VALUE str_iid) /* * call-seq: * WIN32OLE#ole_respond_to?(method) -> true or false - * + * * Returns true when OLE object has OLE method, otherwise returns false. * * ie = WIN32OLE.new('InternetExplorer.Application') @@ -4468,9 +4468,9 @@ ole_docinfo_from_type(ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *he if (FAILED(hr)) { return hr; } - + hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i, - name, helpstr, + name, helpstr, helpcontext, helpfile); if (FAILED(hr)) { OLE_RELEASE(pTypeLib); @@ -4488,7 +4488,7 @@ ole_usertype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) ITypeInfo *pRefTypeInfo; VALUE type = Qnil; - hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, + hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, V_UNION1(pTypeDesc, hreftype), &pRefTypeInfo); if(FAILED(hr)) @@ -4507,7 +4507,7 @@ ole_usertype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) static VALUE ole_ptrtype2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) -{ +{ TYPEDESC *p = pTypeDesc; VALUE type = rb_str_new2(""); @@ -4601,7 +4601,7 @@ ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) break; case VT_USERDEFINED: typestr = rb_str_new2("USERDEFINED"); - if (typedetails != Qnil) + if (typedetails != Qnil) rb_ary_push(typedetails, typestr); str = ole_usertype2val(pTypeInfo, pTypeDesc, typedetails); if (str != Qnil) { @@ -4636,8 +4636,8 @@ ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) /* * call-seq: * WIN32OLE#ole_method_help(method) - * - * Returns WIN32OLE_METHOD object corresponding with method + * + * Returns WIN32OLE_METHOD object corresponding with method * specified by 1st argument. * * excel = WIN32OLE.new('Excel.Application') @@ -4670,11 +4670,11 @@ fole_method_help(VALUE self, VALUE cmdname) * call-seq: * WIN32OLE#ole_activex_initialize() -> Qnil * - * Initialize WIN32OLE object(ActiveX Control) by calling + * Initialize WIN32OLE object(ActiveX Control) by calling * IPersistMemory::InitNew. * - * Before calling OLE method, some kind of the ActiveX controls - * created with MFC should be initialized by calling + * Before calling OLE method, some kind of the ActiveX controls + * created with MFC should be initialized by calling * IPersistXXX::InitNew. * * If and only if you received the exception "HRESULT error code: @@ -4684,10 +4684,10 @@ fole_method_help(VALUE self, VALUE cmdname) * obj = WIN32OLE.new("ProgID_or_GUID_of_ActiveX_Control") * obj.ole_activex_initialize * obj.method(...) - * - */ + * + */ static VALUE -fole_activex_initialize(VALUE self) +fole_activex_initialize(VALUE self) { struct oledata *pole; IPersistMemory *pPersistMemory; @@ -4717,7 +4717,7 @@ fole_activex_initialize(VALUE self) /* * call-seq: * WIN32OLE_TYPE.ole_classes(typelib) - * + * * Returns array of WIN32OLE_TYPE objects defined by the typelib type library. * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.new(typelib).ole_classes instead. */ @@ -4738,7 +4738,7 @@ foletype_s_ole_classes(VALUE self, VALUE typelib) /* * call-seq: * WIN32OLE_TYPE.typelibs - * + * * Returns array of type libraries. * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.typelibs.collect{|t| t.name} instead. * @@ -4757,7 +4757,7 @@ foletype_s_typelibs(VALUE self) /* * call-seq: * WIN32OLE_TYPE.progids - * + * * Returns array of ProgID. */ static VALUE @@ -4781,7 +4781,7 @@ foletype_s_progids(VALUE self) err = reg_open_vkey(hclsids, clsid, &hclsid); if (err != ERROR_SUCCESS) continue; - if ((v = reg_get_val2(hclsid, "ProgID")) != Qnil) + if ((v = reg_get_val2(hclsid, "ProgID")) != Qnil) rb_ary_push(progids, v); if ((v = reg_get_val2(hclsid, "VersionIndependentProgID")) != Qnil) rb_ary_push(progids, v); @@ -4816,7 +4816,7 @@ oletype_set_member(VALUE self, ITypeInfo *pTypeInfo, VALUE name) static VALUE oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass) { - + long count; int i; HRESULT hr; @@ -4825,7 +4825,7 @@ oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass) ITypeInfo *pTypeInfo; VALUE found = Qfalse; - + count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib); for (i = 0; i < count && found == Qfalse; i++) { hr = pTypeLib->lpVtbl->GetTypeInfo(pTypeLib, i, &pTypeInfo); @@ -4833,7 +4833,7 @@ oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass) continue; hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, i, &bstr, NULL, NULL, NULL); - if (FAILED(hr)) + if (FAILED(hr)) continue; typelib = WC2VSTR(bstr); if (rb_str_cmp(oleclass, typelib) == 0) { @@ -4874,7 +4874,7 @@ oletypelib_get_libattr(ITypeLib *pTypeLib, TLIBATTR **ppTLibAttr) HRESULT hr; hr = pTypeLib->lpVtbl->GetLibAttr(pTypeLib, ppTLibAttr); if (FAILED(hr)) { - ole_raise(hr, eWIN32OLERuntimeError, + ole_raise(hr, eWIN32OLERuntimeError, "failed to get library attribute(TLIBATTR) from ITypeLib"); } } @@ -4995,7 +4995,7 @@ oletypelib_search_registry2(VALUE self, VALUE args) if (ver == Qnil) break; err = reg_open_vkey(hguid, ver, &hversion); - if (err != ERROR_SUCCESS) + if (err != ERROR_SUCCESS) continue; tlib = reg_get_val(hversion, NULL); if (tlib == Qnil) { @@ -5051,7 +5051,7 @@ oletypelib_search_registry(VALUE self, VALUE typelib) if (ver == Qnil) break; err = reg_open_vkey(hguid, ver, &hversion); - if (err != ERROR_SUCCESS) + if (err != ERROR_SUCCESS) continue; tlib = reg_get_val(hversion, NULL); if (tlib == Qnil) { @@ -5090,7 +5090,7 @@ foletypelib_s_allocate(VALUE klass) * * Returns a new WIN32OLE_TYPELIB object. * - * The first argument typelib specifies OLE type library name or GUID or + * The first argument typelib specifies OLE type library name or GUID or * OLE library file. * The second argument is major version or version of the type library. * The third argument is minor version. @@ -5098,7 +5098,7 @@ foletypelib_s_allocate(VALUE klass) * If the first argument is type library name, then the second and third argument * are ignored. * - * tlib1 = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib1 = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') * tlib2 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}') * tlib3 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1.3) * tlib4 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1, 3) @@ -5197,7 +5197,7 @@ foletypelib_name(VALUE self) pTypeLib = oletypelib_get_typelib(self); hr = pTypeLib->lpVtbl->GetDocumentation(pTypeLib, -1, NULL, &bstr, NULL, NULL); - + if (FAILED(hr)) { ole_raise(hr, eWIN32OLERuntimeError, "failed to get name from ITypeLib"); } @@ -5207,7 +5207,7 @@ foletypelib_name(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#version -> The type library version. + * WIN32OLE_TYPELIB#version -> The type library version. * * Returns the type library version. * @@ -5232,7 +5232,7 @@ foletypelib_version(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#major_version -> The type library major version. + * WIN32OLE_TYPELIB#major_version -> The type library major version. * * Returns the type library major version. * @@ -5255,7 +5255,7 @@ foletypelib_major_version(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#minor_version -> The type library minor version. + * WIN32OLE_TYPELIB#minor_version -> The type library minor version. * * Returns the type library minor version. * @@ -5308,7 +5308,7 @@ oletypelib_path(VALUE guid, VALUE version) return path; } -static HRESULT +static HRESULT oletypelib_from_guid(VALUE guid, VALUE version, ITypeLib **ppTypeLib) { VALUE path; @@ -5326,7 +5326,7 @@ oletypelib_from_guid(VALUE guid, VALUE version, ITypeLib **ppTypeLib) /* * call-seq: - * WIN32OLE_TYPELIB#path -> The type library file path. + * WIN32OLE_TYPELIB#path -> The type library file path. * * Returns the type library file path. * @@ -5337,7 +5337,7 @@ static VALUE foletypelib_path(VALUE self) { TLIBATTR *pTLibAttr; - HRESULT hr = S_OK; + HRESULT hr = S_OK; BSTR bstr; LCID lcid = cWIN32OLE_lcid; VALUE path; @@ -5345,7 +5345,7 @@ foletypelib_path(VALUE self) pTypeLib = oletypelib_get_typelib(self); oletypelib_get_libattr(pTypeLib, &pTLibAttr); - hr = QueryPathOfRegTypeLib(&pTLibAttr->guid, + hr = QueryPathOfRegTypeLib(&pTLibAttr->guid, pTLibAttr->wMajorVerNum, pTLibAttr->wMinorVerNum, lcid, @@ -5362,7 +5362,7 @@ foletypelib_path(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#visible? + * WIN32OLE_TYPELIB#visible? * * Returns true if the type library information is not hidden. * If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN, @@ -5394,7 +5394,7 @@ foletypelib_visible(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#library_name + * WIN32OLE_TYPELIB#library_name * * Returns library name. * If the method fails to access library name, WIN32OLERuntimeError is raised. @@ -5428,7 +5428,7 @@ foletypelib_library_name(VALUE self) * Returns the type library file path. * * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') - * classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...] + * classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...] */ static VALUE foletypelib_ole_types(VALUE self) @@ -5469,8 +5469,8 @@ foletypelib_inspect(VALUE self) * The first argument typelib specifies OLE type library name. * The second argument specifies OLE class name. * - * WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') - * # => WIN32OLE_TYPE object of Application class of Excel. + * WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * # => WIN32OLE_TYPE object of Application class of Excel. */ static VALUE foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass) @@ -5505,7 +5505,7 @@ foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass) * WIN32OLE_TYPE#name #=> OLE type name * * Returns OLE type name. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.name # => Application */ static VALUE @@ -5563,9 +5563,9 @@ ole_ole_type(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#ole_type #=> OLE type string. - * + * * returns type of OLE class. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.ole_type # => Class */ static VALUE @@ -5585,7 +5585,7 @@ ole_type_guid(ITypeInfo *pTypeInfo) OLECHAR bstr[80]; VALUE guid = Qnil; hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr); - if (FAILED(hr)) + if (FAILED(hr)) return guid; len = StringFromGUID2(&pTypeAttr->guid, bstr, sizeof(bstr)/sizeof(OLECHAR)); if (len > 3) { @@ -5598,9 +5598,9 @@ ole_type_guid(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#guid #=> GUID - * + * * Returns GUID. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.guid # => {00024500-0000-0000-C000-000000000046} */ static VALUE @@ -5619,7 +5619,7 @@ ole_type_progid(ITypeInfo *pTypeInfo) OLECHAR *pbuf; VALUE progid = Qnil; hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr); - if (FAILED(hr)) + if (FAILED(hr)) return progid; hr = ProgIDFromCLSID(&pTypeAttr->guid, &pbuf); if (SUCCEEDED(hr)) { @@ -5633,7 +5633,7 @@ ole_type_progid(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#progid #=> ProgID - * + * * Returns ProgID if it exists. If not found, then returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.progid # => Excel.Application.9 @@ -5654,7 +5654,7 @@ ole_type_visible(ITypeInfo *pTypeInfo) TYPEATTR *pTypeAttr; VALUE visible; hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr); - if (FAILED(hr)) + if (FAILED(hr)) return Qtrue; if (pTypeAttr->wTypeFlags & (TYPEFLAG_FHIDDEN | TYPEFLAG_FRESTRICTED)) { visible = Qfalse; @@ -5668,7 +5668,7 @@ ole_type_visible(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#visible #=> true or false - * + * * Returns true if the OLE class is public. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.visible # => true @@ -5698,7 +5698,7 @@ ole_type_major_version(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#major_version - * + * * Returns major version. * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') * puts tobj.major_version # => 8 @@ -5728,7 +5728,7 @@ ole_type_minor_version(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#minor_version #=> OLE minor version - * + * * Returns minor version. * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') * puts tobj.minor_version # => 2 @@ -5758,13 +5758,13 @@ ole_type_typekind(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#typekind #=> number of type. - * + * * Returns number which represents type. * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') * puts tobj.typekind # => 4 * */ -static VALUE +static VALUE foletype_typekind(VALUE self) { struct oletypedata *ptype; @@ -5787,12 +5787,12 @@ ole_type_helpstring(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#helpstring #=> help string. - * + * * Returns help string. * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') * puts tobj.helpstring # => Web Browser interface */ -static VALUE +static VALUE foletype_helpstring(VALUE self) { struct oletypedata *ptype; @@ -5821,7 +5821,7 @@ ole_type_src_type(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#src_type #=> OLE source class - * + * * Returns source class when the OLE class is 'Alias'. * tobj = WIN32OLE_TYPE.new('Microsoft Office 9.0 Object Library', 'MsoRGBType') * puts tobj.src_type # => I4 @@ -5850,7 +5850,7 @@ ole_type_helpfile(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#helpfile - * + * * Returns helpfile path. If helpfile is not found, then returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * puts tobj.helpfile # => C:\...\VBAXL9.CHM @@ -5869,7 +5869,7 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo) { HRESULT hr; DWORD helpcontext; - hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL, + hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL, &helpcontext, NULL); if(FAILED(hr)) return Qnil; @@ -5879,7 +5879,7 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#helpcontext - * + * * Returns helpcontext. If helpcontext is not found, then returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * puts tobj.helpfile # => 131185 @@ -5895,8 +5895,8 @@ foletype_helpcontext(VALUE self) /* * call-seq: * WIN32OLE_TYPE#ole_typelib - * - * Returns the WIN32OLE_TYPELIB object which is including the WIN32OLE_TYPE + * + * Returns the WIN32OLE_TYPELIB object which is including the WIN32OLE_TYPE * object. If it is not found, then returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * puts tobj.ole_typelib # => 'Microsoft Excel 9.0 Object Library' @@ -5934,7 +5934,7 @@ ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags) if (FAILED(hr)) continue; hr = pTypeInfo->lpVtbl->GetRefTypeInfo(pTypeInfo, href, &pRefTypeInfo); - if (FAILED(hr)) + if (FAILED(hr)) continue; if ((flags & implflags) == implflags) { @@ -5953,9 +5953,9 @@ ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags) /* * call-seq: * WIN32OLE_TYPE#implemented_ole_types - * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE - * object. + * + * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * object. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * p tobj.implemented_ole_types # => [_Worksheet, DocEvents] */ @@ -5970,10 +5970,10 @@ foletype_impl_ole_types(VALUE self) /* * call-seq: * WIN32OLE_TYPE#source_ole_types - * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE - * object and having IMPLTYPEFLAG_FSOURCE. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") + * + * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * object and having IMPLTYPEFLAG_FSOURCE. + * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") * p tobj.source_ole_types * # => [#, #] */ @@ -5988,10 +5988,10 @@ foletype_source_ole_types(VALUE self) /* * call-seq: * WIN32OLE_TYPE#default_event_sources - * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE - * object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") + * + * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT. + * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") * p tobj.default_event_sources # => [#] */ static VALUE @@ -6005,10 +6005,10 @@ foletype_default_event_sources(VALUE self) /* * call-seq: * WIN32OLE_TYPE#default_ole_types - * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * + * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE * object and having IMPLTYPEFLAG_FDEFAULT. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") + * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") * p tobj.default_ole_types * # => [#, #] */ @@ -6052,7 +6052,7 @@ ole_variables(ITypeInfo *pTypeInfo) if (FAILED(hr)) { ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr"); } - + for(i = 0; i < pTypeAttr->cVars; i++) { hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, i, &pVarDesc); if(FAILED(hr)) @@ -6082,15 +6082,15 @@ ole_variables(ITypeInfo *pTypeInfo) /* * call-seq: * WIN32OLE_TYPE#variables - * - * Returns array of WIN32OLE_VARIABLE objects which represent variables + * + * Returns array of WIN32OLE_VARIABLE objects which represent variables * defined in OLE class. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * vars = tobj.variables * vars.each do |v| * puts "#{v.name} = #{v.value}" * end - * + * * The result of above sample script is follows: * xlChart = -4109 * xlDialogSheet = -4116 @@ -6110,13 +6110,13 @@ foletype_variables(VALUE self) /* * call-seq: * WIN32OLE_TYPE#ole_methods # the array of WIN32OLE_METHOD objects. - * - * Returns array of WIN32OLE_METHOD objects which represent OLE method defined in + * + * Returns array of WIN32OLE_METHOD objects which represent OLE method defined in * OLE type library. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * methods = tobj.ole_methods.collect{|m| * m.name - * } + * } * # => ['Activate', 'Copy', 'Delete',....] */ static VALUE @@ -6136,7 +6136,7 @@ foletype_methods(VALUE self) /* * call-seq: * WIN32OLE_VARIABLE#name - * + * * Returns the name of variable. * * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') @@ -6176,7 +6176,7 @@ ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: * WIN32OLE_VARIABLE#ole_type - * + * * Returns OLE type string. * * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') @@ -6218,7 +6218,7 @@ ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: * WIN32OLE_VARIABLE#ole_type_detail - * + * * Returns detail information of type. The information is array of type. * * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', 'D3DCLIPSTATUS') @@ -6253,8 +6253,8 @@ ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: * WIN32OLE_VARIABLE#value - * - * Returns value if value is exists. If the value does not exist, + * + * Returns value if value is exists. If the value does not exist, * this method returns nil. * * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') @@ -6270,7 +6270,7 @@ ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index) * xlExcel4MacroSheet = 3 * xlWorksheet = -4167 * - */ + */ static VALUE folevariable_value(VALUE self) { @@ -6300,7 +6300,7 @@ ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: * WIN32OLE_VARIABLE#visible? - * + * * Returns true if the variable is public. * * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') @@ -6315,7 +6315,7 @@ ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index) * xlExcel4IntlMacroSheet true * xlExcel4MacroSheet true * xlWorksheet true - * + * */ static VALUE folevariable_visible(VALUE self) @@ -6357,7 +6357,7 @@ ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: * WIN32OLE_VARIABLE#variable_kind - * + * * Returns variable kind string. * * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') @@ -6391,14 +6391,14 @@ ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index) if (FAILED(hr)) return kind; pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc); - kind = INT2FIX(pVarDesc->varkind); + kind = INT2FIX(pVarDesc->varkind); return kind; } /* * call-seq: * WIN32OLE_VARIABLE#varkind - * + * * Returns the number which represents variable kind. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables @@ -6425,7 +6425,7 @@ folevariable_varkind(VALUE self) * call-seq: * WIN32OLE_VARIABLE#inspect -> String * - * Returns the OLE variable name and the value with class name. + * Returns the OLE variable name and the value with class name. * */ static VALUE @@ -6462,7 +6462,7 @@ folemethod_s_allocate(VALUE klass) { struct olemethoddata *pmethod; VALUE obj; - obj = Data_Make_Struct(klass, + obj = Data_Make_Struct(klass, struct olemethoddata, 0, olemethod_free, pmethod); pmethod->pTypeInfo = NULL; @@ -6474,7 +6474,7 @@ folemethod_s_allocate(VALUE klass) /* * call-seq: * WIN32OLE_METHOD.new(ole_type, method) -> WIN32OLE_METHOD object - * + * * Returns a new WIN32OLE_METHOD object which represents the information * about OLE method. * The first argument ole_type specifies WIN32OLE_TYPE object. @@ -6513,7 +6513,7 @@ folemethod_initialize(VALUE self, VALUE oletype, VALUE method) * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') * puts method.name # => SaveAs - * + * */ static VALUE folemethod_name(VALUE self) @@ -6529,9 +6529,9 @@ ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index) VALUE type; hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); - if (FAILED(hr)) + if (FAILED(hr)) ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc"); - + type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return type; @@ -6540,7 +6540,7 @@ ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#return_type - * + * * Returns string of return value type of method. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6563,9 +6563,9 @@ ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index) VALUE vvt; hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); - if (FAILED(hr)) + if (FAILED(hr)) ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc"); - + vvt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return vvt; @@ -6574,7 +6574,7 @@ ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#return_vtype - * + * * Returns number of return value type of method. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6597,9 +6597,9 @@ ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index) VALUE type = rb_ary_new(); hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); - if (FAILED(hr)) + if (FAILED(hr)) return type; - + ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), type); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return type; @@ -6608,7 +6608,7 @@ ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#return_type_detail - * + * * Returns detail information of return value type of method. * The information is array. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') @@ -6630,7 +6630,7 @@ ole_method_invkind(ITypeInfo *pTypeInfo, UINT method_index) HRESULT hr; VALUE invkind; hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); - if(FAILED(hr)) + if(FAILED(hr)) ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc"); invkind = INT2FIX(pFuncDesc->invkind); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); @@ -6660,8 +6660,8 @@ ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_MTHOD#invkind - * - * Returns the method invoke kind. + * + * Returns the method invoke kind. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') * puts method.invkind # => 1 @@ -6678,9 +6678,9 @@ folemethod_invkind(VALUE self) /* * call-seq: * WIN32OLE_METHOD#invoke_kind - * - * Returns the method kind string. The string is "UNKNOWN" or "PROPERTY" - * or "PROPERTY" or "PROPERTYGET" or "PROPERTYPUT" or "PROPERTYPPUTREF" + * + * Returns the method kind string. The string is "UNKNOWN" or "PROPERTY" + * or "PROPERTY" or "PROPERTYGET" or "PROPERTYPUT" or "PROPERTYPPUTREF" * or "FUNC". * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6717,7 +6717,7 @@ ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#visible? - * + * * Returns true if the method is public. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6744,9 +6744,9 @@ ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name) BSTR bstr; VALUE name; VALUE event = Qfalse; - + hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr); - if (FAILED(hr)) + if (FAILED(hr)) return event; if(pTypeAttr->typekind != TKIND_COCLASS) { pTypeInfo->lpVtbl->ReleaseTypeAttr(pTypeInfo, pTypeAttr); @@ -6766,14 +6766,14 @@ ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name) href, &pRefTypeInfo); if (FAILED(hr)) continue; - hr = pRefTypeInfo->lpVtbl->GetFuncDesc(pRefTypeInfo, method_index, + hr = pRefTypeInfo->lpVtbl->GetFuncDesc(pRefTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) { OLE_RELEASE(pRefTypeInfo); continue; } - hr = pRefTypeInfo->lpVtbl->GetDocumentation(pRefTypeInfo, + hr = pRefTypeInfo->lpVtbl->GetDocumentation(pRefTypeInfo, pFuncDesc->memid, &bstr, NULL, NULL, NULL); if (FAILED(hr)) { @@ -6798,7 +6798,7 @@ ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name) /* * call-seq: * WIN32OLE_METHOD#event? - * + * * Returns true if the method is event. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate') @@ -6812,7 +6812,7 @@ folemethod_event(VALUE self) Data_Get_Struct(self, struct olemethoddata, pmethod); if (!pmethod->pOwnerTypeInfo) return Qfalse; - return ole_method_event(pmethod->pOwnerTypeInfo, + return ole_method_event(pmethod->pOwnerTypeInfo, pmethod->index, rb_ivar_get(self, rb_intern("name"))); } @@ -6869,7 +6869,7 @@ ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index) HRESULT hr; BSTR bhelpstring; hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, &bhelpstring, - NULL, NULL); + NULL, NULL); if (FAILED(hr)) return Qnil; return WC2VSTR(bhelpstring); @@ -6879,7 +6879,7 @@ ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index) * call-seq: * WIN32OLE_METHOD#helpstring * - * Returns help string of OLE method. If the help string is not found, + * Returns help string of OLE method. If the help string is not found, * then the method returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') * method = WIN32OLE_METHOD.new(tobj, 'Navigate') @@ -6900,7 +6900,7 @@ ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index) HRESULT hr; BSTR bhelpfile; hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, NULL, - NULL, &bhelpfile); + NULL, &bhelpfile); if (FAILED(hr)) return Qnil; return WC2VSTR(bhelpfile); @@ -6909,8 +6909,8 @@ ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#helpfile - * - * Returns help file. If help file is not found, then + * + * Returns help file. If help file is not found, then * the method returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6931,16 +6931,16 @@ ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index) HRESULT hr; DWORD helpcontext = 0; hr = ole_method_docinfo_from_type(pTypeInfo, method_index, NULL, NULL, - &helpcontext, NULL); + &helpcontext, NULL); if (FAILED(hr)) return Qnil; return INT2FIX(helpcontext); } -/* +/* * call-seq: * WIN32OLE_METHOD#helpcontext - * + * * Returns help context. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6963,7 +6963,7 @@ ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index) hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return dispid; - dispid = INT2NUM(pFuncDesc->memid); + dispid = INT2NUM(pFuncDesc->memid); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return dispid; } @@ -6971,7 +6971,7 @@ ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#dispid - * + * * Returns dispatch ID. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -6994,7 +6994,7 @@ ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index) hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return offset_vtbl; - offset_vtbl = INT2FIX(pFuncDesc->oVft); + offset_vtbl = INT2FIX(pFuncDesc->oVft); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return offset_vtbl; } @@ -7002,7 +7002,7 @@ ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#offset_vtbl - * + * * Returns the offset ov VTBL. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') * method = WIN32OLE_METHOD.new(tobj, 'Add') @@ -7033,12 +7033,12 @@ ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#size_params - * + * * Returns the size of arguments of the method. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') * puts method.size_params # => 11 - * + * */ static VALUE folemethod_size_params(VALUE self) @@ -7065,7 +7065,7 @@ ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#size_opt_params - * + * * Returns the size of optional parameters. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') @@ -7090,12 +7090,12 @@ ole_method_params(ITypeInfo *pTypeInfo, UINT method_index) VALUE param; VALUE params = rb_ary_new(); hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); - if (FAILED(hr)) + if (FAILED(hr)) return params; len = 0; bstrs = ALLOCA_N(BSTR, pFuncDesc->cParams + 1); - hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid, + hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid, bstrs, pFuncDesc->cParams + 1, &len); if (FAILED(hr)) { @@ -7123,13 +7123,13 @@ ole_method_params(ITypeInfo *pTypeInfo, UINT method_index) /* * call-seq: * WIN32OLE_METHOD#params - * + * * returns array of WIN32OLE_PARAM object corresponding with method parameters. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') - * p method.params # => [Filename, FileFormat, Password, WriteResPassword, - * ReadOnlyRecommended, CreateBackup, AccessMode, - * ConflictResolution, AddToMru, TextCodepage, + * p method.params # => [Filename, FileFormat, Password, WriteResPassword, + * ReadOnlyRecommended, CreateBackup, AccessMode, + * ConflictResolution, AddToMru, TextCodepage, * TextVisualLayout] */ static VALUE @@ -7156,14 +7156,14 @@ folemethod_inspect(VALUE self) /* * Document-class: WIN32OLE_PARAM * - * WIN32OLE_PARAM objects represent param information of + * WIN32OLE_PARAM objects represent param information of * the OLE method. */ /* * call-seq: * WIN32OLE_PARAM#name - * + * * Returns name. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') @@ -7185,7 +7185,7 @@ ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index) hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return type; - type = ole_typedesc2val(pTypeInfo, + type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->lprgelemdescParam[index].tdesc), Qnil); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return type; @@ -7201,12 +7201,12 @@ ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index) * param1 = method.params[0] * puts param1.ole_type # => VARIANT */ -static VALUE +static VALUE foleparam_ole_type(VALUE self) { struct oleparamdata *pparam; Data_Get_Struct(self, struct oleparamdata, pparam); - return ole_param_ole_type(pparam->pTypeInfo, pparam->method_index, + return ole_param_ole_type(pparam->pTypeInfo, pparam->method_index, pparam->index); } @@ -7219,7 +7219,7 @@ ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index) hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return typedetail; - ole_typedesc2val(pTypeInfo, + ole_typedesc2val(pTypeInfo, &(pFuncDesc->lprgelemdescParam[index].tdesc), typedetail); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return typedetail; @@ -7235,12 +7235,12 @@ ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index) * param1 = method.params[0] * p param1.ole_type_detail # => ["PTR", "USERDEFINED", "Range"] */ -static VALUE +static VALUE foleparam_ole_type_detail(VALUE self) { struct oleparamdata *pparam; Data_Get_Struct(self, struct oleparamdata, pparam); - return ole_param_ole_type_detail(pparam->pTypeInfo, pparam->method_index, + return ole_param_ole_type_detail(pparam->pTypeInfo, pparam->method_index, pparam->index); } @@ -7251,9 +7251,9 @@ ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT HRESULT hr; VALUE ret = Qfalse; hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); - if(FAILED(hr)) + if(FAILED(hr)) return ret; - if (V_UNION1((&(pFuncDesc->lprgelemdescParam[index])), paramdesc).wParamFlags &mask) + if (V_UNION1((&(pFuncDesc->lprgelemdescParam[index])), paramdesc).wParamFlags &mask) ret = Qtrue; pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return ret; @@ -7262,7 +7262,7 @@ ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT /* * call-seq: * WIN32OLE_PARAM#input? - * + * * Returns true if the parameter is input. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') @@ -7273,14 +7273,14 @@ static VALUE foleparam_input(VALUE self) { struct oleparamdata *pparam; Data_Get_Struct(self, struct oleparamdata, pparam); - return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, + return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, pparam->index, PARAMFLAG_FIN); } /* * call-seq: * WIN32OLE#output? - * + * * Returns true if argument is output. * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'DWebBrowserEvents') * method = WIN32OLE_METHOD.new(tobj, 'NewWindow') @@ -7300,14 +7300,14 @@ static VALUE foleparam_output(VALUE self) { struct oleparamdata *pparam; Data_Get_Struct(self, struct oleparamdata, pparam); - return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, + return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, pparam->index, PARAMFLAG_FOUT); } /* * call-seq: * WIN32OLE_PARAM#optional? - * + * * Returns true if argument is optional. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') @@ -7318,7 +7318,7 @@ static VALUE foleparam_optional(VALUE self) { struct oleparamdata *pparam; Data_Get_Struct(self, struct oleparamdata, pparam); - return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, + return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, pparam->index, PARAMFLAG_FOPT); } @@ -7327,7 +7327,7 @@ static VALUE foleparam_optional(VALUE self) * WIN32OLE_PARAM#retval? * * Returns true if argument is return value. - * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', + * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', * 'DirectPlayLobbyConnection') * method = WIN32OLE_METHOD.new(tobj, 'GetPlayerShortName') * param = method.params[0] @@ -7337,7 +7337,7 @@ static VALUE foleparam_retval(VALUE self) { struct oleparamdata *pparam; Data_Get_Struct(self, struct oleparamdata, pparam); - return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, + return ole_param_flag_mask(pparam->pTypeInfo, pparam->method_index, pparam->index, PARAMFLAG_FRETVAL); } @@ -7354,7 +7354,7 @@ ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index) hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return defval; - pElemDesc = &pFuncDesc->lprgelemdescParam[index]; + pElemDesc = &pFuncDesc->lprgelemdescParam[index]; wParamFlags = V_UNION1(pElemDesc, paramdesc).wParamFlags; if ((wParamFlags & mask) == mask) { pParamDescEx = V_UNION1(pElemDesc, paramdesc).pparamdescex; @@ -7367,8 +7367,8 @@ ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index) /* * call-seq: * WIN32OLE_PARAM#default - * - * Returns default value. If the default value does not exist, + * + * Returns default value. If the default value does not exist, * this method returns nil. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') @@ -7420,7 +7420,7 @@ foleparam_inspect(VALUE self) } return make_inspect("WIN32OLE_PARAM", detail); } - + /* * Document-class: WIN32OLE_EVENT * @@ -7511,7 +7511,7 @@ ole_search_event_at(VALUE ary, VALUE ev) VALUE event; VALUE def_event; VALUE event_name; - long i, len; + long i, len; long ret = -1; def_event = Qnil; len = RARRAY_LEN(ary); @@ -7584,7 +7584,7 @@ ole_delete_event(VALUE ary, VALUE ev) } } -static void +static void hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams) { BSTR *bstrs; @@ -7595,7 +7595,7 @@ hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS VALUE key; len = 0; bstrs = ALLOCA_N(BSTR, pdispparams->cArgs + 1); - hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid, + hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, dispid, bstrs, pdispparams->cArgs + 1, &len); if (FAILED(hr)) @@ -7604,7 +7604,7 @@ hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS for (i = 0; i < len - 1; i++) { key = WC2VSTR(bstrs[i + 1]); val = rb_hash_aref(hash, INT2FIX(i)); - if (val == Qnil) + if (val == Qnil) val = rb_hash_aref(hash, key); if (val == Qnil) val = rb_hash_aref(hash, rb_str_intern(key)); @@ -7613,7 +7613,7 @@ hash2ptr_dispparams(VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS } } -static VALUE +static VALUE hash2result(VALUE hash) { VALUE ret = Qnil; @@ -7649,7 +7649,7 @@ exec_callback(VALUE arg) static VALUE rescue_callback(VALUE arg) { - + VALUE error; VALUE e = rb_errinfo(); VALUE bt = rb_funcall(e, rb_intern("backtrace"), 0); @@ -7660,7 +7660,7 @@ rescue_callback(VALUE arg) rb_backtrace(); ruby_finalize(); exit(-1); - + return Qnil; } @@ -7741,7 +7741,7 @@ STDMETHODIMP EVENTSINK_Invoke( /* * if exception raised in event callback, - * then you receive cfp consistency error. + * then you receive cfp consistency error. * to avoid this error we use begin rescue end. * and the exception raised then error message print * and exit ruby process by Win32OLE itself. @@ -7764,7 +7764,7 @@ STDMETHODIMP EVENTSINK_Invoke( VariantInit(pvarResult); ole_val2variant(result, pvarResult); } - + return NOERROR; } @@ -7912,11 +7912,11 @@ find_iid(VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo) return hr; } -static HRESULT +static HRESULT find_coclass( - ITypeInfo *pTypeInfo, - TYPEATTR *pTypeAttr, - ITypeInfo **pCOTypeInfo, + ITypeInfo *pTypeInfo, + TYPEATTR *pTypeAttr, + ITypeInfo **pCOTypeInfo, TYPEATTR **pCOTypeAttr) { HRESULT hr = E_NOINTERFACE; @@ -7954,13 +7954,13 @@ find_coclass( hr = pTypeInfo2->lpVtbl->GetImplTypeFlags(pTypeInfo2, j, &flags); if (FAILED(hr)) continue; - if (!(flags & IMPLTYPEFLAG_FDEFAULT)) + if (!(flags & IMPLTYPEFLAG_FDEFAULT)) continue; hr = pTypeInfo2->lpVtbl->GetRefTypeOfImplType(pTypeInfo2, j, &href); if (FAILED(hr)) continue; hr = pTypeInfo2->lpVtbl->GetRefTypeInfo(pTypeInfo2, href, &pRefTypeInfo); - if (FAILED(hr)) + if (FAILED(hr)) continue; hr = OLE_GET_TYPEATTR(pRefTypeInfo, &pRefTypeAttr); if (FAILED(hr)) { @@ -7989,8 +7989,8 @@ find_coclass( static HRESULT find_default_source_from_typeinfo( - ITypeInfo *pTypeInfo, - TYPEATTR *pTypeAttr, + ITypeInfo *pTypeInfo, + TYPEATTR *pTypeAttr, ITypeInfo **ppTypeInfo) { int i = 0; @@ -8222,7 +8222,7 @@ ev_advise(int argc, VALUE *argv, VALUE self) * The second argument specifies OLE event name. * ie = WIN32OLE.new('InternetExplorer.Application') * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents') - */ + */ static VALUE fev_initialize(int argc, VALUE *argv, VALUE self) { @@ -8236,7 +8236,7 @@ fev_initialize(int argc, VALUE *argv, VALUE self) /* * call-seq: * WIN32OLE_EVENT.message_loop - * + * * Translates and dispatches Windows message. */ static VALUE @@ -8285,7 +8285,7 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg) /* * call-seq: * WIN32OLE_EVENT#on_event([event]){...} - * + * * Defines the callback event. * If argument is omitted, this method defines the callback of all events. * If you want to modify reference argument in callback, return hash in @@ -8295,14 +8295,14 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg) * ie = WIN32OLE.new('InternetExplorer.Application') * ev = WIN32OLE_EVENT.new(ie) * ev.on_event("NavigateComplete") {|url| puts url} - * ev.on_event() {|ev, *args| puts "#{ev} fired"} + * ev.on_event() {|ev, *args| puts "#{ev} fired"} * - * ev.on_event("BeforeNavigate2") {|*args| + * ev.on_event("BeforeNavigate2") {|*args| * ... * # set true to BeforeNavigate reference argument `Cancel'. * # Cancel is 7-th argument of BeforeNavigate, * # so you can use 6 as key of hash instead of 'Cancel'. - * # The argument is counted from 0. + * # The argument is counted from 0. * # The hash key of 0 means first argument.) * {:Cancel => true} # or {'Cancel' => true} or {6 => true} * } @@ -8320,9 +8320,9 @@ fev_on_event(int argc, VALUE *argv, VALUE self) /* * call-seq: * WIN32OLE_EVENT#on_event_with_outargs([event]){...} - * + * * Defines the callback of event. - * If you want modify argument in callback, + * If you want modify argument in callback, * you could use this method instead of WIN32OLE_EVENT#on_event. * * ie = WIN32OLE.new('InternetExplorer.Application') @@ -8340,7 +8340,7 @@ fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self) /* * call-seq: * WIN32OLE_EVENT#off_event([event]) - * + * * removes the callback of event. * * ie = WIN32OLE.new('InternetExplorer.Application') @@ -8391,7 +8391,7 @@ fev_off_event(int argc, VALUE *argv, VALUE self) * ev.unadvise * */ -static VALUE +static VALUE fev_unadvise(VALUE self) { struct oleeventdata *poleev; @@ -8406,7 +8406,7 @@ fev_unadvise(VALUE self) return Qnil; } -static VALUE +static VALUE evs_push(VALUE ev) { return rb_ary_push(ary_ole_event, ev); @@ -8419,13 +8419,13 @@ evs_delete(long i) return Qnil; } -static VALUE +static VALUE evs_entry(long i) { return rb_ary_entry(ary_ole_event, i); } -static VALUE +static VALUE evs_length() { return rb_funcall(ary_ole_event, rb_intern("length"), 0); @@ -8436,9 +8436,9 @@ evs_length() * WIN32OLE_EVENT#handler= * * sets event handler object. If handler object has onXXX - * method according to XXX event, then onXXX method is called + * method according to XXX event, then onXXX method is called * when XXX event occurs. - * + * * If handler object has method_missing and there is no * method according to the event, then method_missing * called and 1-st argument is event name. @@ -8459,7 +8459,7 @@ evs_length() * puts "other event #{ev}" * end * end - * + * * handler = Handler.new * ie = WIN32OLE.new('InternetExplorer.Application') * ev = WIN32OLE_EVENT.new(ie) @@ -8480,8 +8480,8 @@ fev_set_handler(VALUE self, VALUE val) * call-seq: * WIN32OLE_EVENT#handler * - * returns handler object. - * + * returns handler object. + * */ static VALUE fev_get_handler(VALUE self) @@ -8489,7 +8489,7 @@ fev_get_handler(VALUE self) return rb_ivar_get(self, rb_intern("handler")); } -static void +static void olevariant_free(struct olevariantdata *pvar) { VariantClear(&(pvar->realvar)); @@ -8514,8 +8514,8 @@ folevariant_s_allocate(VALUE klass) * WIN32OLE_VARIANT.array(ary, vt) * * Returns Ruby object wrapping OLE variant whose variant type is VT_ARRAY. - * The first argument should be Array object which specifies dimensions - * and each size of dimensions of OLE array. + * The first argument should be Array object which specifies dimensions + * and each size of dimensions of OLE array. * The second argument specifies variant type of the element of OLE array. * * The following create 2 dimensions OLE array. The first dimensions size @@ -8524,7 +8524,7 @@ folevariant_s_allocate(VALUE klass) * ole_ary = WIN32OLE_VARIANT.array([3,4], VT_I4) * ruby_ary = ole_ary.value # => [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] * - */ + */ static VALUE folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt) { @@ -8581,7 +8581,7 @@ folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt) * * Returns Ruby object wrapping OLE variant. * The first argument specifies Ruby object to convert OLE variant variable. - * The second argument specifies VARIANT type. + * The second argument specifies VARIANT type. * In some situation, you need the WIN32OLE_VARIANT object to pass OLE method * * shell = WIN32OLE.new("Shell.Application") @@ -8592,7 +8592,7 @@ folevariant_s_array(VALUE klass, VALUE elems, VALUE vvt) * shortcut = WIN32OLE_VARIANT.new("Create Shortcut(\&S)") * item.invokeVerb(shortcut) * - */ + */ static VALUE folevariant_initialize(VALUE self, VALUE args) { @@ -8610,7 +8610,7 @@ folevariant_initialize(VALUE self, VALUE args) VariantInit(&var); val = rb_ary_entry(args, 0); - if(!rb_obj_is_kind_of(val, cWIN32OLE) && + if(!rb_obj_is_kind_of(val, cWIN32OLE) && !rb_obj_is_kind_of(val, cWIN32OLE_VARIANT) && !rb_obj_is_kind_of(val, rb_cTime)) { switch (TYPE(val)) { @@ -8641,7 +8641,7 @@ folevariant_initialize(VALUE self, VALUE args) return self; } -static SAFEARRAY * +static SAFEARRAY * get_locked_safe_array(VALUE val) { struct olevariantdata *pvar; @@ -8683,7 +8683,7 @@ ary2safe_array_index(int ary_size, VALUE *ary, SAFEARRAY *psa) } static void -unlock_safe_array(SAFEARRAY *psa) +unlock_safe_array(SAFEARRAY *psa) { HRESULT hr; hr = SafeArrayUnlock(psa); @@ -8697,11 +8697,11 @@ unlock_safe_array(SAFEARRAY *psa) * WIN32OLE_VARIANT[i,j,...] #=> element of OLE array. * * Returns the element of WIN32OLE_VARIANT object(OLE array). - * This method is available only when the variant type of + * This method is available only when the variant type of * WIN32OLE_VARIANT object is VT_ARRAY. * - * REMARK: - * The all indicies should be 0 or natural number and + * REMARK: + * The all indicies should be 0 or natural number and * lower than or equal to max indicies. * (This point is different with Ruby Array indicies.) * @@ -8711,7 +8711,7 @@ unlock_safe_array(SAFEARRAY *psa) * p obj[2,0] # => WIN32OLERuntimeError * p obj[0, -1] # => WIN32OLERuntimeError * - */ + */ static VALUE folevariant_ary_aref(int argc, VALUE *argv, VALUE self) { @@ -8724,7 +8724,7 @@ folevariant_ary_aref(int argc, VALUE *argv, VALUE self) Data_Get_Struct(self, struct olevariantdata, pvar); if (!V_ISARRAY(&(pvar->var))) { - rb_raise(eWIN32OLERuntimeError, + rb_raise(eWIN32OLERuntimeError, "`[]' is not available for this variant type object"); } psa = get_locked_safe_array(self); @@ -8757,7 +8757,7 @@ val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt) p = var; } else { if ( (vt & ~VT_BYREF) != V_VT(var)) { - hr = VariantChangeTypeEx(var, var, + hr = VariantChangeTypeEx(var, var, cWIN32OLE_lcid, 0, (VARTYPE)(vt & ~VT_BYREF)); if (FAILED(hr)) { ole_raise(hr, rb_eRuntimeError, "failed to change type"); @@ -8776,10 +8776,10 @@ val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt) * WIN32OLE_VARIANT[i,j,...] = val #=> set the element of OLE array * * Set the element of WIN32OLE_VARIANT object(OLE array) to val. - * This method is available only when the variant type of + * This method is available only when the variant type of * WIN32OLE_VARIANT object is VT_ARRAY. * - * REMARK: + * REMARK: * The all indicies should be 0 or natural number and * lower than or equal to max indicies. * (This point is different with Ruby Array indicies.) @@ -8791,7 +8791,7 @@ val2variant_ptr(VALUE val, VARIANT *var, VARTYPE vt) * obj[2,0] = 9 # => WIN32OLERuntimeError * obj[0, -1] = 9 # => WIN32OLERuntimeError * - */ + */ static VALUE folevariant_ary_aset(int argc, VALUE *argv, VALUE self) { @@ -8805,7 +8805,7 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self) Data_Get_Struct(self, struct olevariantdata, pvar); if (!V_ISARRAY(&(pvar->var))) { - rb_raise(eWIN32OLERuntimeError, + rb_raise(eWIN32OLERuntimeError, "`[]' is not available for this variant type object"); } psa = get_locked_safe_array(self); @@ -8840,7 +8840,7 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self) * obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR) * obj.value # => "1" (not Fixnum object, but String object "1") * - */ + */ static VALUE folevariant_value(VALUE self) { @@ -8877,9 +8877,9 @@ folevariant_value(VALUE self) * * Returns OLE variant type. * obj = WIN32OLE_VARIANT.new("string") - * obj.vartype # => WIN32OLE::VARIANT::VT_BSTR + * obj.vartype # => WIN32OLE::VARIANT::VT_BSTR * - */ + */ static VALUE folevariant_vartype(VALUE self) { @@ -8892,16 +8892,16 @@ folevariant_vartype(VALUE self) * call-seq: * WIN32OLE_VARIANT.value = val #=> set WIN32OLE_VARIANT value to val. * - * Sets variant value to val. If the val type does not match variant value - * type(vartype), then val is changed to match variant value type(vartype) + * Sets variant value to val. If the val type does not match variant value + * type(vartype), then val is changed to match variant value type(vartype) * before setting val. * Thie method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY). * If the vartype is VT_UI1|VT_ARRAY, the val should be String object. * * obj = WIN32OLE_VARIANT.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4 * obj.value = 3.2 # 3.2 is changed to 3 when setting value. - * p obj.value # => 3 - */ + * p obj.value # => 3 + */ static VALUE folevariant_set_value(VALUE self, VALUE val) { @@ -8910,14 +8910,14 @@ folevariant_set_value(VALUE self, VALUE val) Data_Get_Struct(self, struct olevariantdata, pvar); vt = V_VT(&(pvar->var)); if (V_ISARRAY(&(pvar->var)) && ((vt & ~VT_BYREF) != (VT_UI1|VT_ARRAY) || TYPE(val) != T_STRING)) { - rb_raise(eWIN32OLERuntimeError, + rb_raise(eWIN32OLERuntimeError, "`value=' is not available for this variant type object"); } ole_val2olevariantdata(val, vt, pvar); return Qnil; } -static void +static void init_enc2cp() { enc2cp_table = st_init_numtable(); @@ -8950,7 +8950,7 @@ Init_win32ole() message_filter.HandleInComingCall = mf_HandleInComingCall; message_filter.RetryRejectedCall = mf_RetryRejectedCall; message_filter.MessagePending = mf_MessagePending; - + com_hash = Data_Wrap_Struct(rb_cData, rb_mark_hash, st_free_table, st_init_numtable()); rb_gc_register_mark_object(com_hash); @@ -8979,7 +8979,7 @@ Init_win32ole() rb_define_method(cWIN32OLE, "_setproperty", fole_setproperty2, 3); /* support propput method that takes an argument */ - rb_define_method(cWIN32OLE, "[]=", fole_setproperty_with_bracket, -1); + rb_define_method(cWIN32OLE, "[]=", fole_setproperty_with_bracket, -1); rb_define_method(cWIN32OLE, "ole_free", fole_free, 0); @@ -9063,7 +9063,7 @@ Init_win32ole() rb_define_method(cWIN32OLE_TYPELIB, "library_name", foletypelib_library_name, 0); rb_define_alias(cWIN32OLE_TYPELIB, "to_s", "name"); rb_define_method(cWIN32OLE_TYPELIB, "inspect", foletypelib_inspect, 0); - + cWIN32OLE_TYPE = rb_define_class("WIN32OLE_TYPE", rb_cObject); rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1); rb_define_singleton_method(cWIN32OLE_TYPE, "typelibs", foletype_s_typelibs, 0); @@ -9137,7 +9137,7 @@ Init_win32ole() rb_define_method(cWIN32OLE_PARAM, "default", foleparam_default, 0); rb_define_alias(cWIN32OLE_PARAM, "to_s", "name"); rb_define_method(cWIN32OLE_PARAM, "inspect", foleparam_inspect, 0); - + cWIN32OLE_EVENT = rb_define_class("WIN32OLE_EVENT", rb_cObject); rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0); rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate); diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 0471b1f00608f0..5da4956d1f94bf 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -995,7 +995,7 @@ rb_zstream_avail_out(VALUE obj) /* * Allocates +size+ bytes of free space in the output buffer. If there are more - * than +size+ bytes already in the buffer, the buffer is truncated. Because + * than +size+ bytes already in the buffer, the buffer is truncated. Because * free space is allocated automatically, you usually don't need to use this * method. */ @@ -1301,7 +1301,7 @@ rb_deflate_flush(int argc, VALUE *argv, VALUE obj) /* * call-seq: params(level, strategy) - * + * * Changes the parameters of the deflate stream. See zlib.h for details. The * output from the stream by changing the params is preserved in output * buffer. @@ -2713,7 +2713,7 @@ rb_gzfile_ecopts(struct gzfile *gz, VALUE opts) * Document-class: Zlib::GzipWriter * * Zlib::GzipWriter is a class for writing gzipped files. GzipWriter should - * be used with an instance of IO, or IO-like, object. + * be used with an instance of IO, or IO-like, object. * * For example: * @@ -2774,7 +2774,7 @@ rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj) opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash"); if (!NIL_P(opt)) argc--; } - + rb_scan_args(argc, argv, "12", &io, &level, &strategy); Data_Get_Struct(obj, struct gzfile, gz); @@ -3669,21 +3669,21 @@ Init_zlib() /* * Document-class: Zlib::GzipFile::NoFooter * - * Raised when gzip file footer is not found. + * Raised when gzip file footer is not found. */ /* * Document-class: Zlib::GzipFile::CRCError * * Raised when the CRC checksum recorded in gzip file footer is not equivalent - * to the CRC checksum of the actual uncompressed data. + * to the CRC checksum of the actual uncompressed data. */ /* * Document-class: Zlib::GzipFile::LengthError * * Raised when the data length recorded in the gzip file footer is not equivalent - * to the length of the actual uncompressed data. + * to the length of the actual uncompressed data. */ diff --git a/ia64.s b/ia64.s index 92415b4e97cc5d..108710558592e3 100644 --- a/ia64.s +++ b/ia64.s @@ -5,11 +5,11 @@ // // void rb_ia64_flushrs(void) { __builtin_ia64_flushrs(); } // void *rb_ia64_bsp(void) { return __builtin_ia64_bsp(); } -// +// // Note that rb_ia64_flushrs and rb_ia64_bsp works in its own stack frame. // It's because BSP is updated by br.call/brl.call (not alloc instruction). // So rb_ia64_flushrs flushes stack frames including caller's one. -// rb_ia64_bsp returns the address next to caller's register stack frame. +// rb_ia64_bsp returns the address next to caller's register stack frame. // // See also // Intel Itanium Architecture Software Developer's Manual diff --git a/lib/README b/lib/README index a8bb9c8d3db54b..76ffbdb0b3e0c3 100644 --- a/lib/README +++ b/lib/README @@ -26,7 +26,7 @@ irb.rb interactive ruby logger.rb simple logging utility mathn.rb extended math operation (obsolete) matrix.rb matrix calculation library -minitest/unit minimal drop-in replacement for test-unit +minitest/unit minimal drop-in replacement for test-unit mkmf.rb Makefile maker monitor.rb exclusive region monitor for thread mutex_m.rb mutex mixin diff --git a/lib/irb/init.rb b/lib/irb/init.rb index f51fd1c0b1da87..32970752e9d1b0 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -112,9 +112,9 @@ def IRB.init_config(ap_path) # @CONF[:LC_MESSAGES] = "en" @CONF[:LC_MESSAGES] = Locale.new - + @CONF[:AT_EXIT] = [] - + @CONF[:DEBUG_LEVEL] = 1 end @@ -147,7 +147,7 @@ def IRB.parse_opts opt = $1 || ARGV.shift set_encoding(*opt.split(':', 2)) when "--inspect" - if /^-/ !~ ARGV.first + if /^-/ !~ ARGV.first @CONF[:INSPECT_MODE] = ARGV.shift else @CONF[:INSPECT_MODE] = true diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb index ab5128399eef50..aefe077f378fe9 100644 --- a/lib/irb/inspector.rb +++ b/lib/irb/inspector.rb @@ -7,7 +7,7 @@ # # -- # -# +# # module IRB @@ -57,13 +57,13 @@ def INSPECTORS.def_inspector(key, arg=nil, &block) # else # inspector = IRB::Inspector(block, init_p) # end - + if block_given? inspector = IRB::Inspector(block, arg) else inspector = arg end - + case key when Array for k in key @@ -81,7 +81,7 @@ def INSPECTORS.def_inspector(key, arg=nil, &block) end INSPECTORS.def_inspector([false, :to_s, :raw]){|v| v.to_s} - INSPECTORS.def_inspector([true, :p, :inspect]){|v| + INSPECTORS.def_inspector([true, :p, :inspect]){|v| begin v.inspect rescue NoMethodError @@ -89,7 +89,7 @@ def INSPECTORS.def_inspector(key, arg=nil, &block) end } INSPECTORS.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp} - INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v| + INSPECTORS.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v| begin YAML.dump(v) rescue @@ -98,12 +98,12 @@ def INSPECTORS.def_inspector(key, arg=nil, &block) end } - INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v| + INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v| Marshal.dump(v) } end - - + + diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message index dd30b9fd247023..0870edb8a37537 100644 --- a/lib/irb/lc/help-message +++ b/lib/irb/lc/help-message @@ -1,16 +1,16 @@ # -*- coding: US-ASCII -*- # -# irb/lc/help-message.rb - +# irb/lc/help-message.rb - # $Release Version: 0.9.6$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # Usage: irb.rb [options] [programfile] [arguments] - -f Suppress read of ~/.irbrc + -f Suppress read of ~/.irbrc -m Bc mode (load mathn, fraction or matrix are available) -d Set $DEBUG to true (same as `ruby -d') -r load-module Same as `ruby -r' @@ -25,14 +25,14 @@ Usage: irb.rb [options] [programfile] [arguments] --prompt-mode prompt-mode Switch prompt mode. Pre-defined prompt modes are `default', `simple', `xmp' and `inf-ruby' - --inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs. - Suppresses --readline. + --inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs. + Suppresses --readline. --simple-prompt Simple prompt mode --noprompt No prompt mode --tracer Display trace for each execution of commands. --back-trace-limit n Display backtrace top n and tail n. The default - value is 16. + value is 16. --irb_debug n Set internal debug level to n (not for popular use) -v, --version Print the version of irb # vim:fileencoding=us-ascii diff --git a/lib/irb/lc/ja/help-message b/lib/irb/lc/ja/help-message index f2c4066cf6d37a..bef730f721e541 100644 --- a/lib/irb/lc/ja/help-message +++ b/lib/irb/lc/ja/help-message @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -# irb/lc/ja/help-message.rb - +# irb/lc/ja/help-message.rb - # $Release Version: 0.9.6$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # -# +# # Usage: irb.rb [options] [programfile] [arguments] -f ~/.irbrc 茯粋昭障. @@ -16,14 +16,14 @@ Usage: irb.rb [options] [programfile] [arguments] -I path $LOAD_PATH path 菴遵. -U ruby -U . -E enc ruby -E . - --inspect 腟阪inspect(bc≪若篁ュ). + --inspect 腟阪inspect(bc≪若篁ュ). --noinspect 腟阪inspect. --readline readlineゃ. - --noreadline readlineゃ. + --noreadline readlineゃ. --prompt prompt-mode/--prompt-mode prompt-mode 潟≪若帥障. 憜絎臂 潟≪若, default, simple, xmp, inf-ruby - 障. + 障. --inf-ruby-mode emacsinf-ruby-mode潟茵腓冴茵. 絎, readlineゃ篏帥. --simple-prompt 絽吾激潟潟≪若с. @@ -31,7 +31,7 @@ Usage: irb.rb [options] [programfile] [arguments] --tracer 潟潟絎茵若鴻茵. --back-trace-limit n 若壕;腓冴若鴻 n, 緇 - n茵. 16 + n茵. 16 --irb_debug n irb違違n荐絎( 鴻♂cс). -v, --version irb若吾с潟茵腓冴 diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 5a6c2894fb8bed..33479747dfe520 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -1101,7 +1101,7 @@ def identify_string_dvar @indent = 0 @indent_stack = [] @lex_state = EXPR_BEG - + loop do @continue = false prompt @@ -1120,7 +1120,7 @@ def identify_string_dvar @quoted = reserve_quoted end end - + def identify_comment @ltype = "#" diff --git a/lib/rdoc/README b/lib/rdoc/README index f183c61f8d7087..76d841a501d5f5 100644 --- a/lib/rdoc/README +++ b/lib/rdoc/README @@ -33,7 +33,7 @@ Once installed, you can create documentation using the 'rdoc' command Type "rdoc --help" for an up-to-date option summary. A typical use might be to generate documentation for a package of Ruby -source (such as rdoc itself). +source (such as rdoc itself). % rdoc @@ -68,7 +68,7 @@ you use the latter form, the =begin line must be flagged with an RDoc tag: =begin rdoc Documentation to be processed by RDoc. - + ... =end @@ -83,14 +83,14 @@ turned back on with a line that starts '+#+++'. # FIXME: fails if the birthday falls on February 29th #++ # The DOB is returned as a Time object. - + def get_dob(person) # ... end Names of classes, source files, and any method names containing an underscore or preceded by a hash character are automatically hyperlinked from comment text -to their description. +to their description. Method parameter lists are extracted and displayed with the method description. If a method calls +yield+, then the parameters passed to yield will also be @@ -109,7 +109,7 @@ after the method definition def fred # :yields: index, position # ... - + yield line, address which will get documented as @@ -128,17 +128,17 @@ after the start of the document element they are modifying. omitted. By default, though, modules and classes within that class of module _will_ be documented. This is turned off by adding the +all+ modifier. - + module MyModule # :nodoc: class Input end end - + module OtherModule # :nodoc: all class Output end end - + In the above code, only class +MyModule::Input+ will be documented. [+:doc:+] @@ -163,7 +163,7 @@ Comment blocks can contain other directives: comment block may have one or more lines before the :section: directive. These will be removed, and any identical lines at the end of the block are also removed. This allows you to add visual cues such as: - + # ---------------------------------------- # :section: My Section # This is the section that I wrote. @@ -210,7 +210,7 @@ Author:: Dave Thomas parser for irb and the rtags package. * Code to diagram classes and modules was written by Sergey A Yanovitsky - (Jah) of Enticla. + (Jah) of Enticla. * Charset patch from MoonWolf. diff --git a/lib/rdoc/generator/texinfo/texinfo.erb b/lib/rdoc/generator/texinfo/texinfo.erb index 235f63d73c1987..d13ec22a2e007f 100644 --- a/lib/rdoc/generator/texinfo/texinfo.erb +++ b/lib/rdoc/generator/texinfo/texinfo.erb @@ -22,7 +22,7 @@ @end menu <% (@v['classes'] || []).each_with_index do |klass, i| %> -<%= TexinfoTemplate.new(@v.merge('class' => klass.values), +<%= TexinfoTemplate.new(@v.merge('class' => klass.values), 'class.texinfo.erb').render %><% end %> @bye diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index 3a1e2ac872a89f..dab4366270f818 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -49,7 +49,7 @@ class Gem::Command def self.build_args @build_args ||= [] end - + def self.build_args=(value) @build_args = value end @@ -197,7 +197,7 @@ def get_one_optional_argument # def usage # "#{program_name} FILE [FILE ...]" # end - # + # # def arguments # "FILE name of file to find" # end diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb index 24314d8bf1baec..39dc4a05fdb1f3 100644 --- a/lib/rubygems/defaults.rb +++ b/lib/rubygems/defaults.rb @@ -24,7 +24,7 @@ def self.default_dir File.join(ConfigMap[:rubylibprefix], 'gems', ConfigMap[:ruby_version]) # only Ruby 1.9.1 has a peculiar feature - elsif RUBY_VERSION > '1.9' and + elsif RUBY_VERSION > '1.9' and File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems', ConfigMap[:ruby_version]) else diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index c029bbe1e91702..a2ebcb0b1703dd 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -13,7 +13,7 @@ def self.class_name def self.make(dest_path, results) unless File.exist? 'Makefile' then - raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" + raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" end mf = File.read('Makefile') diff --git a/lib/rubygems/format.rb b/lib/rubygems/format.rb index b2e7897339f90c..80aae562152079 100644 --- a/lib/rubygems/format.rb +++ b/lib/rubygems/format.rb @@ -29,7 +29,7 @@ def initialize(gem_path) end ## - # Reads the named gem file and returns a Format object, representing + # Reads the named gem file and returns a Format object, representing # the data from the gem file # # file_path:: [String] Path to the gem file diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb index 6f115293020131..50b47c42f4e8ba 100644 --- a/lib/rubygems/package/tar_writer.rb +++ b/lib/rubygems/package/tar_writer.rb @@ -229,7 +229,7 @@ def split_name(name) # :nodoc: name = newname if name.size > 100 or prefix.size > 155 then - raise Gem::Package::TooLongFileName + raise Gem::Package::TooLongFileName end end diff --git a/lib/rubygems/package_task.rb b/lib/rubygems/package_task.rb index d7f83276f838bd..e80b1eceaf253c 100644 --- a/lib/rubygems/package_task.rb +++ b/lib/rubygems/package_task.rb @@ -41,7 +41,7 @@ # # require 'rubygems' # require 'rubygems/package_task' -# +# # spec = Gem::Specification.new do |s| # s.platform = Gem::Platform::RUBY # s.summary = "Ruby based make-like utility." @@ -56,7 +56,7 @@ # and dependencies are specified in standard Ruby syntax. # EOF # end -# +# # Gem::PackageTask.new(spec) do |pkg| # pkg.need_zip = true # pkg.need_tar = true diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index bfa8fca0ffaa46..f5410cf4f7da20 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -103,7 +103,7 @@ def to_a def to_s to_a.compact.join '-' end - + def empty? to_s.empty? end diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index abf3cf4a6a76ed..5cd3fb756fa322 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -218,7 +218,7 @@ # # # signing key (still kept in an undisclosed location!) # s.signing_key = '/mnt/floppy/alf-private_key.pem' -# +# # # certificate chain (includes the issuer certificate now too) # s.cert_chain = ['/home/alf/doc/seattlerb-public_cert.pem', # '/home/alf/doc/alf_at_seattle-public_cert.pem'] @@ -274,7 +274,7 @@ # # convert a PEM format X509 certificate into DER format: # # (note: Windows .cer files are X509 certificates in DER format) # $ openssl x509 -in input.pem -outform der -out output.der -# +# # # print out the certificate in a human-readable format: # $ openssl x509 -in input.pem -noout -text # @@ -282,7 +282,7 @@ # # # convert a PEM format RSA key into DER format: # $ openssl rsa -in input_key.pem -outform der -out output_key.der -# +# # # print out the key in a human readable format: # $ openssl rsa -in input_key.pem -noout -text # diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb index c616aefcc05503..9485367c7179ce 100644 --- a/lib/rubygems/source_index.rb +++ b/lib/rubygems/source_index.rb @@ -408,7 +408,7 @@ def update(source_uri, all) end def ==(other) # :nodoc: - self.class === other and @gems == other.gems + self.class === other and @gems == other.gems end def dump diff --git a/lib/rubygems/source_info_cache.rb b/lib/rubygems/source_info_cache.rb index fdb30ad8d313ff..4289cdb52acb0b 100644 --- a/lib/rubygems/source_info_cache.rb +++ b/lib/rubygems/source_info_cache.rb @@ -286,7 +286,7 @@ def search(pattern, platform_only = false, all = false) next unless Gem.sources.include? source_uri # TODO - Remove this gunk after 2008/11 unless pattern.kind_of?(Gem::Dependency) - pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) + pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) end sic_entry.source_index.search pattern, platform_only end.flatten.compact @@ -306,7 +306,7 @@ def search_with_source(pattern, only_platform = false, all = false) # TODO - Remove this gunk after 2008/11 unless pattern.kind_of?(Gem::Dependency) - pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) + pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) end sic_entry.source_index.search(pattern, only_platform).each do |spec| diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb index f46c355413324f..653aac58fe2447 100644 --- a/lib/rubygems/spec_fetcher.rb +++ b/lib/rubygems/spec_fetcher.rb @@ -183,7 +183,7 @@ def list(all = false, prerelease = false) cache = { :latest => @latest_specs, :prerelease => @prerelease_specs, :all => @specs }[type] - + Gem.sources.each do |source_uri| source_uri = URI.parse source_uri diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb index 8b23d3236e0171..85541c9fc3465a 100644 --- a/lib/rubygems/test_utilities.rb +++ b/lib/rubygems/test_utilities.rb @@ -11,9 +11,9 @@ # @fetcher = Gem::FakeFetcher.new # @fetcher.data['http://gems.example.com/yaml'] = source_index.to_yaml # Gem::RemoteFetcher.fetcher = @fetcher -# +# # # invoke RubyGems code -# +# # paths = @fetcher.paths # assert_equal 'http://gems.example.com/yaml', paths.shift # assert paths.empty?, paths.join(', ') diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb index 9bccc605b58551..f568227b9a54e5 100644 --- a/lib/rubygems/validator.rb +++ b/lib/rubygems/validator.rb @@ -15,7 +15,7 @@ Gem.activate('test-unit') rescue Gem::LoadError # Ignore - use the test-unit library that's part of the standard library -end +end ## # Validator performs various gem file and gem database validation diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb index 7c49a34a735e86..f9594298463efd 100644 --- a/lib/rubygems/version.rb +++ b/lib/rubygems/version.rb @@ -166,7 +166,7 @@ def version=(version) def prerelease? parts.any? { |part| part.alpha? } end - + ## # The release for this version (e.g. 1.2.0.a -> 1.2.0) # Non-prerelease versions return themselves diff --git a/lib/tracer.rb b/lib/tracer.rb index a0b4fdf133d45a..e4ce24b24a18d1 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -1,11 +1,11 @@ -# tracer.rb - +# tracer.rb - # $Release Version: 0.3$ # $Revision: 1.12 $ # by Keiju ISHITSUKA(keiju@ishitsuka.com) # # -- # -# +# # require "thread" @@ -136,7 +136,7 @@ def trace_func(event, file, line, id, binding, klass, *) return unless p.call event, file, line, id, binding, klass end - return unless Tracer::display_c_call? or + return unless Tracer::display_c_call? or event != "c-call" && event != "c-return" Tracer::stdout_mutex.synchronize do @@ -151,7 +151,7 @@ def trace_func(event, file, line, id, binding, klass, *) printf("%s:%d:%s:%s: %s", file, line, - klass || '', + klass || '', EVENT_SYMBOL[event], source) end @@ -190,6 +190,6 @@ def Tracer.add_filter(p = proc) ARGV.shift Tracer.on require $0 -elsif caller.size <= 1 +elsif caller.size <= 1 Tracer.on end diff --git a/lib/xmlrpc/README.rdoc b/lib/xmlrpc/README.rdoc index 221d675219fe88..2faed28cb9f91b 100644 --- a/lib/xmlrpc/README.rdoc +++ b/lib/xmlrpc/README.rdoc @@ -59,7 +59,7 @@ use the client and implement a server. * REXML (REXMLStreamParser) * xml-scan (XMLScanStreamParser) * Fastest parser is Expat's XMLStreamParser! - + * General * possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers * Marshalling Ruby objects to Hashs and reconstruct them later from a Hash @@ -70,7 +70,7 @@ use the client and implement a server. === Client require "xmlrpc/client" - + # Make an object to represent the XML-RPC server. server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php") @@ -86,7 +86,7 @@ use the client and implement a server. There are two possible ways, of handling a fault-structure: -==== by catching a XMLRPC::FaultException exception +==== by catching a XMLRPC::FaultException exception require "xmlrpc/client" @@ -107,7 +107,7 @@ There are two possible ways, of handling a fault-structure: puts e.faultCode puts e.faultString end - + ==== by calling "call2" which returns a boolean require "xmlrpc/client" @@ -128,7 +128,7 @@ There are two possible ways, of handling a fault-structure: puts result.faultCode puts result.faultString end - + === Client using Proxy You can create a +Proxy+ object onto which you can call methods. This way it @@ -137,7 +137,7 @@ looks nicer. Both forms, _call_ and _call2_ are supported through _proxy_ and given to each XML-RPC call using that Proxy. require "xmlrpc/client" - + # Make an object to represent the XML-RPC server. server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php") @@ -167,7 +167,7 @@ can be mixed: s.add_handler("sample.sumAndDifference") do |a,b| { "sum" => a + b, "difference" => a - b } end - + s.serve ==== Java-like (handler classes) @@ -181,8 +181,8 @@ can be mixed: { "sum" => a + b, "difference" => a - b } end end - - # NOTE: Security Hole (read below)!!! + + # NOTE: Security Hole (read below)!!! s.add_handler("sample", MyHandler.new) s.serve @@ -195,17 +195,17 @@ To return a fault-structure you have to raise an FaultException e.g.: From Brian Candler: - Above code sample has an extremely nasty security hole, in that you can now call - any method of 'MyHandler' remotely, including methods inherited from Object - and Kernel! For example, in the client code, you can use - - puts server.call("sample.send","`","ls") - - (backtick being the method name for running system processes). Needless to - say, 'ls' can be replaced with something else. - - The version which binds proc objects (or the version presented below in the next section) - doesn't have this problem, but people may be tempted to use the second version because it's + Above code sample has an extremely nasty security hole, in that you can now call + any method of 'MyHandler' remotely, including methods inherited from Object + and Kernel! For example, in the client code, you can use + + puts server.call("sample.send","`","ls") + + (backtick being the method name for running system processes). Needless to + say, 'ls' can be replaced with something else. + + The version which binds proc objects (or the version presented below in the next section) + doesn't have this problem, but people may be tempted to use the second version because it's so nice and 'Rubyesque'. I think it needs a big red disclaimer. @@ -225,7 +225,7 @@ A solution is to undef insecure methods or to use (({XMLRPC::iPIMethods})) as sh # ... -This adds only public instance methods explicitly declared in class MyHandler +This adds only public instance methods explicitly declared in class MyHandler (and not those inherited from any other class). ==== With interface declarations @@ -271,7 +271,7 @@ XML parser, then you have to call the set_parser method of XMLRPC::BasicServer or by editing xmlrpc/config.rb. Client Example: - + # ... server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php") server.set_parser(XMLRPC::XMLParser::XMLParser.new) @@ -283,7 +283,7 @@ Server Example: s = XMLRPC::CGIServer.new s.set_parser(XMLRPC::XMLParser::XMLStreamParser.new) # ... - + or: # ... diff --git a/man/erb.1 b/man/erb.1 index 87a0a6fca4073d..ac1624d5fa06d8 100644 --- a/man/erb.1 +++ b/man/erb.1 @@ -18,11 +18,11 @@ .Pp .Sh DESCRIPTION .Nm -is a command line front-end for +is a command line front-end for .Li "ERB" library, which is an implementation of eRuby. -eRuby provdes an easy to use but powerful templating system for Ruby. +eRuby provdes an easy to use but powerful templating system for Ruby. Using eRuby, actual Ruby code can be added to any plain text document for the purposes of generating document information details and/or flow control. @@ -34,7 +34,7 @@ is a part of .Bl -tag -width "1234567890123" -compact .Pp .It Fl -version -Prints the version of +Prints the version of .Nm . .Pp .It Fl E Ar external Ns Op : Ns Ar internal @@ -45,7 +45,7 @@ You can ommit the one for internal encodings, then the value .Pf ( Li "Encoding.default_internal" ) will be nil. .Pp .It Fl P -Evaluates lines starting with +Evaluates lines starting with .Li "%" as Ruby code and removes the tailing EOLs. .Pp @@ -53,7 +53,7 @@ as Ruby code and removes the tailing EOLs. Specifies the safe level in which eRuby script will run. .Pp .It Fl T Ar mode -Specifies trim mode (default 0). +Specifies trim mode (default 0). .Ar mode can be one of .Bl -hang -offset indent @@ -96,10 +96,10 @@ Prints a summry of the options. .It Fl n Used with .Fl x . -Prepends the line number to each line in the output. +Prepends the line number to each line in the output. .Pp .It Fl v -Enables verbose mode. +Enables verbose mode. .Li "$VERBOSE" will be set to true. .Pp @@ -135,16 +135,16 @@ prints .Sh SEE ALSO .Xr ruby 1 . -And see +And see .Xr ri 1 -documentation for +documentation for .Li "ERB" class. .El .Pp .Sh REPORTING BUGS .Bl -bullet -.Li Security vulnerabilities should be reported via an email to +.Li Security vulnerabilities should be reported via an email to .Aq security@ruby-lang.org Ns .Li . Reported problems will be published after fixed. diff --git a/man/irb.1 b/man/irb.1 index 20e97e32f70384..d7c0f1e643028b 100644 --- a/man/irb.1 +++ b/man/irb.1 @@ -62,7 +62,7 @@ Sets to true. .Pp .It Fl f -Suppresses read of +Suppresses read of .Pa ~/.irbrc . .Pp .It Fl h @@ -93,9 +93,9 @@ Doesn't use Readline extension module. Switch prompt mode. Pre-defined prompt modes are `default', `simple', `xmp' and `inf-ruby'. .Pp -.It Fl -inf-ruby-mode -Uses prompt appropriate for inf-ruby-mode on emacs. -Suppresses --readline. +.It Fl -inf-ruby-mode +Uses prompt appropriate for inf-ruby-mode on emacs. +Suppresses --readline. .Pp .It Fl -simple-prompt Makes prompts simple. @@ -111,7 +111,7 @@ Displays backtrace top .Ar n and tail .Ar n Ns . -The default value is 16. +The default value is 16. .Pp .It Fl -irb_debug Ar n Sets internal debug level to n (not for popular use) @@ -152,14 +152,14 @@ Personal irb initialization. .Dl :ok .Dl => :ok .Dl irb(main):009:0> Ic quit -.Dl % +.Dl % .Pp .Sh SEE ALSO .Xr ruby 1 . .Pp .Sh REPORTING BUGS .Bl -bullet -.Li Security vulnerabilities should be reported via an email to +.Li Security vulnerabilities should be reported via an email to .Aq security@ruby-lang.org Ns .Li . Reported problems will be published after fixed. diff --git a/man/rake.1 b/man/rake.1 index 3872026bf1917d..9257d72d516319 100644 --- a/man/rake.1 +++ b/man/rake.1 @@ -22,9 +22,9 @@ .Ar target ... .Sh DESCRIPTION .Nm Rake -is a simple +is a simple .Xr ruby 1 -build program with capabilities similar to the regular +build program with capabilities similar to the regular .Xr make 1 command. @@ -32,7 +32,7 @@ command. has the following features: .Bl -bullet .It -Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax. +Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?). .It Users can specify tasks with prerequisites. @@ -41,7 +41,7 @@ Rake supports rule patterns to sythesize implicit tasks. .It Flexible FileLists that act like arrays but know about manipulating file names and paths. .It -A library of prepackaged tasks to make building rakefiles easier. +A library of prepackaged tasks to make building rakefiles easier. .El .Pp .Sh OPTIONS @@ -56,7 +56,7 @@ Put Task and FileTask in the top level namespace .Pp .It Fl D Op Ar PATTERN .It Fl -describe Op Ar PATTERN -Describe the tasks (matching optional +Describe the tasks (matching optional .Ar PATTERN Ns ), then exit. .Pp @@ -71,7 +71,7 @@ Use standard project Rakefile search paths, ignore system wide rakefiles. .Pp .It Fl I Ar LIBDIR .It Fl -libdir Ar LIBDIR -Include +Include .Ar LIBDIR in the search path for required modules. .Pp @@ -89,7 +89,7 @@ Display the tasks and dependencies, then exit. .It Fl -rakelibdir Ar RAKELIBDIR Auto-import any .rake files in .Ar RAKELIBDIR . -(default is +(default is .Pa rakelib ) .Pp @@ -113,7 +113,7 @@ Prints a summary of options. .Pp .It Fl g .It Fl -system -Using system wide (global) rakefiles (usually +Using system wide (global) rakefiles (usually .Pa ~/.rake/*.rake ). .Pp @@ -135,7 +135,7 @@ Require MODULE before executing rakefile. .Pp .It Fl s .It Fl -silent -Like +Like .Fl -quiet , but also suppresses the 'in directory' announcement. .Pp @@ -158,12 +158,12 @@ Trace the rules resolution. .Pp http://rake.rubyforge.org/ .Sh REPORTING BUGS -Bugs, features requests and other issues can be logged at +Bugs, features requests and other issues can be logged at <\fBhttp://onestepback.org/redmine/projects/show/rake\fR>. .Pp You will need an account to before you can post issues. Register at <\fBhttp://onestepback.org/redmine/account/register\fR>. Or you can send an email to the author. .Sh AUTHOR .Nm Rake -is written by +is written by .An Jim Weirich Aq jim@weirichhouse.org diff --git a/man/ri.1 b/man/ri.1 index f414adb55917b5..be12b5ac4fb261 100644 --- a/man/ri.1 +++ b/man/ri.1 @@ -4,7 +4,7 @@ .Os UNIX .Sh NAME .Nm ri -.Nd Ruby API reference front end +.Nd Ruby API reference front end .Sh SYNOPSIS .Nm .Op Fl Ti @@ -18,7 +18,7 @@ .Op Ar target ... .Sh DESCRIPTION .Nm -is a CUI front end for the Ruby API reference. +is a CUI front end for the Ruby API reference. You can search and read API reference for classes and methods with .Nm . @@ -61,7 +61,7 @@ ri compact\! .Bl -tag -width "1234567890123" -compact .Pp .It Fl -version -Prints the version of +Prints the version of .Nm . .Pp .It Fl T @@ -84,7 +84,7 @@ pager or tell the pager to allow control characters. .Pp .It Fl i .It Fl -interactive -This makes +This makes .Nm go into interactive mode. .Pp @@ -104,7 +104,7 @@ Do not include documentation from the Ruby standard library, installed gems, or .Pa ~/.rdoc . -Equivalent to specifying the options +Equivalent to specifying the options .Fl -no-system , Fl -no-site , Fl -no-gems , and .Fl -no-home . @@ -122,7 +122,7 @@ Include documentation from RubyGems. Defaults to true. Include documentation stored in ~/.rdoc. Defaults to true. .Pp .It Fl - Ns Oo Cm no- Oc Ns Cm use-cache -Whether or not to use +Whether or not to use .Nm Ns .Ns 's cache. True by default. .Pp @@ -165,7 +165,7 @@ Searches user-wide documents here. .Pp .Sh REPORTING BUGS .Bl -bullet -.Li Security vulnerabilities should be reported via an email to +.Li Security vulnerabilities should be reported via an email to .Aq security@ruby-lang.org Ns .Li . Reported problems will be published after fixed. diff --git a/man/ruby.1 b/man/ruby.1 index e2d0abdefd3990..22ebc67ec33b3e 100644 --- a/man/ruby.1 +++ b/man/ruby.1 @@ -95,7 +95,7 @@ Ruby has a bunch of text processing features like in Perl. .Pp .It Sy "M17N, character set independent" Ruby supports multilingualized programming. Easy to process texts -written in many different natural languages and encoded in many +written in many different natural languages and encoded in many different character encodings, without dependence on Unicode. .Pp .It Sy "Bignums" @@ -177,7 +177,7 @@ will be added to the load-path variable Specifies KANJI (Japanese) encoding. The default value for script encodings .Pf ( Li "__ENCODING__" ) and external encodings ( Li "Encoding.default_external" ) will be the specified one. .Ar kcode -can be one of +can be one of .Bl -hang -offset indent .It Sy e EUC-JP @@ -213,7 +213,7 @@ Sets the defalut value for internal encodings .Pf ( Li "Encoding.default_internal" ) to UTF-8. .Pp .It Fl W Ns Op Ar level -Turns on verbose mode at the specified level, without printing version +Turns on verbose mode at the specified level, without printing version message at the beginning. The level can be; .Bl -hang -offset indent .It Sy 0 @@ -406,7 +406,7 @@ Disables (or enables) all features. .El .Pp .It Fl -dump Ns = Ns Ar target -DO NOT USE. +DO NOT USE. Prints the specified target. .Ar target @@ -494,7 +494,7 @@ Ruby Application Archive. .Pp .Sh REPORTING BUGS .Bl -bullet -.Li Security vulnerabilities should be reported via an email to +.Li Security vulnerabilities should be reported via an email to .Aq security@ruby-lang.org Ns .Li . Reported problems will be published after fixed. diff --git a/misc/inf-ruby.el b/misc/inf-ruby.el index 6b5d74c3048fb0..c27fb635de5444 100644 --- a/misc/inf-ruby.el +++ b/misc/inf-ruby.el @@ -10,7 +10,7 @@ ;;; ;;; (0) check ruby-program-name variable that can run your environment. ;;; -;;; (1) modify .emacs to use ruby-mode +;;; (1) modify .emacs to use ruby-mode ;;; for example : ;;; ;;; (autoload 'ruby-mode "ruby-mode" @@ -19,7 +19,7 @@ ;;; (append '(("\\.rb$" . ruby-mode)) auto-mode-alist)) ;;; (setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) ;;; interpreter-mode-alist)) -;;; +;;; ;;; (2) set to load inf-ruby and set inf-ruby key definition in ruby-mode. ;;; ;;; (autoload 'run-ruby "inf-ruby" @@ -49,47 +49,47 @@ ;;; Revision 1.6 2002/09/07 14:35:46 nobu ;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp ;;; alist for error message from ruby. -;;; +;;; ;;; * misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs. -;;; +;;; ;;; * misc/inf-ruby.el (ruby-send-region): compilation-parse-errors ;;; doesn't parse first line, so insert separators before each ;;; evaluations. -;;; +;;; ;;; Revision 1.5 2002/08/19 10:05:47 nobu ;;; * misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition ;;; conflicted with ruby-insert-end. -;;; +;;; ;;; * misc/inf-ruby.el (inferior-ruby-mode): compilation-minor-mode. -;;; +;;; ;;; * misc/inf-ruby.el (ruby-send-region): send as here document to ;;; adjust source file/line. [ruby-talk:47113], [ruby-dev:17965] -;;; +;;; ;;; * misc/inf-ruby.el (ruby-send-terminator): added to make unique ;;; terminator. -;;; +;;; ;;; Revision 1.4 2002/01/29 07:16:09 matz ;;; * file.c (rb_stat_rdev_major): added. [new] -;;; +;;; ;;; * file.c (rb_stat_rdev_minor): added. [new] -;;; +;;; ;;; * file.c (rb_stat_inspect): print mode in octal. -;;; +;;; ;;; Revision 1.3 1999/12/01 09:24:18 matz ;;; 19991201 -;;; +;;; ;;; Revision 1.2 1999/08/13 05:45:18 matz ;;; 1.4.0 -;;; +;;; ;;; Revision 1.1.1.1.2.1 1999/07/15 07:59:59 matz ;;; 990715 -;;; +;;; ;;; Revision 1.1.1.1 1999/01/20 04:59:36 matz ;;; ruby 1.3 cycle -;;; +;;; ;;; Revision 1.1.2.1 1998/12/16 07:30:36 matz ;;; first public release of 1.1d (pre1.2) series -;;; +;;; ;;; Revision 1.4 1998/05/20 02:45:58 senda ;;; default program to irb ;;; @@ -196,7 +196,7 @@ For information on running multiple processes in multiple buffers, see documentation for variable ruby-buffer. Commands: -Return after the end of the process' output sends the text from the +Return after the end of the process' output sends the text from the end of process to point. Return before the end of the process' output copies the sexp ending at point to the end of the process' output, and sends it. @@ -358,14 +358,14 @@ Then switch to the process buffer." (switch-to-ruby t)) (defun ruby-send-definition-and-go () - "Send the current definition to the inferior Ruby. + "Send the current definition to the inferior Ruby. Then switch to the process buffer." (interactive) (ruby-send-definition) (switch-to-ruby t)) (defun ruby-send-block-and-go () - "Send the current block to the inferior Ruby. + "Send the current block to the inferior Ruby. Then switch to the process buffer." (interactive) (ruby-send-block) @@ -380,13 +380,13 @@ Used by these commands to determine defaults.") (defvar ruby-prev-l/c-dir/file nil "Caches the last (directory . file) pair. Caches the last pair used in the last ruby-load-file command. -Used for determining the default in the +Used for determining the default in the next one.") (defun ruby-load-file (file-name) "Load a Ruby file into the inferior Ruby process." (interactive (comint-get-source "Load Ruby file: " ruby-prev-l/c-dir/file - ruby-source-modes t)) ; T because LOAD + ruby-source-modes t)) ; T because LOAD ; needs an exact name (comint-check-source file-name) ; Check to see if buffer needs saved. (setq ruby-prev-l/c-dir/file (cons (file-name-directory file-name) @@ -408,7 +408,7 @@ next one.") (defvar inf-ruby-load-hook nil "This hook is run when inf-ruby is loaded in. This is a good place to put keybindings.") - + (run-hooks 'inf-ruby-load-hook) (provide 'inf-ruby) diff --git a/misc/rdoc-mode.el b/misc/rdoc-mode.el index d04af491567669..9d1c7d2f9479cc 100644 --- a/misc/rdoc-mode.el +++ b/misc/rdoc-mode.el @@ -1,7 +1,7 @@ ;; ;; rdoc-mode.el ;; Major mode for RDoc editing -;; +;; ;; Created: Fri Sep 18 09:04:49 JST 2009 @@ -15,7 +15,7 @@ (setq paragraph-separate "^\\(=+\\|\\*+\\)\\s \\|^\\s *$") (make-local-variable 'paragraph-start) (setq paragraph-start paragraph-separate) - (make-local-variable 'require-final-newline) + (make-local-variable 'require-final-newline) (setq require-final-newline t) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '((rdoc-font-lock-keywords) t nil)) diff --git a/misc/ruby-electric.el b/misc/ruby-electric.el index 174bd00fd9c7b5..83058b1c81fdac 100644 --- a/misc/ruby-electric.el +++ b/misc/ruby-electric.el @@ -52,7 +52,7 @@ (defgroup ruby-electric nil "Minor mode providing electric editing commands for ruby files" - :group 'ruby) + :group 'ruby) (defconst ruby-electric-expandable-do-re "do\\s-$") @@ -85,7 +85,7 @@ inserted. The word 'all' will do all insertions." (const :tag "Double quote" ?\" ) (const :tag "Back quote" ?\` ) (const :tag "Vertical bar" ?\| )) - :group 'ruby-electric) + :group 'ruby-electric) (defcustom ruby-electric-newline-before-closing-bracket nil "*Controls whether a newline should be inserted before the @@ -142,13 +142,13 @@ strings. Note that you must have Font Lock enabled." (defun ruby-electric-is-last-command-char-expandable-punct-p() (or (memq 'all ruby-electric-expand-delimiters-list) - (memq last-command-char ruby-electric-expand-delimiters-list))) + (memq last-command-char ruby-electric-expand-delimiters-list))) (defun ruby-electric-space-can-be-expanded-p() (if (ruby-electric-code-at-point-p) - (let* ((ruby-electric-keywords-re + (let* ((ruby-electric-keywords-re (concat ruby-electric-simple-keywords-re "\\s-$")) - (ruby-electric-single-keyword-in-line-re + (ruby-electric-single-keyword-in-line-re (concat "\\s-*" ruby-electric-keywords-re))) (save-excursion (backward-word 1) @@ -183,7 +183,7 @@ strings. Note that you must have Font Lock enabled." (and (ruby-electric-is-last-command-char-expandable-punct-p) (ruby-electric-code-at-point-p) (save-excursion - (insert (cdr (assoc last-command-char + (insert (cdr (assoc last-command-char ruby-electric-matching-delimeter-alist)))))) (defun ruby-electric-bar(arg) @@ -193,7 +193,7 @@ strings. Note that you must have Font Lock enabled." (ruby-electric-code-at-point-p) (and (save-excursion (re-search-backward ruby-electric-expandable-bar nil t)) (= (point) (match-end 0))) ;looking-back is missing on XEmacs - (save-excursion + (save-excursion (insert "|")))) diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 70acd7266be712..0ccb90261ff831 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -520,7 +520,7 @@ The variable ruby-indent-level controls the amount of indentation. (t (setq in-string (point)) (goto-char end)))) - ((looking-at "/=") + ((looking-at "/=") (goto-char pnt)) ((looking-at "/") (cond @@ -775,7 +775,7 @@ The variable ruby-indent-level controls the amount of indentation. (setq indent (ruby-indent-size (current-column) (nth 2 state)))) (t (setq indent (+ (current-column) ruby-indent-level))))) - + ((and (nth 2 state) (< (nth 2 state) 0)) ; in negative nest (setq indent (ruby-indent-size (current-column) (nth 2 state))))) (when indent @@ -1111,7 +1111,7 @@ balanced expression is found." (concat "^[ \t]*\\(def\\|class\\|module\\)[ \t]+" "\\(" ;; \\. and :: for class method - "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)" + "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)" "+\\)") nil t) (progn diff --git a/misc/rubydb2x.el b/misc/rubydb2x.el index a74265fb0e8715..e183b30b78337d 100644 --- a/misc/rubydb2x.el +++ b/misc/rubydb2x.el @@ -22,27 +22,27 @@ (save-match-data (setq gud-marker-acc (concat gud-marker-acc string)) (let ((output "")) - + ;; Process all the complete markers in this chunk. (while (string-match "\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n" gud-marker-acc) (setq - + ;; Extract the frame position from the marker. gud-last-frame (cons (substring gud-marker-acc (match-beginning 1) (match-end 1)) (string-to-int (substring gud-marker-acc (match-beginning 2) (match-end 2)))) - + ;; Append any text before the marker to the output we're going ;; to return - we don't include the marker in this text. output (concat output (substring gud-marker-acc 0 (match-beginning 0))) - + ;; Set the accumulator to the remaining text. gud-marker-acc (substring gud-marker-acc (match-end 0)))) - + ;; Does the remaining text look like it might end with the ;; beginning of another marker? If it does, then keep it in ;; gud-marker-acc until we receive the rest of it. Since we @@ -53,16 +53,16 @@ ;; Everything before the potential marker start can be output. (setq output (concat output (substring gud-marker-acc 0 (match-beginning 0)))) - + ;; Everything after, we save, to combine with later input. (setq gud-marker-acc (substring gud-marker-acc (match-beginning 0)))) - + (setq output (concat output gud-marker-acc) gud-marker-acc "")) - + output))) - + (defun gud-rubydb-find-file (f) (find-file-noselect f)) diff --git a/missing/alloca.c b/missing/alloca.c index 620eef12e5d3cb..68323af41c8a53 100644 --- a/missing/alloca.c +++ b/missing/alloca.c @@ -6,7 +6,7 @@ This implementation of the PWB library alloca() function, which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, + that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. It should work under any C implementation that uses an diff --git a/missing/flock.c b/missing/flock.c index b02f8bf832cd1c..763c49d6751745 100644 --- a/missing/flock.c +++ b/missing/flock.c @@ -27,7 +27,7 @@ int flock(int fd, int operation) { struct flock lock; - + switch (operation & ~LOCK_NB) { case LOCK_SH: lock.l_type = F_RDLCK; @@ -44,7 +44,7 @@ flock(int fd, int operation) } lock.l_whence = SEEK_SET; lock.l_start = lock.l_len = 0L; - + return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &lock); } diff --git a/missing/isinf.c b/missing/isinf.c index 4aef51b213d365..55187adc630702 100644 --- a/missing/isinf.c +++ b/missing/isinf.c @@ -27,7 +27,7 @@ isinf(double n) #include #endif -/* +/* * isinf may be provided only as a macro. * ex. HP-UX, Solaris 10 * http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html diff --git a/missing/langinfo.c b/missing/langinfo.c index 6373afd0f5e58a..2c446982aa323d 100644 --- a/missing/langinfo.c +++ b/missing/langinfo.c @@ -64,7 +64,7 @@ nl_langinfo_codeset(void) { const char *l, *p; int n; - + if (((l = getenv("LC_ALL")) && *l) || ((l = getenv("LC_CTYPE")) && *l) || ((l = getenv("LANG")) && *l)) { diff --git a/missing/os2.c b/missing/os2.c index 3448cdc281b1c3..27dc2f19644af1 100644 --- a/missing/os2.c +++ b/missing/os2.c @@ -94,14 +94,14 @@ char *cmd; if (*s == '=') goto doshell; */ for (s = cmd; *s; s++) { - if (*sw == '-' && *s != ' ' && + if (*sw == '-' && *s != ' ' && !isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) { if (*s == '\n' && !s[1]) { *s = '\0'; break; } goto doshell; - } else if (*sw == '/' && *s != ' ' && + } else if (*sw == '/' && *s != ' ' && !isalpha(*s) && index("^()<>|&\n",*s)) { if (*s == '\n' && !s[1]) { *s = '\0'; diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c index 5718362fed0254..6f95f4952136f0 100644 --- a/missing/vsnprintf.c +++ b/missing/vsnprintf.c @@ -37,7 +37,7 @@ * paragraph 3 above is now null and void. */ -/* SNPRINTF.C +/* SNPRINTF.C * fjc 7-31-97 Modified by Mib Software to be a standalone snprintf.c module. * http://www.mibsoftware.com * Mib Software does not warrant this software any differently than the @@ -50,7 +50,7 @@ * allow inclusion into libraries with less chance of namespace collisions. * * snprintf should be the only externally visible item. - * + * * As of 7-31-97 FLOATING_POINT is NOT provided. The code is somewhat * non-portable, so it is disabled. */ @@ -84,7 +84,7 @@ # endif # include #endif -#ifndef _BSD_VA_LIST_ +#ifndef _BSD_VA_LIST_ #define _BSD_VA_LIST_ va_list #endif @@ -410,7 +410,7 @@ BSD__uqtoa(register u_quad_t val, char *endp, int base, int octzero, const char break; default: /* oops */ - /* + /* abort(); */ break; /* fjc 7-31-97. Don't reference abort() here */ @@ -475,7 +475,7 @@ BSD__ultoa(register u_long val, char *endp, int base, int octzero, const char *x break; default: /* oops */ - /* + /* abort(); */ break; /* fjc 7-31-97. Don't reference abort() here */ @@ -821,7 +821,7 @@ fp_begin: _double = va_arg(ap, double); ch = (ch == 'g') ? 'e' : 'E'; else ch = 'g'; - } + } if (ch <= 'e') { /* 'e' or 'E' fmt */ --expt; expsize = exponent(expstr, expt, ch); diff --git a/object.c b/object.c index 6dcd94740db6e9..9cfe6628f71edf 100644 --- a/object.c +++ b/object.c @@ -2149,7 +2149,7 @@ rb_Integer(VALUE val) * when base is omitted or equals to zero, radix indicators * (0, 0b, and 0x) are honored. * In any case, strings should be strictly conformed to numeric - * representation. This behavior is different from that of + * representation. This behavior is different from that of * String#to_i. Non string valueswill be converted using * to_int, and to_i. * diff --git a/proc.c b/proc.c index b7c632c856a85b..fc6f73f7c14d15 100644 --- a/proc.c +++ b/proc.c @@ -1312,7 +1312,7 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod) * * Defines a singleton method in the receiver. The _method_ * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. - * If a block is specified, it is used as the method body. + * If a block is specified, it is used as the method body. * * class A * class << self diff --git a/sample/README b/sample/README index 9187a9df2a1043..c2746c58681425 100644 --- a/sample/README +++ b/sample/README @@ -25,7 +25,7 @@ less.rb front end for less list.rb stupid object sample list2.rb stupid object sample list3.rb stupid object sample -mine.rb simple mine sweeper +mine.rb simple mine sweeper mkproto.rb extract prototype from C mpart.rb split file int multi part observ.rb observer design pattern sample diff --git a/sample/drb/README.rd b/sample/drb/README.rd index 5cf1f5191343fd..dbcac01e18638d 100644 --- a/sample/drb/README.rd +++ b/sample/drb/README.rd @@ -22,7 +22,7 @@ * dqout.rb --- client. pop DQEntry objects. * dqlib.rb --- define DQEntry -* IdConv customize demo: reference by name +* IdConv customize demo: reference by name * name.rb --- server * namec.rb --- client @@ -46,7 +46,7 @@ * drbssl * drbssl_s.rb * drbssl_c.rb - + * add DRbProtocl * http0.rb * http0serv.rb diff --git a/sample/drb/darray.rb b/sample/drb/darray.rb index 95ee01ff03746b..d2ac39513f4a6d 100644 --- a/sample/drb/darray.rb +++ b/sample/drb/darray.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Array - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/darrayc.rb b/sample/drb/darrayc.rb index b181d22699e059..579e11564e9f96 100644 --- a/sample/drb/darrayc.rb +++ b/sample/drb/darrayc.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Array client - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' @@ -19,7 +19,7 @@ puts "# find" p ro.find { |x| x.kind_of? String } - + puts "# each, break" ro.each do |x| next if x == "five" diff --git a/sample/drb/dbiff.rb b/sample/drb/dbiff.rb index 8faef50b07dce1..b50edc08982423 100644 --- a/sample/drb/dbiff.rb +++ b/sample/drb/dbiff.rb @@ -18,13 +18,13 @@ def initialize(filename, interval) def run last = Time.now while true - begin + begin sleep(@interval) current = File::mtime(@filename) if current > last changed begin - notify_observers(@filename, current) + notify_observers(@filename, current) rescue Error end last = current diff --git a/sample/drb/dchatc.rb b/sample/drb/dchatc.rb index b506f5bbba1a35..2b8ddbf4cc649b 100644 --- a/sample/drb/dchatc.rb +++ b/sample/drb/dchatc.rb @@ -1,12 +1,12 @@ =begin distributed Ruby --- chat client - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' class ChatClient - include DRbUndumped + include DRbUndumped def initialize(name) @name = name diff --git a/sample/drb/dchats.rb b/sample/drb/dchats.rb index 012dfeeebe7a42..ccb2c7c9c5d083 100644 --- a/sample/drb/dchats.rb +++ b/sample/drb/dchats.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- chat server - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'thread' require 'drb/drb' diff --git a/sample/drb/dhasen.rb b/sample/drb/dhasen.rb index fb1724afa312ca..651b9c6c8ad8c2 100644 --- a/sample/drb/dhasen.rb +++ b/sample/drb/dhasen.rb @@ -1,13 +1,13 @@ =begin distributed Ruby --- dRuby Sample Server --- chasen server - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby dhasen.rb + | % ruby dhasen.rb | druby://yourhost:7640 Terminal 2 diff --git a/sample/drb/dhasenc.rb b/sample/drb/dhasenc.rb index 2774feba5a9856..44e58ce096a294 100644 --- a/sample/drb/dhasenc.rb +++ b/sample/drb/dhasenc.rb @@ -1,7 +1,7 @@ # -*- encoding: euc-jp -*- =begin distributed Ruby --- dRuby Sample Client -- chasen client - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dlogc.rb b/sample/drb/dlogc.rb index c75bc7b520ca59..3939a718271c74 100644 --- a/sample/drb/dlogc.rb +++ b/sample/drb/dlogc.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Log test - Copyright (c) 1999-2001 Masatoshi SEKI + Copyright (c) 1999-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dlogd.rb b/sample/drb/dlogd.rb index 9f9aa2fd567da2..fef7ca0f1d66dd 100644 --- a/sample/drb/dlogd.rb +++ b/sample/drb/dlogd.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Log server - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dqin.rb b/sample/drb/dqin.rb index 3ba1caa80c86b1..4751335fff7c3e 100644 --- a/sample/drb/dqin.rb +++ b/sample/drb/dqin.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- store - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dqout.rb b/sample/drb/dqout.rb index 4700e55cf7c8d6..f2b0b4ac95a952 100644 --- a/sample/drb/dqout.rb +++ b/sample/drb/dqout.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- fetch - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/dqueue.rb b/sample/drb/dqueue.rb index a5a43655fdd102..1c8878c0809899 100644 --- a/sample/drb/dqueue.rb +++ b/sample/drb/dqueue.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- Queue - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'thread' diff --git a/sample/drb/drbc.rb b/sample/drb/drbc.rb index 00132b46c83469..50a86c39e8a111 100644 --- a/sample/drb/drbc.rb +++ b/sample/drb/drbc.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- dRuby Sample Client - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/drbch.rb b/sample/drb/drbch.rb index 495ff1c3469586..07fdcd5fae1e67 100644 --- a/sample/drb/drbch.rb +++ b/sample/drb/drbch.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- dRuby Sample Client - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/drbm.rb b/sample/drb/drbm.rb index 74a15a4696ad34..3390608cd1889f 100644 --- a/sample/drb/drbm.rb +++ b/sample/drb/drbm.rb @@ -1,13 +1,13 @@ =begin multiple DRbServer - Copyright (c) 1999-2002 Masatoshi SEKI + Copyright (c) 1999-2002 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby drbm.rb + | % ruby drbm.rb | druby://yourhost:7640 druby://yourhost:7641 Terminal 2 @@ -24,7 +24,7 @@ class Hoge def initialize(s) @str = s end - + def to_s @str end diff --git a/sample/drb/drbmc.rb b/sample/drb/drbmc.rb index c654fcea05e0d1..fd191401e6d40b 100644 --- a/sample/drb/drbmc.rb +++ b/sample/drb/drbmc.rb @@ -1,6 +1,6 @@ =begin multiple DRbServer client - Copyright (c) 1999-2002 Masatoshi SEKI + Copyright (c) 1999-2002 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/drbs-acl.rb b/sample/drb/drbs-acl.rb index 151dd945d81b8c..71c4f7bf428364 100644 --- a/sample/drb/drbs-acl.rb +++ b/sample/drb/drbs-acl.rb @@ -1,13 +1,13 @@ =begin distributed Ruby --- dRuby Sample Server - Copyright (c) 1999-2000 Masatoshi SEKI + Copyright (c) 1999-2000 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby drbs.rb + | % ruby drbs.rb | druby://yourhost:7640 Terminal 2 @@ -41,7 +41,7 @@ def sample(a, b, c) acl = ACL.new(%w(deny all allow 192.168.1.* allow localhost)) - + DRb.install_acl(acl) DRb.start_service(nil, DRbEx.new) diff --git a/sample/drb/drbs.rb b/sample/drb/drbs.rb index b76e283c80c197..5a913d9918bd4b 100644 --- a/sample/drb/drbs.rb +++ b/sample/drb/drbs.rb @@ -1,13 +1,13 @@ =begin distributed Ruby --- dRuby Sample Server - Copyright (c) 1999-2000,2002 Masatoshi SEKI + Copyright (c) 1999-2000,2002 Masatoshi SEKI =end =begin How to play. Terminal 1 - | % ruby drbs.rb + | % ruby drbs.rb | druby://yourhost:7640 Terminal 2 diff --git a/sample/drb/extserv_test.rb b/sample/drb/extserv_test.rb index 83d871a6a2ab0b..2c4f485dc67b45 100644 --- a/sample/drb/extserv_test.rb +++ b/sample/drb/extserv_test.rb @@ -1,11 +1,11 @@ =begin dRuby sample - Copyright (c) 2000 Masatoshi SEKI + Copyright (c) 2000 Masatoshi SEKI = How to play * Terminal 1 - + % ruby -I. extserv_test.rb server druby://yourhost:12345 @@ -26,11 +26,11 @@ def ARGV.shift class Foo include DRbUndumped - + def initialize(str) @str = str end - + def hello(it) "#{it}: #{self}" end @@ -55,7 +55,7 @@ def to_s DRb::ExtServManager.command['itest1'] = "ruby -I. #{$0} itest1" DRb::ExtServManager.command['itest2'] = "ruby -I. #{$0} itest2" - + s = DRb::ExtServManager.new DRb.start_service(ARGV.shift, s) puts DRb.uri @@ -72,7 +72,7 @@ def to_s t2 = s.service('itest2').front puts t2 puts t1.hello(t2) - if (cmd == 'quit') + if (cmd == 'quit') s.service('itest1').stop_service s.service('itest2').stop_service end diff --git a/sample/drb/holderc.rb b/sample/drb/holderc.rb index 8dd72ebd118df5..e627916d76a844 100644 --- a/sample/drb/holderc.rb +++ b/sample/drb/holderc.rb @@ -11,7 +11,7 @@ ro = DRbObject.new(nil, there) ary = [] -10.times do +10.times do ary.push(ro.gen) end diff --git a/sample/drb/holders.rb b/sample/drb/holders.rb index 2d9974f3fc2317..293426faa5e37b 100644 --- a/sample/drb/holders.rb +++ b/sample/drb/holders.rb @@ -14,7 +14,7 @@ % ruby holderc.rb druby://yourhost:1234 =end - + require 'drb/drb' @@ -36,11 +36,11 @@ def sample(list) class DRbEx4 include DRbUndumped - + def initialize @curr = 1 end - + def gen begin @curr += 1 diff --git a/sample/drb/http0.rb b/sample/drb/http0.rb index 7649925282a7d3..d4c9f6b7fb170c 100644 --- a/sample/drb/http0.rb +++ b/sample/drb/http0.rb @@ -46,14 +46,14 @@ def initialize(uri, config) def close; end def alive?; false; end - + def send_request(ref, msg_id, *arg, &b) stream = StrStream.new @msg.send_request(stream, ref, msg_id, *arg, &b) @reply_stream = StrStream.new post(@uri, stream.buf) end - + def recv_reply @msg.recv_reply(@reply_stream) end @@ -66,7 +66,7 @@ def post(url, data) http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str| sio.write(str) if @config[:load_limit] < sio.buf.size - raise TypeError, 'too large packet' + raise TypeError, 'too large packet' end end @reply_stream = sio diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb index 100d126b8f565d..8318123fa97bc3 100644 --- a/sample/drb/http0serv.rb +++ b/sample/drb/http0serv.rb @@ -5,7 +5,7 @@ module DRb module HTTP0 - + def self.open_server(uri, config) unless /^http:/ =~ uri raise(DRbBadScheme, uri) unless uri =~ /^http:/ @@ -20,7 +20,7 @@ def initialize(config, drb) @drb = drb @queue = Queue.new end - + def do_POST(req, res) @req = req @res = res @@ -28,7 +28,7 @@ def do_POST(req, res) @res.body = @queue.pop @res['content-type'] = 'application/octet-stream;' end - + def req_body @req.body end @@ -36,7 +36,7 @@ def req_body def reply(body) @queue.push(body) end - + def close @queue.push('') end @@ -78,7 +78,7 @@ def setup_webrick(uri) s.start end end - + class ServerSide def initialize(callback, config) @callback = callback @@ -86,7 +86,7 @@ def initialize(callback, config) @msg = DRbMessage.new(@config) @req_stream = StrStream.new(@callback.req_body) end - + def close @callback.close if @callback @callback = nil diff --git a/sample/drb/name.rb b/sample/drb/name.rb index 86b478fbec54d2..9527d4776479eb 100644 --- a/sample/drb/name.rb +++ b/sample/drb/name.rb @@ -1,12 +1,12 @@ =begin distributed Ruby --- NamedObject Sample - Copyright (c) 2000-2001 Masatoshi SEKI + Copyright (c) 2000-2001 Masatoshi SEKI =end =begin How to play. -* start server +* start server Terminal 1 | % ruby name.rb druby://yourhost:7640 | druby://yourhost:7640 @@ -28,9 +28,9 @@ | druby://yourhost:7640 | [return] to exit -* continue client +* continue client Terminal 2 - type [return] + type [return] | 1 | 2 =end @@ -44,7 +44,7 @@ module DRbNamedObject def drb_name=(name) @drb_name = name - Thread.exclusive do + Thread.exclusive do raise(IndexError, name) if DRbNAMEDICT[name] DRbNAMEDICT[name] = self end @@ -62,7 +62,7 @@ def to_obj(ref) def to_id(obj) if obj.kind_of? DRbNamedObject - return obj.drb_name + return obj.drb_name else return super end @@ -98,7 +98,7 @@ def initialize @name['seq'] = seq @name['mutex'] = mutex end - + def [](k) @name[k] end @@ -108,7 +108,7 @@ def [](k) uri = ARGV.shift name_conv = DRbNamedIdConv.new - + DRb.install_id_conv(name_conv) DRb.start_service(uri, Front.new) puts DRb.uri diff --git a/sample/drb/namec.rb b/sample/drb/namec.rb index f6db6f30221906..98b9d0e532afbf 100644 --- a/sample/drb/namec.rb +++ b/sample/drb/namec.rb @@ -1,6 +1,6 @@ =begin distributed Ruby --- NamedObject Sample Client - Copyright (c) 2000-2001 Masatoshi SEKI + Copyright (c) 2000-2001 Masatoshi SEKI =end require 'drb/drb' diff --git a/sample/drb/ring_echo.rb b/sample/drb/ring_echo.rb index 0633aa839ac446..3b743cab8ee0ee 100644 --- a/sample/drb/ring_echo.rb +++ b/sample/drb/ring_echo.rb @@ -8,7 +8,7 @@ class RingEcho def initialize(name) @name = name end - + def echo(str) "#{@name}: #{str}" end diff --git a/sample/drb/speeds.rb b/sample/drb/speeds.rb index 76b4b29dba8f8f..79840594231e94 100644 --- a/sample/drb/speeds.rb +++ b/sample/drb/speeds.rb @@ -3,7 +3,7 @@ class Foo def initialize @i = 0 end - + def foo(i) @i = i i + i @@ -24,7 +24,7 @@ def foo(i) when /^druby:/ require 'drb/drb' - + DRb.start_service(uri, Foo.new) end diff --git a/sample/list2.rb b/sample/list2.rb index 914cb8996efa5e..1d71affc1b61f2 100644 --- a/sample/list2.rb +++ b/sample/list2.rb @@ -9,7 +9,7 @@ def to_s sprintf("%d@%d", @x, @y) end end - + list1 = [10, 20, Point.new(2, 3), Point.new(4, 5)] list2 = [20, Point.new(4, 5), list1] print("list1:\n", list1.join("\n"), "\n") diff --git a/sample/list3.rb b/sample/list3.rb index 1d756fdff01d16..1d9f04b71092ae 100644 --- a/sample/list3.rb +++ b/sample/list3.rb @@ -11,7 +11,7 @@ def to_s sprintf("%d@%d", @x, @y) end end - + list1 = [10, 20, Point.new(2, 3), Point.new(4, 5)] list2 = [20, Point.new(4, 5), list1] print("list1: ", list1.inspect, "\n") diff --git a/sample/openssl/certstore.rb b/sample/openssl/certstore.rb index bbc637f6683479..c0bc21bcbbb70d 100644 --- a/sample/openssl/certstore.rb +++ b/sample/openssl/certstore.rb @@ -48,7 +48,7 @@ def is_ca?(cert) case guess_cert_type(cert) when CERT_TYPE_SELF_SIGNED true - when CERT_TYPE_OTHER + when CERT_TYPE_OTHER true else false diff --git a/sample/openssl/smime_write.rb b/sample/openssl/smime_write.rb index 535b3d6685fe5d..5a5236c75073a3 100644 --- a/sample/openssl/smime_write.rb +++ b/sample/openssl/smime_write.rb @@ -20,4 +20,4 @@ rcpt = X509::Certificate.new(File::read(rcpt_file)) p7enc = PKCS7::encrypt([rcpt], smime0) -print PKCS7::write_smime(p7enc) +print PKCS7::write_smime(p7enc) diff --git a/sample/svr.rb b/sample/svr.rb index f4f29eb8e796f4..eb49ccf1700ce1 100644 --- a/sample/svr.rb +++ b/sample/svr.rb @@ -26,7 +26,7 @@ s.close socks.delete(s) # single thread gets may block whole service - elsif str = s.gets + elsif str = s.gets s.write(str) end end diff --git a/spec/README b/spec/README index 786aa5b7866252..292b551ab3e4a7 100644 --- a/spec/README +++ b/spec/README @@ -8,8 +8,8 @@ and put it into this directory. spec +-- mspec driver library for executing the specification. +-- rubyspec - +-- core specification for core libraries - | +-- array + +-- core specification for core libraries + | +-- array | +-- bignum | +-- ... | diff --git a/spec/default.mspec b/spec/default.mspec index 1d9900417160cc..f008659159f99d 100644 --- a/spec/default.mspec +++ b/spec/default.mspec @@ -2,7 +2,7 @@ load File.dirname(__FILE__) + '/rubyspec/ruby.1.9.mspec' class MSpecScript builddir = Dir.pwd srcdir = ENV['SRCDIR'] - if !srcdir and File.exist?("#{builddir}/Makefile") then + if !srcdir and File.exist?("#{builddir}/Makefile") then File.open("#{builddir}/Makefile", "r:US-ASCII") {|f| f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1 } diff --git a/template/Doxyfile.tmpl b/template/Doxyfile.tmpl index 34a42983ce998a..4792265163c171 100644 --- a/template/Doxyfile.tmpl +++ b/template/Doxyfile.tmpl @@ -31,11 +31,11 @@ CREATE_SUBDIRS = YES OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES QT_AUTOBRIEF = YES @@ -43,7 +43,7 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 -ALIASES = +ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO @@ -82,13 +82,13 @@ GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = +ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = NO SHOW_FILES = YES SHOW_NAMESPACES = YES -LAYOUT_FILE = +LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- @@ -98,22 +98,22 @@ WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.c *.h *.y *.inc RECURSIVE = YES -EXCLUDE = +EXCLUDE = EXCLUDE_SYMLINKS = YES EXCLUDE_PATTERNS = *.src doc build tmp test yarvtest lib bootstraptest spec .ext .git .svn -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = <%= "#{srcdir}/doc/images" %> -FILTER_PATTERNS = +FILTER_PATTERNS = FILTER_SOURCE_FILES = YES #--------------------------------------------------------------------------- # configuration options related to source browsing @@ -130,33 +130,33 @@ VERBATIM_HEADERS = YES # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES HTML_DYNAMIC_SECTIONS = NO GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_BUNDLE_ID = org.doxygen.Project GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = +CHM_FILE = +HHC_LOCATION = GENERATE_CHI = NO -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO GENERATE_QHP = NO -QCH_FILE = +QCH_FILE = QHP_NAMESPACE = org.doxygen.Project QHP_VIRTUAL_FOLDER = doc -QHG_LOCATION = +QHG_LOCATION = DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO @@ -171,8 +171,8 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = +EXTRA_PACKAGES = +LATEX_HEADER = PDF_HYPERLINKS = YES USE_PDFLATEX = YES LATEX_BATCHMODE = NO @@ -184,8 +184,8 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- @@ -198,8 +198,8 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = +XML_SCHEMA = +XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output @@ -211,36 +211,36 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = +TAGFILES = +GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO -MSCGEN_PATH = +MSCGEN_PATH = HIDE_UNDOC_RELATIONS = YES HAVE_DOT = <%= have_dot %> DOT_FONTNAME = FreeSans -DOT_FONTPATH = +DOT_FONTPATH = CLASS_GRAPH = NO COLLABORATION_GRAPH = NO GROUP_GRAPHS = YES @@ -254,7 +254,7 @@ GRAPHICAL_HIERARCHY = NO DIRECTORY_GRAPH = NO DOT_IMAGE_FORMAT = png DOT_PATH = -DOTFILE_DIRS = +DOTFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO @@ -262,6 +262,6 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::additions related to the search engine +# Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO diff --git a/template/yarvarch.ja b/template/yarvarch.ja index c332c208113e85..fd902073c8d04a 100644 --- a/template/yarvarch.ja +++ b/template/yarvarch.ja @@ -34,7 +34,7 @@ YARV * Compiler (compile.h, compile.c) -RpCARuby C^v^p[T\iRNode +RpCARuby C^v^p[T\iRNode f[^j YARV BYARV q B @@ -43,7 +43,7 @@ YARV Ruby Array IuWFNg YARV IuWFNgAIy hi[Aタs`BRpCAR -pCAYARV +pCAYARV ARuby C^v^|y iK[x[WRN^ゥI jB @@ -235,7 +235,7 @@ end niOjniOj2 BnAAR[hR -pCBAnubNタBK +pCBAnubNタBK throw B @@ -301,7 +301,7 @@ YARV *** threaded code -GCC C glxp direct threaded code +GCC C glxp direct threaded code タB @@ -322,7 +322,7 @@ GCC *** ubN Proc IuWFNg -ubNt\bhosubN Proc +ubNt\bhosubN Proc IuWFNgBAKv Proc IuWFNg }B @@ -377,7 +377,7 @@ YARV * Dis-Assembler (disasm.c) -YARV ヲIuWFNg YARVCore::InstructionSequence disasm +YARV ヲIuWFNg YARVCore::InstructionSequence disasm \bhBAtAZuB diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb index 05d255623a041a..3c54e8a50a5442 100644 --- a/test/erb/test_erb.rb +++ b/test/erb/test_erb.rb @@ -212,7 +212,7 @@ def test_percent %%% EOS ans = <<%0 % %%><%1 %% @@ -300,7 +300,7 @@ def test_escape def test_keep_lineno src = < % raise("lineno") @@ -316,21 +316,21 @@ def test_keep_lineno src = < -Hello, +Hello, <% x = "World%%> "%> <%= x%> EOS ans = <Hello, +%>Hello, World%> EOS assert_equal(ans, ERB.new(src, nil, '>').result) ans = < -Hello, +Hello, World%> EOS @@ -338,7 +338,7 @@ def test_keep_lineno ans = < -Hello, +Hello, World%> @@ -346,7 +346,7 @@ def test_keep_lineno assert_equal(ans, ERB.new(src).result) src = < <%= x%> @@ -381,7 +381,7 @@ def test_keep_lineno % y = 'Hello' <%- x = "World%%> "-%> -<%= x %><%- x = nil -%> +<%= x %><%- x = nil -%> <% raise("lineno") %> EOS @@ -417,19 +417,19 @@ def test_explicit <%- up = w.upcase -%> * <%= up %> <%- end -%> -KeepNewLine <%- z = nil -%> +KeepNewLine <%- z = nil -%> EOS ans = < ["temp_main"] diff --git a/test/rake/in_environment.rb b/test/rake/in_environment.rb index f0a340fac9a6e4..f6fd8fb73111ca 100644 --- a/test/rake/in_environment.rb +++ b/test/rake/in_environment.rb @@ -1,11 +1,11 @@ module InEnvironment private - + # Create an environment for a test. At the completion of the yielded # block, the environment is restored to its original conditions. def in_environment(settings) original_settings = set_env(settings) - yield + yield ensure set_env(original_settings) if original_settings end diff --git a/test/rake/test_application.rb b/test/rake/test_application.rb index 77f9859b242221..3818d2a3bd3c13 100644 --- a/test/rake/test_application.rb +++ b/test/rake/test_application.rb @@ -123,7 +123,7 @@ def test_not_finding_rakefile def test_load_rakefile in_environment("PWD" => File.join(BASEDIR, "data/unittest")) do - @app.instance_eval do + @app.instance_eval do handle_options options.silent = true load_rakefile @@ -151,8 +151,8 @@ def test_load_rakefile_not_found handle_options options.silent = true end - ex = assert_raise(RuntimeError) do - @app.instance_eval do raw_load_rakefile end + ex = assert_raise(RuntimeError) do + @app.instance_eval do raw_load_rakefile end end assert_match(/no rakefile found/i, ex.message) end @@ -313,7 +313,7 @@ def teardown RakeFileUtils.verbose_flag = false RakeFileUtils.nowrite_flag = false end - + def clear_argv while ! ARGV.empty? ARGV.pop @@ -519,7 +519,7 @@ def test_version assert_equal :exit, @exit end end - + def test_classic_namespace flags(['--classic-namespace'], ['-C', '-T', '-P', '-n', '-s', '-t']) do |opts| assert opts.classic_namespace @@ -534,7 +534,7 @@ def test_classic_namespace def test_bad_option capture_stderr do ex = assert_raise(OptionParser::InvalidOption) do - flags('--bad-option') + flags('--bad-option') end if ex.message =~ /^While/ # Ruby 1.9 error message assert_match(/while parsing/i, ex.message) @@ -549,12 +549,12 @@ def test_task_collection command_line("a", "b") assert_equal ["a", "b"], @tasks.sort end - + def test_default_task_collection command_line() assert_equal ["default"], @tasks end - + def test_environment_definition ENV.delete('TESTKEY') command_line("a", "TESTKEY=12") @@ -562,12 +562,12 @@ def test_environment_definition assert '12', ENV['TESTKEY'] end - private + private def flags(*sets) sets.each do |set| ARGV.clear - @out = capture_stdout { + @out = capture_stdout { @exit = catch(:system_exit) { opts = command_line(*set) } } yield(@app.options) if block_given? @@ -593,31 +593,31 @@ class Rake::TestTaskArgumentParsing < Test::Unit::TestCase def setup @app = Rake::Application.new end - + def test_name_only name, args = @app.parse_task_string("name") assert_equal "name", name assert_equal [], args end - + def test_empty_args name, args = @app.parse_task_string("name[]") assert_equal "name", name assert_equal [], args end - + def test_one_argument name, args = @app.parse_task_string("name[one]") assert_equal "name", name assert_equal ["one"], args end - + def test_two_arguments name, args = @app.parse_task_string("name[one,two]") assert_equal "name", name assert_equal ["one", "two"], args end - + def test_can_handle_spaces_between_args name, args = @app.parse_task_string("name[one, two,\tthree , \tfour]") assert_equal "name", name diff --git a/test/rake/test_definitions.rb b/test/rake/test_definitions.rb index 164958ecd51282..a5440dcadca11b 100644 --- a/test/rake/test_definitions.rb +++ b/test/rake/test_definitions.rb @@ -6,7 +6,7 @@ ###################################################################### class Rake::TestDefinitions < Test::Unit::TestCase include Rake - + EXISTINGFILE = "testdata/existing" def setup @@ -78,4 +78,4 @@ def create_existing_file end end - + diff --git a/test/rake/test_earlytime.rb b/test/rake/test_earlytime.rb index a228146679410e..d94523cffd6abe 100644 --- a/test/rake/test_earlytime.rb +++ b/test/rake/test_earlytime.rb @@ -24,7 +24,7 @@ def test_original_time_compare_is_not_messed_up assert t1 < t2 assert t2 > t1 assert t1 == t1 - assert t2 == t2 + assert t2 == t2 end def test_to_s diff --git a/test/rake/test_extension.rb b/test/rake/test_extension.rb index 94348aafa626a7..3b10a4c6edbd27 100644 --- a/test/rake/test_extension.rb +++ b/test/rake/test_extension.rb @@ -16,14 +16,14 @@ def error_redirect $stderr = old_err end end - + class Sample extend Redirect def duplicate_method :original end - + OK_ERRS = error_redirect do rake_extension("a") do def ok_method diff --git a/test/rake/test_file_task.rb b/test/rake/test_file_task.rb index 1b0c0a561487f5..77f1480635e8fd 100644 --- a/test/rake/test_file_task.rb +++ b/test/rake/test_file_task.rb @@ -73,7 +73,7 @@ def test_existing_file_depends_on_non_existing_file # deleting the file target on failure is always the proper thing to # do. I'm willing to hear input on this topic. def ztest_file_deletes_on_failure - task :obj + task :obj file NEWFILE => [:obj] do |t| FileUtils.touch NEWFILE fail "Ooops" diff --git a/test/rake/test_filelist.rb b/test/rake/test_filelist.rb index 08456a4da8629d..2b1ad442374c59 100644 --- a/test/rake/test_filelist.rb +++ b/test/rake/test_filelist.rb @@ -89,7 +89,7 @@ def test_add_return h = f.include("y") assert_equal f.object_id, h.object_id end - + def test_match fl = FileList.new fl.include(File.expand_path('../test*.rb', __FILE__)) @@ -155,7 +155,7 @@ def test_exclude fl.exclude('testdata/existing') assert_equal [], fl end - + def test_excluding_via_block fl = FileList['testdata/a.c', 'testdata/b.c', 'testdata/xyz.c'] fl.exclude { |fn| fn.pathmap('%n') == 'xyz' } @@ -235,24 +235,24 @@ def test_sub assert_equal ["testdata/abc.o", "testdata/x.o", "testdata/xyz.o"].sort, f3.sort end - + def test_claim_to_be_a_kind_of_array fl = FileList['testdata/*.c'] assert fl.is_a?(Array) assert fl.kind_of?(Array) end - + def test_claim_to_be_a_kind_of_filelist fl = FileList['testdata/*.c'] assert fl.is_a?(FileList) assert fl.kind_of?(FileList) end - + def test_claim_to_be_a_filelist_instance fl = FileList['testdata/*.c'] assert fl.instance_of?(FileList) end - + def test_dont_claim_to_be_an_array_instance fl = FileList['testdata/*.c'] assert ! fl.instance_of?(Array) @@ -590,12 +590,12 @@ def test_other_array_returning_methods assert_equal ['b', 'd'], r assert_equal FileList, r.class end - + def test_file_utils_can_use_filelists cfiles = FileList['testdata/*.c'] - + cp cfiles, @cdir, :verbose => false - + assert File.exist?(File.join(@cdir, 'abc.c')) assert File.exist?(File.join(@cdir, 'xyz.c')) assert File.exist?(File.join(@cdir, 'x.c')) @@ -603,7 +603,7 @@ def test_file_utils_can_use_filelists def create_test_data verbose(false) do - + mkdir "testdata" unless File.exist? "testdata" mkdir "testdata/CVS" rescue nil mkdir "testdata/.svn" rescue nil @@ -621,5 +621,5 @@ def create_test_data touch "testdata/existing" end end - + end diff --git a/test/rake/test_fileutils.rb b/test/rake/test_fileutils.rb index 1664ec80c3dd4b..b6106c0978fa62 100644 --- a/test/rake/test_fileutils.rb +++ b/test/rake/test_fileutils.rb @@ -18,7 +18,7 @@ def setup @oldruby = nil end end - + def teardown FileUtils.rm_rf("testdata") FileUtils::LN_SUPPORTED[0] = true @@ -28,7 +28,7 @@ def teardown FileUtils.class_eval {const_set(:RUBY, ruby)} end end - + def test_rm_one_file create_file("testdata/a") FileUtils.rm_rf "testdata/a" @@ -165,7 +165,7 @@ def test_sh_with_multiple_arguments end def test_sh_failure - assert_raise(RuntimeError) { + assert_raise(RuntimeError) { verbose(false) { Sh.run "#{RUBY} #{File.expand_path('../shellcommand.rb', __FILE__)} 1" } } end @@ -241,7 +241,7 @@ def test_split_all end private - + def redirect_stderr old_err = $stderr $stderr = StringIO.new @@ -258,5 +258,5 @@ def windows? def env_var windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH' end - + end diff --git a/test/rake/test_multitask.rb b/test/rake/test_multitask.rb index 9711e7e77ec505..0413d03db309a8 100644 --- a/test/rake/test_multitask.rb +++ b/test/rake/test_multitask.rb @@ -40,4 +40,4 @@ def test_all_multitasks_wait_on_slow_prerequisites end end - + diff --git a/test/rake/test_pathmap.rb b/test/rake/test_pathmap.rb index 257529ab87b55e..2775b91039852b 100644 --- a/test/rake/test_pathmap.rb +++ b/test/rake/test_pathmap.rb @@ -23,7 +23,7 @@ def test_f_returns_basename def test_n_returns_basename_without_extension assert_equal "abc", "abc.rb".pathmap("%n") - assert_equal "abc", "abc".pathmap("%n") + assert_equal "abc", "abc".pathmap("%n") assert_equal "abc", "this/is/a/dir/abc.rb".pathmap("%n") assert_equal "abc", "/this/is/a/dir/abc.rb".pathmap("%n") assert_equal "abc", "/this/is/a/dir/abc".pathmap("%n") diff --git a/test/rake/test_rake.rb b/test/rake/test_rake.rb index 52230fe148e64d..44fecee5591832 100644 --- a/test/rake/test_rake.rb +++ b/test/rake/test_rake.rb @@ -35,5 +35,5 @@ def test_can_override_application def test_original_dir_reports_current_dir assert_equal Dir.pwd, Rake.original_dir end - + end diff --git a/test/rake/test_rdoc_task.rb b/test/rake/test_rdoc_task.rb index 362c2c6800110d..5f9ce25673f369 100644 --- a/test/rake/test_rdoc_task.rb +++ b/test/rake/test_rdoc_task.rb @@ -3,18 +3,18 @@ class Rake::TestRDocTask < Test::Unit::TestCase include Rake - + def setup Task.clear end - + def test_tasks_creation Rake::RDocTask.new assert Task[:rdoc] assert Task[:clobber_rdoc] assert Task[:rerdoc] end - + def test_tasks_creation_with_custom_name_symbol rd = Rake::RDocTask.new(:rdoc_dev) assert Task[:rdoc_dev] @@ -22,7 +22,7 @@ def test_tasks_creation_with_custom_name_symbol assert Task[:rerdoc_dev] assert_equal :rdoc_dev, rd.name end - + def test_tasks_creation_with_custom_name_string rd = Rake::RDocTask.new("rdoc_dev") assert Task[:rdoc_dev] @@ -30,7 +30,7 @@ def test_tasks_creation_with_custom_name_string assert Task[:rerdoc_dev] assert_equal "rdoc_dev", rd.name end - + def test_tasks_creation_with_custom_name_hash options = { :rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force" } rd = Rake::RDocTask.new(options) @@ -40,42 +40,42 @@ def test_tasks_creation_with_custom_name_hash assert_raises(RuntimeError) { Task[:clobber_rdoc] } assert_equal options, rd.name end - + def test_tasks_creation_with_custom_name_hash_will_use_default_if_an_option_isnt_given rd = Rake::RDocTask.new(:clobber_rdoc => "rdoc:clean") assert Task[:rdoc] assert Task[:"rdoc:clean"] assert Task[:rerdoc] end - + def test_tasks_creation_with_custom_name_hash_raises_exception_if_invalid_option_given assert_raises(ArgumentError) do Rake::RDocTask.new(:foo => "bar") end - + begin Rake::RDocTask.new(:foo => "bar") rescue ArgumentError => e assert_match(/foo/, e.message) end end - + def test_inline_source_is_enabled_by_default rd = Rake::RDocTask.new assert rd.option_list.include?('--inline-source') end - + def test_inline_source_option_is_only_appended_if_option_not_already_given rd = Rake::RDocTask.new rd.options << '--inline-source' assert_equal 1, rd.option_list.grep('--inline-source').size - + rd = Rake::RDocTask.new rd.options << '-S' assert_equal 1, rd.option_list.grep('-S').size assert_equal 0, rd.option_list.grep('--inline-source').size end - + def test_inline_source_option_can_be_disabled rd = Rake::RDocTask.new rd.inline_source = false diff --git a/test/rake/test_task_arguments.rb b/test/rake/test_task_arguments.rb index deb5f19ea2ba4e..fafbe39a7482ae 100644 --- a/test/rake/test_task_arguments.rb +++ b/test/rake/test_task_arguments.rb @@ -71,7 +71,7 @@ def test_child_hides_parent_arg_names child = Rake::TaskArguments.new(['aa'], [2], parent) assert_equal 2, child.aa end - + def test_default_arguments_values_can_be_merged ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) ta.with_defaults({ :aa => 'default_val' }) diff --git a/test/rake/test_task_manager.rb b/test/rake/test_task_manager.rb index 94c30d9c823e66..1a085c01643083 100644 --- a/test/rake/test_task_manager.rb +++ b/test/rake/test_task_manager.rb @@ -124,7 +124,7 @@ def test_lookup_with_explicit_scopes end end assert_equal t1, @tm[:t, []] - assert_equal t2, @tm[:t, ["a"]] + assert_equal t2, @tm[:t, ["a"]] assert_equal t3, @tm[:t, ["a", "b"]] assert_equal s, @tm[:s, ["a", "b"]] assert_equal s, @tm[:s, ["a"]] @@ -142,7 +142,7 @@ def test_correctly_scoped_prerequisites_are_invoked @tm["a:x"].invoke assert_equal ["next z"], values end - + end class Rake::TestTaskManagerArgumentResolution < Test::Unit::TestCase diff --git a/test/rake/test_test_task.rb b/test/rake/test_test_task.rb index a0dc7a0717f896..0b7dbc625b841c 100644 --- a/test/rake/test_test_task.rb +++ b/test/rake/test_test_task.rb @@ -4,7 +4,7 @@ class Rake::TestTestTask < Test::Unit::TestCase include Rake - + def setup @oldwd = Dir.pwd @tmpwd = Dir.mktmpdir diff --git a/test/rdoc/test_rdoc_parser_c.rb b/test/rdoc/test_rdoc_parser_c.rb index ebf96594c82ce5..ce93b5b3f70c3e 100644 --- a/test/rdoc/test_rdoc_parser_c.rb +++ b/test/rdoc/test_rdoc_parser_c.rb @@ -176,11 +176,11 @@ def test_do_constants comment = <<-EOF.chomp - + Multiline comment goes here because this comment spans multiple lines. Multiline comment goes here because this comment spans multiple lines. - - + + EOF assert_equal ['MULTILINE', 'INT2FIX(1)', comment], constants.shift assert_equal ['MULTILINE_VALUE', '1', comment], constants.shift @@ -189,8 +189,8 @@ def test_do_constants Multiline comment goes here because this comment spans multiple lines. Multiline comment goes here because this comment spans multiple lines. - - + + EOF assert_equal ['MULTILINE_NOT_EMPTY', 'INT2FIX(1)', comment], constants.shift diff --git a/test/rdoc/test_rdoc_ri_default_display.rb b/test/rdoc/test_rdoc_ri_default_display.rb index 1182b046c3cb32..966325ef5c9008 100644 --- a/test/rdoc/test_rdoc_ri_default_display.rb +++ b/test/rdoc/test_rdoc_ri_default_display.rb @@ -169,7 +169,7 @@ def test_display_method_info_singleton ------------------------------------------------------- SomeClass::some_method SomeClass::some_method(arg1, arg2) - From + From ------------------------------------------------------------------------------ [no description] EOF diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 5871f4c2bb4656..511585fa465272 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -118,8 +118,8 @@ def test_readline stdin.close(true) stdout.close(true) end - end - + end + # line_buffer # point def test_line_buffer__point @@ -129,7 +129,7 @@ def test_line_buffer__point rescue NotImplementedError return end - + stdin = Tempfile.new("test_readline_stdin") stdout = Tempfile.new("test_readline_stdout") begin diff --git a/test/ripper/dummyparser.rb b/test/ripper/dummyparser.rb index cf0b5d2a30bcaa..9691af3d5f7e1f 100644 --- a/test/ripper/dummyparser.rb +++ b/test/ripper/dummyparser.rb @@ -128,44 +128,44 @@ def on_method_add_block(m, b) on_args_add_block(m.children, b) m end - + def on_paren(params) params end - + def on_brace_block(params, code) Node.new('block', params, code) end - + def on_block_var(params, shadow) params end - + def on_rest_param(var) "*#{var}" end - + def on_blockarg(var) "&#{var}" end - + def on_params(required, optional, rest, more, block) args = NodeList.new - + required.each do |req| args.push(req) end if required - + optional.each do |var, val| args.push("#{var}=#{val}") end if optional - + args.push(rest) if rest - + more.each do |m| args.push(m) end if more - + args.push(block) if block args end diff --git a/test/rubygems/gem_package_tar_test_case.rb b/test/rubygems/gem_package_tar_test_case.rb index 462fa088480cd6..f671693cc05937 100644 --- a/test/rubygems/gem_package_tar_test_case.rb +++ b/test/rubygems/gem_package_tar_test_case.rb @@ -35,7 +35,7 @@ def assert_headers_equal(expected, actual) linkname 100 magic 6 version 2 - uname 32 + uname 32 gname 32 devmajor 8 devminor 8 @@ -54,7 +54,7 @@ def assert_headers_equal(expected, actual) next end - assert_equal expected[offset, length], actual[offset, length], + assert_equal expected[offset, length], actual[offset, length], "Field #{name} of the tar header differs." offset += length diff --git a/test/rubygems/simple_gem.rb b/test/rubygems/simple_gem.rb index a6f14bc3c71100..9bcb45878c97ca 100644 --- a/test/rubygems/simple_gem.rb +++ b/test/rubygems/simple_gem.rb @@ -8,7 +8,7 @@ MD5SUM = "e3701f9db765a2358aef94c40ded71c8" if $0 == __FILE__ require 'optparse' - + options = {} ARGV.options do |opts| opts.on_tail("--help", "show this message") {puts opts; exit} @@ -19,45 +19,45 @@ end require 'rubygems' - @directory = options[:directory] || Gem.dir + @directory = options[:directory] || Gem.dir @force = options[:force] - - gem = Gem::Installer.new(__FILE__).install(@force, @directory) + + gem = Gem::Installer.new(__FILE__).install(@force, @directory) if options[:gen_rdoc] Gem::DocManager.new(gem).generate_rdoc end end __END__ ---- !ruby/object:Gem::Specification +--- !ruby/object:Gem::Specification rubygems_version: "1.0" name: testing -version: !ruby/object:Gem::Version +version: !ruby/object:Gem::Version version: 1.2.3 date: 2004-03-18 22:01:52.859121 -05:00 -platform: +platform: summary: This exercise the gem testing stuff. -require_paths: +require_paths: - lib -files: +files: - lib/foo.rb - lib/test - lib/test.rb - lib/test/wow.rb autorequire: test test_suite_file: foo -requirements: +requirements: - a computer processor ---- -- +--- +- size: 109 mode: 420 path: lib/foo.rb -- +- size: 0 mode: 420 path: lib/test.rb -- +- size: 15 mode: 420 path: lib/test/wow.rb diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index e18004c4eac709..a8076b67b70819 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -449,7 +449,7 @@ def test_self_prefix_sitelibdir def test_self_refresh util_make_gems - a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec" + a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec" FileUtils.mv a1_spec, @tempdir diff --git a/test/rubygems/test_gem_doc_manager.rb b/test/rubygems/test_gem_doc_manager.rb index 051c9263079e40..e3928ed2bc2540 100644 --- a/test/rubygems/test_gem_doc_manager.rb +++ b/test/rubygems/test_gem_doc_manager.rb @@ -18,7 +18,7 @@ def setup def test_uninstall_doc_unwritable orig_mode = File.stat(@spec.installation_path).mode - + # File.chmod has no effect on MS Windows directories (it needs ACL). if win_platform? skip("test_uninstall_doc_unwritable skipped on MS Windows") diff --git a/test/rubygems/test_gem_indexer.rb b/test/rubygems/test_gem_indexer.rb index 7d721d028d5bdc..26a85bac3de6c7 100644 --- a/test/rubygems/test_gem_indexer.rb +++ b/test/rubygems/test_gem_indexer.rb @@ -236,12 +236,12 @@ def test_generate_index <pre>This line is really, really long. So long, in fact, that it is more than eighty characters long! The purpose of this line is for testing wrapping -behavior because sometimes people don't wrap their text to eighty characters. +behavior because sometimes people don't wrap their text to eighty characters. Without the wrapping, the text might not look good in the RSS feed. Also, a list: * An entry that's actually kind of sort - * an entry that's really long, which will probably get wrapped funny. + * an entry that's really long, which will probably get wrapped funny. That's ok, somebody wasn't thinking straight when they made it more than eighty characters.</pre> diff --git a/test/rubygems/test_gem_package_tar_input.rb b/test/rubygems/test_gem_package_tar_input.rb index 2459802b121834..7eea1826e0fe91 100644 --- a/test/rubygems/test_gem_package_tar_input.rb +++ b/test/rubygems/test_gem_package_tar_input.rb @@ -47,7 +47,7 @@ def setup meta = @spec.to_yaml f.write tar_file_header("metadata", "", 0644, meta.size) - f.write meta + "\0" * (1024 - meta.size) + f.write meta + "\0" * (1024 - meta.size) f.write "\0" * 1024 end diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb index 0adc595ad014f8..0d691e45cd32d6 100644 --- a/test/rubygems/test_gem_package_tar_writer.rb +++ b/test/rubygems/test_gem_package_tar_writer.rb @@ -45,7 +45,7 @@ def test_add_file_simple def test_add_file_simple_padding @tar_writer.add_file_simple 'x', 0, 100 - assert_headers_equal tar_file_header('x', '', 0, 100), + assert_headers_equal tar_file_header('x', '', 0, 100), @io.string[0, 512] assert_equal "\0" * 512, @io.string[512, 512] @@ -60,7 +60,7 @@ def test_add_file_simple_data end def test_add_file_simple_size - assert_raises Gem::Package::TarWriter::FileOverflow do + assert_raises Gem::Package::TarWriter::FileOverflow do @tar_writer.add_file_simple("lib/foo/bar", 0, 10) do |io| io.write "1" * 11 end @@ -68,7 +68,7 @@ def test_add_file_simple_size end def test_add_file_unseekable - assert_raises Gem::Package::NonSeekableIO do + assert_raises Gem::Package::NonSeekableIO do Gem::Package::TarWriter.new(Object.new).add_file 'x', 0 end end diff --git a/test/rubygems/test_gem_source_index.rb b/test/rubygems/test_gem_source_index.rb index 9cfde0b0a938a9..fc9e45e2a7dda6 100644 --- a/test/rubygems/test_gem_source_index.rb +++ b/test/rubygems/test_gem_source_index.rb @@ -342,7 +342,7 @@ def test_prerelease_specs_kept_in_right_place end def test_refresh_bang - a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec" + a1_spec = File.join @gemhome, "specifications", "#{@a1.full_name}.gemspec" FileUtils.mv a1_spec, @tempdir diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 332e81279134e2..fb5cf67461e38d 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -566,7 +566,7 @@ def test_full_name_windows 'i386-mswin32_80' => 'a-1-x86-mswin32-80', 'i386-mingw32' => 'a-1-x86-mingw32' } - + test_cases.each do |arch, expected| util_set_arch arch @a1.platform = 'current' diff --git a/test/rubygems/test_gem_version.rb b/test/rubygems/test_gem_version.rb index dfd3845e4225cf..f2b0280f3d7584 100644 --- a/test/rubygems/test_gem_version.rb +++ b/test/rubygems/test_gem_version.rb @@ -199,7 +199,7 @@ def test_prerelease refute Gem::Version.new('2.9').prerelease? refute Gem::Version.new('22.1.50.0').prerelease? end - + def test_release assert_equal Gem::Version.new('1.2.0'), Gem::Version.new('1.2.0.a').release assert_equal Gem::Version.new('1.1'), Gem::Version.new('1.1.rc10').release @@ -219,7 +219,7 @@ def test_satisfied_by_eh_boxed assert_adequate( "1.4.5", "~> 1.4.4") assert_inadequate("1.5", "~> 1.4.4") assert_inadequate("2.0", "~> 1.4.4") - + assert_inadequate("1.1.pre", "~> 1.0.0") assert_adequate( "1.1.pre", "~> 1.1") assert_inadequate("2.0.a", "~> 1.0") diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb index aa6504059faab1..2b34d273e23dd9 100644 --- a/test/win32ole/test_win32ole_variant.rb +++ b/test/win32ole/test_win32ole_variant.rb @@ -383,7 +383,7 @@ def test_conversion_time2date end # this test failed because of VariantTimeToSystemTime - # and SystemTimeToVariantTime API ignores wMilliseconds + # and SystemTimeToVariantTime API ignores wMilliseconds # member of SYSTEMTIME struct. # # def test_conversion_time_nsec2date diff --git a/test/xmlrpc/data/bug_bool.expected b/test/xmlrpc/data/bug_bool.expected index 121e3a84ba11fe..51b5d93acbc35c 100644 --- a/test/xmlrpc/data/bug_bool.expected +++ b/test/xmlrpc/data/bug_bool.expected @@ -1,3 +1,3 @@ ---- +--- - true - false \ No newline at end of file diff --git a/test/xmlrpc/data/bug_cdata.expected b/test/xmlrpc/data/bug_cdata.expected index 17d786131851a2..a9a0cebfc582b5 100644 --- a/test/xmlrpc/data/bug_cdata.expected +++ b/test/xmlrpc/data/bug_cdata.expected @@ -1,3 +1,3 @@ ---- +--- - true - test \ No newline at end of file diff --git a/test/xmlrpc/data/bug_covert.expected b/test/xmlrpc/data/bug_covert.expected index a9ac103c64c419..3687e288b965a5 100644 --- a/test/xmlrpc/data/bug_covert.expected +++ b/test/xmlrpc/data/bug_covert.expected @@ -1,4 +1,4 @@ ---- +--- - true - > Site,SANs,Array diff --git a/test/xmlrpc/data/value.expected b/test/xmlrpc/data/value.expected index 9463d02b136728..0bb93a6e214b1c 100644 --- a/test/xmlrpc/data/value.expected +++ b/test/xmlrpc/data/value.expected @@ -1,6 +1,6 @@ ---- +--- - Test -- +- - Hallo Leute - " Hallo " - '' diff --git a/test/xmlrpc/data/xml1.expected b/test/xmlrpc/data/xml1.expected index ff96de8df37a79..cb30573d68b9d4 100644 --- a/test/xmlrpc/data/xml1.expected +++ b/test/xmlrpc/data/xml1.expected @@ -1,7 +1,7 @@ ---- +--- - true -- - - +- + - subscriber: MegaCorp lastName: Baker telephone1: 1-508-791-1267 @@ -11,7 +11,7 @@ email: hbaker@yahoo.com adminId: hbaker objectName: AdministratorDO - - + - subscriber: CornerStore lastName: Dragon telephone1: 1-781-789-9089 @@ -21,7 +21,7 @@ email: adragon@yahoo.com adminId: adragon objectName: AdministratorDO - - + - subscriber: Cyberdyne lastName: Rodman telephone1: 1-617-789-1890 @@ -31,7 +31,7 @@ email: mrodman@yahoo.com adminId: mrodman objectName: AdministratorDO - - + - subscriber: StarSports lastName: Jordan telephone1: 1-617-890-7897 @@ -41,7 +41,7 @@ email: mjordan@yahoo.com adminId: mjordan objectName: AdministratorDO - - + - subscriber: GreatBooks lastName: Pippen telephone1: 1-781-789-9876 @@ -51,7 +51,7 @@ email: gpippen@yahoo.com adminId: gpippen objectName: AdministratorDO - - + - subscriber: AxisChemicals lastName: Andhrew telephone1: 1-781-678-8970 @@ -61,7 +61,7 @@ email: aandrew@yahoo.com adminId: aandrew objectName: AdministratorDO - - + - subscriber: MediaShop lastName: Vincent telephone1: 1-786-897-8908 @@ -71,7 +71,7 @@ email: tvincent@yahoo.com adminId: tvincent objectName: AdministratorDO - - + - subscriber: SmartShop lastName: Richard telephone1: 1-508-789-6789 @@ -81,7 +81,7 @@ email: krichard@yahoo.com adminId: krichard objectName: AdministratorDO - - + - subscriber: HomeNeeds lastName: Cornell telephone1: 1-617-789-8979 @@ -91,7 +91,7 @@ email: gconell@yahoo.com adminId: gcornell objectName: AdministratorDO - - + - subscriber: MegaCorp lastName: HorstMann telephone1: 1-508-791-1267 @@ -101,7 +101,7 @@ email: shorstmann@yahoo.com adminId: shorstmann objectName: AdministratorDO - - + - subscriber: CornerStore lastName: Bob telephone1: 1-781-789-9089 @@ -111,7 +111,7 @@ email: rbob@yahoo.com adminId: rbob objectName: AdministratorDO - - + - subscriber: Cyberdyne lastName: Peter telephone1: 1-617-789-1890 @@ -121,7 +121,7 @@ email: speter@yahoo.com adminId: speter objectName: AdministratorDO - - + - subscriber: StarSports lastName: Novak telephone1: 1-617-890-7897 @@ -131,7 +131,7 @@ email: pnovak@yahoo.com adminId: pnovak objectName: AdministratorDO - - + - subscriber: GreatBooks lastName: Nancy telephone1: 1-781-789-9876 @@ -141,7 +141,7 @@ email: pnancy@yahoo.com adminId: pnancy objectName: AdministratorDO - - + - subscriber: AxisChemicals lastName: Michel telephone1: 1-781-678-8970 @@ -151,7 +151,7 @@ email: hmichel@yahoo.com adminId: hmichel objectName: AdministratorDO - - + - subscriber: MediaShop lastName: David telephone1: 1-786-897-8908 @@ -161,7 +161,7 @@ email: kdavid@yahoo.com adminId: kdavid objectName: AdministratorDO - - + - subscriber: SmartShop lastName: Valnoor telephone1: 1-508-789-6789 @@ -171,7 +171,7 @@ email: pvalnoor@yahoo.com adminId: pvalnoor objectName: AdministratorDO - - + - subscriber: HomeNeeds lastName: Smith telephone1: 1-617-789-8979 @@ -181,7 +181,7 @@ email: wsmith@yahoo.com adminId: wsmith objectName: AdministratorDO - - + - subscriber: MegaCorp lastName: Caral telephone1: 1-781-789-9876 @@ -191,7 +191,7 @@ email: gcaral@yahoo.com adminId: gcaral objectName: AdministratorDO - - + - subscriber: CornerStore lastName: Hillary telephone1: 1-786-897-8908 @@ -201,7 +201,7 @@ email: phillary@yahoo.com adminId: phillary objectName: AdministratorDO - - + - subscriber: Cyberdyne lastName: Philip telephone1: 1-508-789-6789 @@ -211,7 +211,7 @@ email: bphilip@yahoo.com adminId: bphilip objectName: AdministratorDO - - + - subscriber: StarSports lastName: Andrea telephone1: 1-617-789-8979 @@ -221,7 +221,7 @@ email: sandrea@yahoo.com adminId: sandrea objectName: AdministratorDO - - + - subscriber: s4 lastName: "null" telephone1: "null" @@ -231,7 +231,7 @@ email: "null" adminId: s4 objectName: AdministratorDO - - + - subscriber: BigBank lastName: administrator telephone1: '' diff --git a/thread.c b/thread.c index 8d7d67b240fef7..aa27c6c49c3057 100644 --- a/thread.c +++ b/thread.c @@ -3655,7 +3655,7 @@ thread_reset_event_flags(rb_thread_t *th) } static void -rb_threadptr_add_event_hook(rb_thread_t *th, +rb_threadptr_add_event_hook(rb_thread_t *th, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data) { rb_event_hook_t *hook = alloc_event_hook(func, events, data); diff --git a/time.c b/time.c index 775640acb7f848..f4e7d83c3956a0 100644 --- a/time.c +++ b/time.c @@ -141,7 +141,7 @@ static VALUE mul(VALUE x, VALUE y) { if (FIXNUM_P(x) && FIXNUM_P(y)) { -#if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG +#if HAVE_LONG_LONG && SIZEOF_LONG * 2 <= SIZEOF_LONG_LONG LONG_LONG ll = (LONG_LONG)FIX2LONG(x) * FIX2LONG(y); if (FIXABLE(ll)) return LONG2FIX(ll); return LL2NUM(ll); @@ -707,7 +707,7 @@ static struct tm *localtime_with_gmtoff(const time_t *t, struct tm *result, long * The year 2037 is not used because * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522949 * - * #!/usr/bin/ruby + * #!/usr/bin/ruby * * require 'date' * @@ -718,8 +718,8 @@ static struct tm *localtime_with_gmtoff(const time_t *t, struct tm *result, long * d = Date.new(y,m,1) * h[m] ||= {} * h[m][d.wday] ||= y - * } - * } + * } + * } * * 1.upto(12) {|m| * print "{" @@ -750,10 +750,10 @@ static int compat_common_month_table[12][7] = { /* * compat_leap_month_table is generated by following program. * - * #!/usr/bin/ruby - * + * #!/usr/bin/ruby + * * require 'date' - * + * * h = {} * 2037.downto(2010) {|y| * 1.upto(12) {|m| @@ -763,7 +763,7 @@ static int compat_common_month_table[12][7] = { * h[m][d.wday] ||= y * } * } - * + * * 2.upto(2) {|m| * 0.upto(6) {|w| * y = h[m][w] @@ -3465,13 +3465,13 @@ strftimev(const char *fmt, VALUE time) * %C - Century (20 in 2009) * %d - Day of the month (01..31) * %D - Date (%m/%d/%y) - * %e - Day of the month, blank-padded ( 1..31) + * %e - Day of the month, blank-padded ( 1..31) * %F - Equivalent to %Y-%m-%d (the ISO 8601 date format) * %h - Equivalent to %b * %H - Hour of the day, 24-hour clock (00..23) * %I - Hour of the day, 12-hour clock (01..12) * %j - Day of the year (001..366) - * %k - hour, 24-hour clock, blank-padded ( 0..23) + * %k - hour, 24-hour clock, blank-padded ( 0..23) * %l - hour, 12-hour clock, blank-padded ( 0..12) * %L - Millisecond of the second (000..999) * %m - Month of the year (01..12) diff --git a/tool/asm_parse.rb b/tool/asm_parse.rb index f3d7f73c993e22..e39580c1a1bf28 100755 --- a/tool/asm_parse.rb +++ b/tool/asm_parse.rb @@ -7,7 +7,7 @@ puts line size = 0 len = 0 - + while line = ARGF.gets if /\[start\] (\w+)/ =~ line puts "\t; # length: #{len}, size: #{size}" @@ -29,8 +29,8 @@ size += 1 end end - - + + if /__NEXT_INSN__/ !~ line && /\[end \] (\w+)/ =~ line ename = $1 if name != ename diff --git a/tool/eval.rb b/tool/eval.rb index db6d11cddd29e9..9c2ceb991564d1 100755 --- a/tool/eval.rb +++ b/tool/eval.rb @@ -88,7 +88,7 @@ def parse_result data else raise "not a data" end - + end if /benchmark summary/ =~ line flag = true diff --git a/tool/instruction.rb b/tool/instruction.rb index a82ac2ccc031ad..14249c2d19207e 100755 --- a/tool/instruction.rb +++ b/tool/instruction.rb @@ -35,7 +35,7 @@ def add_sc sci @sc << sci sci.set_sc end - + attr_reader :name, :opes, :pops, :rets attr_reader :body, :comm attr_reader :nextsc, :pushsc @@ -45,11 +45,11 @@ def add_sc sci attr_reader :is_sc attr_reader :tvars attr_reader :sp_inc - + def set_sc @is_sc = true end - + def add_unif insns @unifs << insns end @@ -84,7 +84,7 @@ def sp_increase_c_expr "return depth + #{rets.size - pops.size};" end end - + def inspect "#" end @@ -113,7 +113,7 @@ def initialize opts = {} attr_reader :vpath attr_reader :destdir - + %w[use_const verbose].each do |attr| attr_reader attr alias_method "#{attr}?", attr @@ -455,7 +455,7 @@ def make_unified_insn_each insns rv = rpvars[1] "#define #{pv[1]} #{rv[1]}" }.join("\n") + - "\n" + + "\n" + redef_vars.map{|v, type| "#define #{v} #{v}_#{i}" }.join("\n") + "\n" + @@ -693,7 +693,7 @@ def make_header_prepare_stack insn } } end - + def make_header_operands insn comment " /* declare and get from iseq */" @@ -718,7 +718,7 @@ def make_header_operands insn # ops.join commit ops.reverse end - + def make_header_default_operands insn vars = insn.defopes @@ -907,7 +907,7 @@ def generate commit " ELABEL_PTR(#{insn.name}),\n" } end - + ERB.new(vpath.read('template/vmtc.inc.tmpl')).result(binding) end end @@ -1163,7 +1163,7 @@ def generate uni_insns.map{|e| "BIN(#{e.name})"}.join(", ") + "};\n" } else - + end if size > 0 unif_insns << "static const int *const UNIFIED_#{insn.name}[] = {(int *)#{size+1}, \n" diff --git a/tool/strip-rdoc.rb b/tool/strip-rdoc.rb index dc4c3dc5dc54a7..449f9b71a84b93 100755 --- a/tool/strip-rdoc.rb +++ b/tool/strip-rdoc.rb @@ -1,7 +1,7 @@ #!ruby source = ARGF.read -source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment| +source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment| marker, comment = $1, $2 next "/**#{comment}*/" unless /^\s*\*\s?\-\-\s*$/ =~ comment doxybody = nil diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index 19d4fe0927effc..8bd3c1d805c2a4 100755 --- a/tool/transcode-tblgen.rb +++ b/tool/transcode-tblgen.rb @@ -86,7 +86,7 @@ def to_s if byteset.length == 1 && byteset[0].begin == byteset[0].end "%02x" % byteset[0].begin else - "{" + + "{" + byteset.map {|range| if range.begin == range.end "%02x" % range.begin @@ -214,7 +214,7 @@ def eql?(other) alias == eql? def inspect - "\#<#{self.class}:" + + "\#<#{self.class}:" + @map.map {|k, v| " [" + k.to_s + "]=>" + v.inspect }.join('') + ">" end diff --git a/vm.c b/vm.c index 066fe6f0fe067b..1723a70724a8b0 100644 --- a/vm.c +++ b/vm.c @@ -397,7 +397,7 @@ collect_local_variables_in_iseq(rb_iseq_t *iseq, const VALUE ary) static int collect_local_variables_in_env(rb_env_t * env, const VALUE ary) { - + while (collect_local_variables_in_iseq(env->block.iseq, ary), env->prev_envval) { GetEnvPtr(env->prev_envval, env); diff --git a/vm_eval.c b/vm_eval.c index 967e24c6942021..b2f1f54f955d1f 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -208,7 +208,7 @@ stack_check(void) * \param mid an ID that represents the name of the method * \param argc the number of method arguments * \param argv a pointer to an array of method arguments - * \param scope + * \param scope * \param self self in the caller. Qundef means the current control frame's self. * * \note \a self is used in order to controlling access to protected methods. @@ -301,7 +301,7 @@ rb_call0(VALUE recv, ID mid, int argc, const VALUE *argv, * \param mid an ID that represents the name of the method * \param argc the number of method arguments * \param argv a pointer to an array of method arguments - * \param scope + * \param scope */ static inline VALUE rb_call(VALUE recv, ID mid, int argc, const VALUE *argv, call_type scope) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 25b0d5b3b25605..79c9ff9129670f 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -436,8 +436,8 @@ vm_method_missing(rb_thread_t *th, ID id, VALUE recv, } static inline void -vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp, - VALUE recv, int argc, const rb_block_t *blockptr, VALUE flag, +vm_setup_method(rb_thread_t *th, rb_control_frame_t *cfp, + VALUE recv, int argc, const rb_block_t *blockptr, VALUE flag, const rb_method_entry_t *me) { int opt_pc, i; diff --git a/vm_method.c b/vm_method.c index 557583f5aa6061..20d668495acae4 100644 --- a/vm_method.c +++ b/vm_method.c @@ -699,7 +699,7 @@ rb_mod_method_defined(VALUE mod, VALUE mid) return Qfalse; } return Qtrue; - + } #define VISI_CHECK(x,f) (((x)&NOEX_MASK) == (f)) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 5a6f18dadf8b56..9ca1a41014fdce 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -232,7 +232,7 @@ LDSHARED_2 = @if exist $(@).manifest @$(RM) $(@:/=\).manifest CPPFLAGS = $(DEFS) $(ARCHDEFS) $(CPPFLAGS) DLDFLAGS = $(LDFLAGS) -dll -SOLIBS = +SOLIBS = LIBRUBY_LDSHARED = $(LDSHARED) LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF) @@ -286,7 +286,7 @@ PREP = miniruby$(EXEEXT) !endif !if !defined(EXTSTATIC) -EXTSTATIC = +EXTSTATIC = !endif OBJEXT = obj diff --git a/win32/README.win32 b/win32/README.win32 index 5dd79cd17485ff..1d06ccd215fde7 100644 --- a/win32/README.win32 +++ b/win32/README.win32 @@ -37,7 +37,7 @@ Default of the install directory is /usr . (2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile})) - if you want to change the name of the executable files. + if you want to change the name of the executable files. And add ((|RUBYW_INSTALL_NAME|)) to change the name of the executable without console window if also you want. @@ -70,8 +70,8 @@ to their base names. $(RUBYW_INSTALL_NAME).ico or rubyw.ico --> $(RUBYW_INSTALL_NAME).exe the others --> $(RUBY_SO_NAME).dll -Although no icons are distributed with the ruby source or in the official -site, you can use anything you like. For example, followings are written +Although no icons are distributed with the ruby source or in the official +site, you can use anything you like. For example, followings are written in Japanese, but you can download at least. * (()) or diff --git a/win32/setup.mak b/win32/setup.mak index 3216ac70e9590e..1316b871413559 100644 --- a/win32/setup.mak +++ b/win32/setup.mak @@ -242,7 +242,7 @@ $(CPU) = $(PROCESSOR_LEVEL) # CPPFLAGS = -I. -I$$(srcdir) -I$$(srcdir)/missing -DLIBRUBY_SO=\"$$(LIBRUBY_SO)\" # STACK = 0x2000000 # LDFLAGS = $$(CFLAGS) -Fm -# XLDFLAGS = +# XLDFLAGS = # RFLAGS = -r # EXTLIBS = diff --git a/win32/win32.c b/win32/win32.c index 35b52df1d8e39d..69f4c82c71db7e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1223,7 +1223,7 @@ cmdglob(NtCmdLineElement *patt, NtCmdLineElement **tail) return tail; } -// +// // Check a command string to determine if it has I/O redirection // characters that require it to be executed by a command interpreter // @@ -1283,7 +1283,7 @@ skipspace(char *ptr) return ptr; } -int +int rb_w32_cmdvector(const char *cmd, char ***vec) { int globbing, len; @@ -1311,9 +1311,9 @@ rb_w32_cmdvector(const char *cmd, char ***vec) // // Ok, parse the command line, building a list of CmdLineElements. // When we've finished, and it's an input command (meaning that it's - // the processes argv), we'll do globing and then build the argument + // the processes argv), we'll do globing and then build the argument // vector. - // The outer loop does one interation for each element seen. + // The outer loop does one interation for each element seen. // The inner loop does one interation for each character in the element. // @@ -1350,7 +1350,7 @@ rb_w32_cmdvector(const char *cmd, char ***vec) case '?': case '[': case '{': - // + // // record the fact that this element has a wildcard character // N.B. Don't glob if inside a single quoted string // @@ -1364,7 +1364,7 @@ rb_w32_cmdvector(const char *cmd, char ***vec) case '\"': // // if we're already in a string, see if this is the - // terminating close-quote. If it is, we're finished with + // terminating close-quote. If it is, we're finished with // the string, but not neccessarily with the element. // If we're not already in a string, start one. // @@ -1400,7 +1400,7 @@ rb_w32_cmdvector(const char *cmd, char ***vec) if (done) --len; // - // if it's an input vector element and it's enclosed by quotes, + // if it's an input vector element and it's enclosed by quotes, // we can remove them. // @@ -1462,10 +1462,10 @@ rb_w32_cmdvector(const char *cmd, char ***vec) } // - // Almost done! + // Almost done! // Count up the elements, then allocate space for a vector of pointers // (argv) and a string table for the elements. - // + // for (elements = 0, strsz = 0, curr = cmdhead; curr; curr = curr->next) { elements++; @@ -1485,7 +1485,7 @@ rb_w32_cmdvector(const char *cmd, char ***vec) for (vptr = *vec; *vptr; ++vptr); return vptr - *vec; } - + // // make vptr point to the start of the buffer // and ptr point to the area we'll consider the string table. @@ -1526,7 +1526,7 @@ rb_w32_cmdvector(const char *cmd, char ***vec) // // The idea here is to read all the directory names into a string table // (separated by nulls) and when one of the other dir functions is called -// return the pointer to the current file name. +// return the pointer to the current file name. // #define GetBit(bits, i) ((bits)[(i) / CHAR_BIT] & (1 << (i) % CHAR_BIT)) @@ -1610,7 +1610,7 @@ opendir_internal(HANDLE fh, WIN32_FIND_DATAW *fd) // // bump the string table size by enough for the - // new name and it's null terminator + // new name and it's null terminator // tmpW = realloc(p->start, (idx + len) * sizeof(WCHAR)); if (!tmpW) { @@ -2054,7 +2054,7 @@ rb_w32_is_socket(int fd) } // -// Since the errors returned by the socket error function +// Since the errors returned by the socket error function // WSAGetLastError() are not known by the library routine strerror // we have to roll our own. // @@ -2135,7 +2135,7 @@ getegid(void) int setuid(rb_uid_t uid) -{ +{ return (uid == ROOT_UID ? 0 : -1); } @@ -2209,7 +2209,7 @@ rb_w32_fdisset(int fd, fd_set *set) // // Networking trampolines -// These are used to avoid socket startup/shutdown overhead in case +// These are used to avoid socket startup/shutdown overhead in case // the socket routines aren't used. // @@ -2240,7 +2240,7 @@ extract_fd(rb_fdset_t *dst, fd_set *src, int (*func)(SOCKET)) } memmove( &src->fd_array[s], - &src->fd_array[s+1], + &src->fd_array[s+1], sizeof(src->fd_array[0]) * (--src->fd_count - s)); } else s++; @@ -2806,7 +2806,7 @@ rb_w32_send(int fd, const char *buf, int len, int flags) } int WSAAPI -rb_w32_sendto(int fd, const char *buf, int len, int flags, +rb_w32_sendto(int fd, const char *buf, int len, int flags, const struct sockaddr *to, int tolen) { return overlapped_socket_io(FALSE, fd, (char *)buf, len, flags, @@ -3036,7 +3036,7 @@ rb_w32_setsockopt(int s, int level, int optname, const char *optval, int optlen) }); return r; } - + #undef shutdown int WSAAPI @@ -4266,7 +4266,7 @@ rb_w32_getc(FILE* stream) if (enough_to_get(stream->FILE_COUNT)) { c = (unsigned char)*stream->FILE_READPTR++; } - else + else { c = _filbuf(stream); #if defined __BORLANDC__ @@ -4286,7 +4286,7 @@ rb_w32_putc(int c, FILE* stream) if (enough_to_put(stream->FILE_COUNT)) { c = (unsigned char)(*stream->FILE_READPTR++ = (char)c); } - else + else { c = _flsbuf(c, stream); catch_interrupt();