Граф коммитов

627 Коммитов

Автор SHA1 Сообщение Дата
nobu dca6009c3e tkutil.c: use local variables
* 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
2015-09-27 09:57:58 +00:00
nobu c97a6987b6 ext/tk: remove $SAFE 2..4 code
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-24 01:37:14 +00:00
nobu a2b8925a94 tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
  length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-02 01:27:31 +00:00
hsbt 415e9cef0d * ext/tk/tcltklib.c: removed deprecated safe level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-06 09:00:21 +00:00
nobu 8e7393559f tkutil.c: fix out-of-bounds access
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): check array
  length not access out-of-bounds.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-01 01:55:10 +00:00
nobu 30e6825e1b tkutil.c: fix memory leak and segfault
* 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
2015-05-31 22:32:14 +00:00
nobu 912ae57b8a tkutil.c: reduce unnecessary buffer
* 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
2015-05-31 15:08:05 +00:00
nobu fbc67dbf2c tcltklib.c: allocate structs with wrapper
* 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
2015-05-28 06:45:55 +00:00
nobu d50260117f tkutil.c: check arguments type
* 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
2015-05-28 06:44:43 +00:00
nobu 0c58f69791 tkutil.c: check type
* 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
2015-05-28 05:53:05 +00:00
nobu 86f7fceef4 Fix typo in samples for tk ext [skip ci]
* ext/tk/sample/figmemo_sample.rb (open_file),
  ext/tk/sample/tktextio.rb (TkTextIO): fix typo in messages.
  [Fix GH-916]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 21:56:04 +00:00
nobu c83883cf4e tcltklib.c: fix memory leak
* ext/tk/tcltklib.c (ip_init): reject already initialized
  interpreter to fix memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-27 13:36:27 +00:00
nobu 038c0e5a80 ext: suppress warnings
* 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
2015-04-19 03:19:20 +00:00
nobu c35aa93590 tkutil.c: revert r48250
* 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
2015-04-17 05:07:58 +00:00
hsbt d9a2b3480e * doc/contributors.rdoc: fix a typo. Patch by @davydovanton
[fix GH-872][ci skip]
* doc/syntax/methods.rdoc: ditto.
* ext/digest/sha2/sha2.c: ditto.
* ext/socket/ipsocket.c: ditto.
* ext/tk/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-15 01:37:47 +00:00
nobu 659f14b254 tkutil.c: fallback rb_id2str
* ext/tk/tkutil/tkutil.c (rb_id2str): add fallback definition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-14 03:36:19 +00:00
nobu 0b2554fe7e tkutil.c: use rb_sym2str
* 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
2015-04-14 03:35:54 +00:00
nobu 16294913f7 use rb_funcallv
* 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
2015-02-16 04:08:52 +00:00
hsbt 9f3a95a0c8 * ext/tk/lib/tkextlib/tcllib/plotchart.rb: fix to invoke correct function
of tcllib. Patch by @zalt50 [fix GH-787]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-27 01:11:28 +00:00
nobu ca24e581ba tcltklib.c: duplicate code
* ext/tk/tcltklib.c (ip_invoke_core): remove probably duplicate
  dead code.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-26 06:32:18 +00:00
nobu d7d1e344f5 tcltklib.c: rb_path2class
* 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
2014-12-26 06:28:29 +00:00
nobu ed52fa6ef9 tcltklib.c: revert RUBY_UNTYPED_DATA_WARNING
* 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
2014-12-03 04:04:02 +00:00
nobu c95b3a16bd ruby.h: no warnings of hidden objects
* 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
2014-12-03 03:25:06 +00:00
nobu b040788b52 tkutil.c: typed data
* ext/tk/tkutil/tkutil.c (cbsubst_info_type): use typed data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03 03:25:02 +00:00
nobu e3787f8b36 ext/tk/tkutil/tkutil.c: disable untyped data warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-03 06:22:16 +00:00
nobu 30f69beeba tkutil.c: inherit Data
* 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
2014-11-03 05:36:29 +00:00
nobu 40cc9231a9 tkutil.c: remove useless branches
* 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
2014-10-30 06:33:11 +00:00
hsbt 36284e2413 * ext/tk/lib/tkextlib/tile/treeview.rb: fix syntax error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-19 11:06:07 +00:00
nagai bf0e2520d7 * ext/tk/tcltklib.c: support Tcl/Tk8.6.
* 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
2014-10-19 08:38:35 +00:00
nagai 7ce520e90a * ext/tk/tcltklib.c: (experimental) support Tcl/Tk8.6.2.
* ext/tk/extconf.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-13 17:32:17 +00:00
nobu a9c42d1026 tcltklib.c: typed data
* ext/tk/tcltklib.c (tcltkip_type): use typed data.

* ext/tk/tcltklib.c ({call,eval,invoke}_queue_handler): hide
  internal objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-09 07:53:59 +00:00
nobu ba0655ebdd ext: protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:29:24 +00:00
nobu 28b9f11d5a protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30 05:25:32 +00:00
nagai 0e6a399185 * ext/tk/lib/tkextlib/tcllib/plotchart.rb: fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-04 00:07:01 +00:00
nobu 27c4fb3361 ext: get rid of inadvertent ID creation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-03 01:56:16 +00:00
nobu 1d670ab0f0 ext: prefer RB_TYPE_P over comparison TYPE with constants
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-03 01:56:01 +00:00
nobu e3e359ba79 tcltklib.c: fix format specifiers
* 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
2014-06-23 21:15:39 +00:00
nobu 77811031e5 extmk.rb: check if parent is build
* 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
2014-05-09 05:52:59 +00:00
nagai 5ab5d92191 * ext/tk/lib/tkextlib/tkDND/tkdnd.rb: fix typo and missing definition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-05 16:29:55 +00:00
zzak bdeedccc5f * ext/tk/README.tcltklib: [DOC] Fix typo by @xta [Fixes GH-532] [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 08:02:01 +00:00
hsbt d1ab866d4a * ext/nkf/nkf-utf8/nkf.c: fix typo by @windwiny [fix GH-506]
* ext/openssl/ossl_ssl.c: ditto
* ext/psych/yaml/scanner.c: ditto
* ext/socket/init.c: ditto
* ext/socket/socket.c: ditto
* ext/tk/tcltklib.c: ditto
* ext/win32ole/win32ole.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 05:43:23 +00:00
nagai 738c298ce0 * ext/tk/extconf.rb: --with-tcllib and --with-tklib configure options
don't work correctly. Patch by jeremyevans0 (Jeremy Evans).
  [ruby-core:59483] [Bug #9348]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 09:04:06 +00:00
nobu 9bd672f668 ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:36 +00:00
nobu 4240685237 stubs.c: library name strings
* 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
2014-01-12 08:11:34 +00:00
nobu 13e47e81d9 tcltklib.c: create_ip_exc format argument
* 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
2014-01-12 08:11:32 +00:00
nobu f06ee90f95 tk/extconf.rb: fix libpathflag arguments
* 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
2014-01-09 15:47:54 +00:00
nobu dc4922b89d tk/extconf.rb: rpath by libpathflag
* 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
2014-01-05 12:48:23 +00:00
nobu bd0ef220f0 ext/tk/extconf.rb: fix build error with tk variant
* 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
2014-01-04 12:10:20 +00:00
charliesome 75f4731f90 * benchmark/bm_so_meteor_contest.rb: [DOC] Fix a few typos
* ext/fiddle/lib/fiddle/import.rb: ditto
* ext/psych/lib/psych.rb: ditto
* ext/psych/lib/psych/nodes/sequence.rb: ditto
* ext/tk/lib/multi-tk.rb: ditto
* ext/tk/lib/tcltk.rb: ditto

Closes GH-490

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-28 08:25:28 +00:00
hsbt 3d4ceaaa14 * ext/tk/lib/tkextlib/SUPPORT_STATUS: [DOC] remove link of RAA.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11 03:36:03 +00:00