From 0e05806f364a979436e413fd9b595428c5202ee7 Mon Sep 17 00:00:00 2001 From: nagai Date: Wed, 2 Nov 2005 10:06:29 +0000 Subject: [PATCH] * ext/tk/tcltklib.c (ip_rbUpdateObjCmd, ip_rb_threadUpdateObjCmd): passed improper flags to DoOneEvent(). * ext/tk/tkutil/tkutil.c: use rb_obj_respond_to() instead of rb_respond_to(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ ext/tk/tcltklib.c | 14 +++++++------- ext/tk/tkutil/tkutil.c | 18 +++++++++--------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 046c38b249..3e2717f75a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Nov 2 19:03:06 2005 Hidetoshi NAGAI + + * ext/tk/tcltklib.c (ip_rbUpdateObjCmd, ip_rb_threadUpdateObjCmd): + passed improper flags to DoOneEvent(). + + * ext/tk/tkutil/tkutil.c: use rb_obj_respond_to() instead of + rb_respond_to(). + Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto * eval.c (rb_call_super): should call method_missing if super is diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index a6374cb0dc..131dcd3993 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -4,7 +4,7 @@ * Oct. 24, 1997 Y. Matsumoto */ -#define TCLTKLIB_RELEASE_DATE "2005-09-28" +#define TCLTKLIB_RELEASE_DATE "2005-11-02" #include "ruby.h" #include "rubysig.h" @@ -2758,7 +2758,7 @@ ip_rbUpdateCommand(clientData, interp, objc, objv) #endif if (objc == 1) { - flags = TCL_ALL_EVENTS|TCL_DONT_WAIT; + flags = TCL_DONT_WAIT; } else if (objc == 2) { #if TCL_MAJOR_VERSION >= 8 @@ -2768,7 +2768,7 @@ ip_rbUpdateCommand(clientData, interp, objc, objv) } switch ((enum updateOptions) optionIndex) { case REGEXP_IDLETASKS: { - flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT; + flags = TCL_IDLE_EVENTS; break; } default: { @@ -2781,7 +2781,7 @@ ip_rbUpdateCommand(clientData, interp, objc, objv) "\": must be idletasks", (char *) NULL); return TCL_ERROR; } - flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT; + flags = TCL_IDLE_EVENTS; #endif } else { #ifdef Tcl_WrongNumArgs @@ -2919,7 +2919,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv) DUMP1("start Ruby's 'thread_update' body"); if (objc == 1) { - flags = TCL_ALL_EVENTS|TCL_DONT_WAIT; + flags = TCL_DONT_WAIT; } else if (objc == 2) { #if TCL_MAJOR_VERSION >= 8 @@ -2929,7 +2929,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv) } switch ((enum updateOptions) optionIndex) { case REGEXP_IDLETASKS: { - flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT; + flags = TCL_IDLE_EVENTS; break; } default: { @@ -2942,7 +2942,7 @@ ip_rb_threadUpdateCommand(clientData, interp, objc, objv) "\": must be idletasks", (char *) NULL); return TCL_ERROR; } - flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT; + flags = TCL_IDLE_EVENTS; #endif } else { #ifdef Tcl_WrongNumArgs diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c index f191eb1627..7fbf3fc07c 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -8,7 +8,7 @@ ************************************************/ -#define TKUTIL_RELEASE_DATE "2005-07-28" +#define TKUTIL_RELEASE_DATE "2005-11-02" #include "ruby.h" #include "rubysig.h" @@ -368,7 +368,7 @@ ary2list(ary, enc_flag, self) if (RTEST(dst_enc) && !NIL_P(sys_enc)) { for(idx = 0; idx < RARRAY(dst)->len; idx++) { str_val = RARRAY(dst)->ptr[idx]; - if (rb_respond_to(self, ID_toUTF8)) { + if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) { str_val = rb_funcall(self, ID_toUTF8, 1, str_val); } else { str_val = rb_funcall(cTclTkLib, ID_toUTF8, 1, str_val); @@ -462,7 +462,7 @@ ary2list2(ary, enc_flag, self) if (RTEST(dst_enc) && !NIL_P(sys_enc)) { for(idx = 0; idx < RARRAY(dst)->len; idx++) { str_val = RARRAY(dst)->ptr[idx]; - if (rb_respond_to(self, ID_toUTF8)) { + if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) { str_val = rb_funcall(self, ID_toUTF8, 1, str_val); } else { str_val = rb_funcall(cTclTkLib, ID_toUTF8, 1, str_val); @@ -781,7 +781,7 @@ get_eval_string_core(obj, enc_flag, self) case T_STRING: if (RTEST(enc_flag)) { - if (rb_respond_to(self, ID_toUTF8)) { + if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) { return rb_funcall(self, ID_toUTF8, 1, obj); } else { return fromDefaultEnc_toUTF8(obj, self); @@ -792,7 +792,7 @@ get_eval_string_core(obj, enc_flag, self) case T_SYMBOL: if (RTEST(enc_flag)) { - if (rb_respond_to(self, ID_toUTF8)) { + if (rb_obj_respond_to(self, ID_toUTF8, Qtrue)) { return rb_funcall(self, ID_toUTF8, 1, rb_str_new2(rb_id2name(SYM2ID(obj)))); } else { @@ -834,7 +834,7 @@ get_eval_string_core(obj, enc_flag, self) if (rb_obj_is_kind_of(obj, rb_cProc) || rb_obj_is_kind_of(obj, cMethod) || rb_obj_is_kind_of(obj, cTkCallbackEntry)) { - if (rb_respond_to(self, ID_install_cmd)) { + if (rb_obj_respond_to(self, ID_install_cmd, Qtrue)) { return rb_funcall(self, ID_install_cmd, 1, obj); } else { return tk_install_cmd_core(obj); @@ -843,15 +843,15 @@ get_eval_string_core(obj, enc_flag, self) if (obj == TK_None) return Qnil; - if (rb_respond_to(obj, ID_to_eval)) { + 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), enc_flag, self); - } else if (rb_respond_to(obj, ID_path)) { + } 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), enc_flag, self); - } else if (rb_respond_to(obj, ID_to_s)) { + } else if (rb_obj_respond_to(obj, ID_to_s, Qtrue)) { return rb_funcall(obj, ID_to_s, 0, 0); } }