* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): use local
variables instead of repeating RARRAY_PTR.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (cbsubst_append_inf_key): extract a
function append a key in subst info to a string. make result
strings first and get rid of potential memory leak.
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_arg): allocate the
result buffer as a string to fix:
* memory leak when the argument key is not found:
loop {Tk::Event.subst_arg(:a) rescue nil}
* buffer overflow segfault when many arguments:
class T < TkUtil::CallbackSubst
_setup_subst_table([[?a, ?A, :_a]], [])
subst_arg(*[:_a]*1000).size
end
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): reduce
unnecessary buffer. the result string is one byte per one word.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c (ip_create_slave_core): allocate structs with
making new wrapper objects and get rid of potential memory leak.
* ext/tk/tkutil/tkutil.c (allocate_cbsubst_info): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): check arguments
type. implicit conversion is disabled to get rid of method
calls which can modify other arguments.
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): ditto.
* ext/tk/tkutil/tkutil.c (cbsubst_scan_args): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_key): ensure the
result type of a method call to be an array before accessing by
RARRAY macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/{etc,openssl,tk}: Adding parens and comparisons around
assignments to get rid of Wparentheses warnings. [Fix GH-875]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (Init_tkutil): TkUtil::CallbackSubst and
TkUtil::CallbackSubst::Info need the default allocator.
[ruby-list:50115]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (rb_sym2str): use rb_sym2str always but
not rb_sym_to_s, and fallback to rb_id2str and SYM2ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_funcallv() for no arguments call instead of variadic
rb_funcall().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c (ip_ruby_cmd_receiver_const_get): simply use
rb_path2class() to get a class/module from its name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c (RUBY_UNTYPED_DATA_WARNING): Data_Get_Struct
is not affected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (rb_data_object_alloc_warning): no warnings
of internal hidden objects which klass == 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c: use Data as super class, not to inherit
useless methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): remove useless
branches and get rid of out of bound access.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/lib/tk.rb: ditto.
* ext/tk/extconf.rb: ditto.
* ext/tk/lib/tk_mac.rb: add new features of Tcl/Tk8.6.
* ext/tk/lib/tkextlib/tile/treeview.rb: ditto.
* ext/tk/lib/tkextlib/tile/fontchooser.rb: add an alias.
* ext/tk/lib/tk/autoload.rb: ditto.
* ext/tk/lib/tkextlib/tcllib/validator.rb: add a new feature of tklib extension.
* ext/tk/lib/tkextlib/tkimg/dted.rb: a new supported format of Img extension.
* ext/tk/lib/tkextlib/tkimg/raw.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c: fix format specifiers for VALUE and
Tcl_Interp*. [ruby-core:63283] [Bug #9972]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/extmk.rb (extmake): don't build nested libraries if parent
library isn't build.
* ext/{dl/callback,tk/tkutil}/extconf.rb: no longer need to check
if the parent is build.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/stubs.c (ruby_open_tcl_dll, ruby_open_tk_dll): make library
names by string literal concatenation at compilation time, not by
sprintf() at runtime.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/tcltklib.c (create_ip_exc): format argument must not be a
dynamic string, not to contain unescaped %.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/extconf.rb: fix to pass arrays instead of strings to
libpathflag. patch at [ruby-core:59665]. [Bug #9386]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/extconf.rb: use libpathflag method instead of dealing with
rpath options directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/tk/extconf.rb: use -rpath linker option instead of -R, to
fix build error with tk variant. incorporate from MacPorts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e