Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 10 commits
  • 149 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 25, 2008
Laurent Sansonetti creating testing branch
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@11 23306eb0-4c56-4727-a40e-e92c0eb68959
d3893c4
Commits on Feb 26, 2008
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@14 23306eb0-4c56-4727-a40e-e92c0eb68959
c919126
Commits on Feb 27, 2008
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@18 23306eb0-4c56-4727-a40e-e92c0eb68959
25ae1b5
Laurent Sansonetti forgot to merge r15
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@19 23306eb0-4c56-4727-a40e-e92c0eb68959
e493fd6
Commits on Mar 07, 2008
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@52 23306eb0-4c56-4727-a40e-e92c0eb68959
ada253c
Commits on Mar 11, 2008
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@68 23306eb0-4c56-4727-a40e-e92c0eb68959
6537c7a
Commits on Mar 12, 2008
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@83 23306eb0-4c56-4727-a40e-e92c0eb68959
078336a
Commits on Mar 13, 2008
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@86 23306eb0-4c56-4727-a40e-e92c0eb68959
79a8419
Laurent Sansonetti merging with trunk
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/branches/testing@88 23306eb0-4c56-4727-a40e-e92c0eb68959
51802d5
Laurent Sansonetti tagging 0.1
git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/tags/0.1@89 23306eb0-4c56-4727-a40e-e92c0eb68959
b3e85dd
Showing with 12,822 additions and 873 deletions.
  1. +52 −0 .cvsignore
  2. +16 −0 .document
  3. +553 −2 ChangeLog
  4. +1 −2 Makefile.in
  5. +53 −18 array.c
  6. +1 −2 bcc32/Makefile.sub
  7. +22 −2 bignum.c
  8. +4 −0 bootstraptest/test_io.rb
  9. +0 −11 bootstraptest/test_knownbug.rb
  10. +1 −1 bootstraptest/test_marshal.rb
  11. +2 −0 bootstraptest/test_syntax.rb
  12. +8 −11 bs.c
  13. +1 −1 bs.h
  14. +16 −26 class.c
  15. +2 −2 common.mk
  16. +1 −1 compile.c
  17. +78 −29 configure.in
  18. +3 −0 cygwin/GNUmakefile.in
  19. +14 −22 debug.c
  20. +17 −13 encoding.c
  21. +17 −20 eval.c
  22. +2 −2 eval_error.c
  23. +10 −2 eval_intern.h
  24. +6 −17 eval_method.c
  25. +1 −1 ext/json/ext/parser/unicode.c
  26. +6 −4 file.c
  27. +30 −0 framework/Info.plist
  28. BIN framework/InfoPlist.strings
  29. +7 −14 gc.c
  30. +4 −4 hash.c
  31. +2 −0 include/MacRuby.h
  32. +2 −1 include/ruby/encoding.h
  33. +9 −3 include/ruby/intern.h
  34. +1 −1 include/ruby/node.h
  35. +23 −6 include/ruby/ruby.h
  36. +3 −1 include/ruby/util.h
  37. +1 −0 include/ruby/win32.h
  38. +0 −1 insnhelper.h
  39. +2 −2 insns.def
  40. +110 −35 instruby.rb
  41. +275 −127 io.c
  42. +2 −2 lib/mkmf.rb
  43. +22 −1 lib/open-uri.rb
  44. +3 −2 lib/test/unit/collector/dir.rb
  45. +1 −1 load.c
  46. +3 −3 marshal.c
  47. +1 −0 misc/README
  48. BIN ...xcode-templates/Project Templates/Application/MacRuby Application/English.lproj/InfoPlist.strings
  49. +2,398 −0 ...lates/Project Templates/Application/MacRuby Application/English.lproj/MainMenu.nib/designable.nib
  50. BIN ...tes/Project Templates/Application/MacRuby Application/English.lproj/MainMenu.nib/keyedobjects.nib
  51. +28 −0 misc/xcode-templates/Project Templates/Application/MacRuby Application/Info.plist
  52. +15 −0 ...mplates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/TemplateInfo.plist
  53. +277 −0 ...-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/project.pbxproj
  54. +14 −0 misc/xcode-templates/Project Templates/Application/MacRuby Application/main.m
  55. +22 −0 misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb
  56. +4 −0 mkconfig.rb
  57. +1,017 −205 objc.m
  58. +21 −13 object.c
  59. +14 −5 parse.y
  60. +14 −0 proc.c
  61. +171 −31 process.c
  62. +2 −1 re.c
  63. +91 −34 ruby.c
  64. +35 −0 sample-macruby/ABPresence/ABPersonDisplayName.rb
  65. +289 −0 sample-macruby/ABPresence/ABPresence.xcodeproj/project.pbxproj
  66. +285 −0 sample-macruby/ABPresence/ABPresence.xcodeproj/project.pbxproj.in
  67. BIN sample-macruby/ABPresence/English.lproj/InfoPlist.strings
  68. +47 −0 sample-macruby/ABPresence/English.lproj/MainMenu.nib/classes.nib
  69. +18 −0 sample-macruby/ABPresence/English.lproj/MainMenu.nib/info.nib
  70. BIN sample-macruby/ABPresence/English.lproj/MainMenu.nib/keyedobjects.nib
  71. +28 −0 sample-macruby/ABPresence/Info.plist
  72. +90 −0 sample-macruby/ABPresence/PeopleDataSource.rb
  73. +49 −0 sample-macruby/ABPresence/ServiceWatcher.rb
  74. +14 −0 sample-macruby/ABPresence/main.m
  75. +24 −0 sample-macruby/ABPresence/rb_main.rb
  76. +53 −0 sample-macruby/About MacRuby Examples.rtf
  77. BIN sample-macruby/AnimatingViews/AnimatingViews.xcodeproj/.project.pbxproj.in.swp
  78. +287 −0 sample-macruby/AnimatingViews/AnimatingViews.xcodeproj/project.pbxproj
  79. BIN sample-macruby/AnimatingViews/English.lproj/InfoPlist.strings
  80. +54 −0 sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/classes.nib
  81. +19 −0 sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/info.nib
  82. BIN sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/keyedobjects.nib
  83. +28 −0 sample-macruby/AnimatingViews/Info.plist
  84. +126 −0 sample-macruby/AnimatingViews/SimpleLayoutView.rb
  85. +14 −0 sample-macruby/AnimatingViews/main.m
  86. +22 −0 sample-macruby/AnimatingViews/rb_main.rb
  87. +200 −0 sample-macruby/CircleView/CircleView.rb
  88. +308 −0 sample-macruby/CircleView/CircleView.xcodeproj/project.pbxproj
  89. BIN sample-macruby/CircleView/English.lproj/InfoPlist.strings
  90. +26 −0 sample-macruby/CircleView/English.lproj/MainMenu.nib/classes.nib
  91. +20 −0 sample-macruby/CircleView/English.lproj/MainMenu.nib/info.nib
  92. BIN sample-macruby/CircleView/English.lproj/MainMenu.nib/objects.nib
  93. +28 −0 sample-macruby/CircleView/Info.plist
  94. +14 −0 sample-macruby/CircleView/main.m
  95. +22 −0 sample-macruby/CircleView/rb_main.rb
  96. +89 −0 sample-macruby/DotView/DotView.rb
  97. +281 −0 sample-macruby/DotView/DotView.xcodeproj/project.pbxproj
  98. BIN sample-macruby/DotView/English.lproj/InfoPlist.strings
  99. +17 −0 sample-macruby/DotView/English.lproj/MainMenu.nib/classes.nib
  100. +18 −0 sample-macruby/DotView/English.lproj/MainMenu.nib/info.nib
  101. BIN sample-macruby/DotView/English.lproj/MainMenu.nib/objects.nib
  102. +28 −0 sample-macruby/DotView/Info.plist
  103. +14 −0 sample-macruby/DotView/main.m
  104. +22 −0 sample-macruby/DotView/rb_main.rb
  105. +30 −0 sample-macruby/OutlineView/DataSource.rb
  106. BIN sample-macruby/OutlineView/English.lproj/InfoPlist.strings
  107. +2,764 −0 sample-macruby/OutlineView/English.lproj/MainMenu.nib/designable.nib
  108. BIN sample-macruby/OutlineView/English.lproj/MainMenu.nib/keyedobjects.nib
  109. +44 −0 sample-macruby/OutlineView/FileSystemItem.rb
  110. +28 −0 sample-macruby/OutlineView/Info.plist
  111. +291 −0 sample-macruby/OutlineView/OutlineView.xcodeproj/project.pbxproj
  112. +14 −0 sample-macruby/OutlineView/main.m
  113. +22 −0 sample-macruby/OutlineView/rb_main.rb
  114. +155 −0 sample-macruby/PathDemo/DemoView.rb
  115. BIN sample-macruby/PathDemo/English.lproj/InfoPlist.strings
  116. +14 −0 sample-macruby/PathDemo/English.lproj/MainMenu.nib/classes.nib
  117. +26 −0 sample-macruby/PathDemo/English.lproj/MainMenu.nib/info.nib
  118. BIN sample-macruby/PathDemo/English.lproj/MainMenu.nib/objects.nib
  119. +28 −0 sample-macruby/PathDemo/Info.plist
  120. +285 −0 sample-macruby/PathDemo/PathDemo.xcodeproj/project.pbxproj
  121. +285 −0 sample-macruby/PathDemo/PathDemo.xcodeproj/project.pbxproj.in
  122. +35 −0 sample-macruby/PathDemo/PathDemoController.rb
  123. +15 −0 sample-macruby/PathDemo/main.m
  124. +22 −0 sample-macruby/PathDemo/rb_main.rb
  125. +20 −17 sample-macruby/{ → Scripts}/hello_world.rb
  126. +5 −8 sample-macruby/{ → Scripts}/transparent_hello.rb
  127. +1 −1 sample/test.rb
  128. +1 −1 signal.c
  129. +9 −6 sprintf.c
  130. +0 −4 st.c
  131. +246 −62 string.c
  132. +2 −0 test-macruby/runner.rb
  133. +93 −0 test-macruby/test_boxed.rb
  134. +27 −0 test-macruby/test_framework.rb
  135. +112 −0 test-macruby/test_objc.rb
  136. +66 −0 test-macruby/test_string.rb
  137. +13 −10 thread.c
  138. +5 −1 time.c
  139. +3 −3 tool/make-snapshot
  140. +30 −5 transcode.c
  141. +24 −10 util.c
  142. +33 −33 variable.c
  143. +3 −0 version.c
  144. +6 −8 version.h
  145. +0 −1 vm.c
  146. +0 −7 vm_core.h
  147. +15 −10 vm_insnhelper.c
  148. +1 −2 win32/Makefile.sub
  149. +4 −2 win32/win32.c
View
52 .cvsignore
@@ -0,0 +1,52 @@
+*.bak
+*.orig
+*.rej
+*.sav
+*~
+.*.list
+.*.time
+.ccmalloc
+.ppack
+.ext
+.git
+.svn
+.pc
+COPYING.LIB
+ChangeLog.pre-alpha
+ChangeLog.pre1_1
+ChangeLog-1.8.0
+Makefile
+README.fat-patch
+README.v6
+README.atheos
+archive
+autom4te*.cache
+automake
+beos
+config.cache
+config.h
+config.h.in
+config.log
+config.status
+configure
+libruby.so.*
+miniruby
+newdate.rb
+newver.rb
+parse.c
+patches
+patches-master
+pitest.rb
+ppack
+preview
+rbconfig.rb
+rename2.h
+repack
+riscos
+rubicon
+ruby
+ruby-man.rd.gz
+tmp
+web
+y.output
+y.tab.c
View
16 .document
@@ -0,0 +1,16 @@
+# This file determines which files in the
+# Ruby hierarchy will be processed by the RDoc
+# tool when it is given the top-level directory
+# as an argument
+
+# Process all the C source files
+*.c
+
+# the lib/ directory (which has its own .document file)
+
+lib
+
+
+# and some of the ext/ directory (which has its own .document file)
+
+ext
View
555 ChangeLog
@@ -1,3 +1,554 @@
+Sat Mar 1 17:59:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (struct argf): packed ARGF stuffs.
+
+ * ruby.c (proc_options): use ruby_set_inplace_mode().
+
+Sat Mar 1 17:51:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/test/unit/collector/dir.rb (recursive_collect): do not always
+ include all test_*.rb.
+
+Sat Mar 1 14:14:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * development snapshot 1.9.0-1 released.
+
+Sat Mar 1 13:46:26 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * tool/make-snapshot: make prereq uses MINIRUBY.
+
+ * tool/make-snapshot: allow packaging like 1.9.0-1 by second
+ command-line argument.
+
+Sat Mar 1 13:11:03 2008 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/allpairs.rb: new file for all pairs method.
+
+ * test/ruby/test_m17n_comb.rb: use allpairs.rb to reduce test cases.
+
+ * test/ruby/test_sprintf_comb.rb: ditto.
+
+Sat Mar 1 12:34:21 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (sym_inspect): use rb_str_inspect() instead of
+ rb_str_dump(). [ruby-dev:33946]
+
+Sat Mar 1 12:15:42 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval_method.c (rb_get_method_body): ent->method may be freed by
+ GC. [ruby-dev:31819]
+
+ * thread.c (remove_event_hook): should not access freed memory.
+ [ruby-dev:31820]
+
+Sat Mar 01 10:31:19 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (read_all, rb_io_getline_fast): encoding is io_input_encoding.
+
+Sat Mar 1 10:09:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (tr_setup_table, rb_str_split_m, rb_str_chomp_bang):
+ simplified with rb_enc_ascget(). [ruby-dev:33944]
+
+Sat Mar 1 10:01:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_coderange_scan_restartable): should not return
+ offset in the middle of a character.
+
+ * string.c (rb_str_coderange_scan_restartable): should not return
+ invalid cr value.
+
+Sat Mar 1 09:36:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * sprintf.c (rb_str_format): "%#.0o" should keep prefix where
+ "%#.0x" should not.
+
+Sat Mar 1 02:35:08 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (big2str_find_n1): check integer overflow.
+
+Sat Mar 1 00:29:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (rb_enc_dummy_p): bootstrap encodings can not be dummy.
+
+ * encoding.c (rb_enc_ascget): no needs to call rb_enc_precise_mbclen()
+ twice.
+
+Fri Feb 29 23:14:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test
+ updated.
+
+Fri Feb 29 20:58:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * test/ruby/test_iterator.rb (TestIterator::test_enumerator):
+ adjust test for zip behavior reversion.
+
+Fri Feb 29 20:25:07 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_chomp_bang): now works on UTF-16.
+
+ * string.c (tr_setup_table): negation should work on non ASCII
+ compatible strings as well.
+
+ * string.c (rb_str_split_m): awk split should work on non ASCII
+ compatible strings as well.
+
+Fri Feb 29 18:08:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * time.c (time_strftime): format should be ascii compatible.
+
+ * parse.y (rb_intern3): non ASCII compatible symbols.
+
+ * re.c (rb_reg_regsub): add encoding check.
+
+ * string.c (rb_str_chomp_bang): ditto.
+
+ * test/ruby/test_utf16.rb (TestUTF16::test_chomp): raises exception.
+
+Fri Feb 29 15:16:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_rpartition): calculation was done in byte indexing.
+
+ * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_start_with):
+ allow start_with? matching on broken strings.
+
+Fri Feb 29 15:12:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (opt_block_param): command can start just after block param
+ definition. [ruby-list:44479]
+
+Fri Feb 29 03:22:19 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * test/ruby/test_time.rb (test_readers): fix typo.
+ (test_strftime): "UTC" is also ok for time.gmtime.strftime("%Z").
+
+Fri Feb 29 02:50:07 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_new): remove encoding assumption of empty string.
+
+ * hash.c ( rb_f_getenv, env_fetch, env_inspect): result of ENV should
+ be always ASCII-8BIT.
+
+ * object.c (nil_to_s): nil.to_s should be US-ASCII.
+
+Fri Feb 29 02:24:22 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk.rb: forgot to update RELEASE_DATE
+
+ * ext/tk/lib/tk.rb, ext/tk/lib/tk/text.rb,
+ ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: remove adhoc check
+ of Ruby's features (use existence of some classes instead of
+ comparing with RUBY_VERSION)
+
+ * ext/tk/lib/tk/root.rb, ext/tk/lib/tk/autoload.rb: make TkRoot
+ (Tk::Root) unswitchable
+
+ * ext/tk/lib/multi-tk.rb: partial bug fix (still not work!!)
+
+Thu Feb 28 23:37:12 2008 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BIT
+ for charset unspecified non-text data.
+
+Thu Feb 28 22:19:14 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (enc_capable): IMMEDIATE_P doesn't include Qnil and Qfalse.
+ use SPECIAL_CONST_P.
+
+Thu Feb 28 19:45:52 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (enc_find): check type of argument and convert to String
+ if it is StringValue. [ruby-cvs:22866]
+
+Thu Feb 28 18:07:52 2008 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): setup encoding
+ by charset.
+ (OpenURI::Meta#meta_add_field): call meta_setup_encoding when
+ content-type.
+
+Thu Feb 28 15:29:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * io.c (rb_io_getline_fast): scan coderange.
+
+Thu Feb 28 14:36:46 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_str_copy): removed.
+
+Thu Feb 28 13:51:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (stack_check): made flag per threads.
+
+ * thread.c (rb_thread_set_raised, rb_thread_reset_raised): prefixed.
+
+Thu Feb 28 11:43:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_flock): immediately returns on EAGAIN if
+ non-blocking. [ruby-core:15672]
+
+Thu Feb 28 11:23:50 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_getline_1): get rid of segfault. [ruby-dev:33938]
+
+Thu Feb 28 11:19:51 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_reverse_bang): removed unsed variables.
+
+ * include/ruby/encoding.h (rb_str_coderange_scan_restartable): added
+ prototype.
+
+ * string.c (rb_str_coderange_scan_restartable, rb_str_times): removed
+ unsed variables.
+
+ * string.c (rb_str_reverse_bang): ditto
+
+ * string.c (rb_enc_str_copy): unused now. may be used in future?
+
+Thu Feb 28 03:03:32 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
+
+ * ext/tk/lib/tk.rb, ext/tk/lib/*: make default widget set
+ switchable between Tk (standard Tcl/Tk widget set) and
+ Ttk (Tile). Initial default widget set is Tk. Now, toplevel
+ widget classes are removed and defined as aliases.
+ For example, "TkButton" is an alias of the "Tk::Button" class.
+ Those aliases are replaced when switching default widget set.
+ "Tk.default_widget_set=" is the method for switching default
+ widget set. "Tk.default_widget_set = :Ttk" defines Ttk (Tile)
+ widget set as default. It means that "TkButton" denotes
+ "Tk::Tile::Button" class. And then, "TkButton.new" creates
+ a Tk::Tile::Button widget. Of course, you can back to use
+ standard Tk widgets as the default widget set by calling
+ "Tk.default_widget_set = :Tk", whenever you want. Based on
+ thie feature, you can use Ttk widget styling engine on your
+ old Ruby/Tk application without modifying its source, if you
+ don'tuse widget options unsupported on Ttk widgets (At first,
+ call "Tk.default_widget_set = :Ttk", and next load and run
+ your application).
+ This is one step for supporting Tcl/Tk8.5 features.
+
+Wed Feb 27 22:55:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_coderange_scan_restartable): coderange scaning
+ for partial read.
+
+ * io.c (read_all): set coderange when not convert encoding.
+
+Wed Feb 27 03:55:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb, enc/make_encmake.rb: load current mkmf.rb even if
+ cross-compiling.
+
+ * ext/extmk.rb, enc/make_encmake.rb, lib/mkmf.rb: need to be 1.8
+ compatible for cross-compiling.
+
+Tue Feb 26 16:53:13 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * misc/ruby-mode.el (ruby-calculate-indent): should distinguish
+ comment and # in strings. [ruby-dev:33874]
+
+Tue Feb 26 16:41:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (combi_len, rb_ary_product): check for overflow.
+ [ruby-Bugs-18355]
+
+Tue Feb 26 16:38:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (recursive_cmp): compare minimal length parts.
+
+Tue Feb 26 16:06:00 2008 Technorama Ltd. <oss-ruby@technorama.net>
+
+ * ext/openssl/ossl_{ec,dh,dsa,rsa}.c: Remove useless warnings.
+
+ * ext/openssl/ossl_asn1.c: Simplify code.
+
+ * ext/openssl/ossl_ssl_session.c Fix compiler warnings.
+ Undefine #id if SSL_SESSION_get_id is not supported.
+
+Tue Feb 26 15:50:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (value_expr_gen): removed inappropriate warning.
+ [ruby-core:15660]
+
+Tue Feb 26 15:43:42 2008 Tanaka Akira <akr@fsij.org>
+
+ * parse.y (tokadd_escape): refactored. [ruby-core:15657]
+
+Tue Feb 26 15:30:36 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_eql, rb_ary_cmp): get rid of stack overflow with
+ self-recursive constructs. [ruby-Bugs-18356]
+
+Tue Feb 26 01:16:01 2008 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.
+ (ROBJECT_IVPTR): renamed from ROBJECT_PTR.
+
+ * variable.c: follow the above renaming.
+
+ * object.c: ditto.
+
+ * gc.c: ditto.
+
+ * marshal.c: ditto.
+
+Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net>
+
+ * ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb:
+ Commit patch #9280 from Akinori MUSHA.
+ Simplify the OpenSSL::Digest class and make use of the
+ existing Digest framework.
+ Enhance performance.
+
+Mon Feb 25 15:33:29 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * bignum.c (big2str_karatsuba): initialize cache if not initialized.
+
+ * bignum.c (Init_Bignum): delayed initializing cache.
+ [ruby-dev:33930]
+
+Mon Feb 25 13:40:03 2008 Tanaka Akira <akr@fsij.org>
+
+ * process.c (Init_process): share bignum objects for RLIM_INFINITY,
+ RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal.
+
+Mon Feb 25 10:41:41 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * encoding.c (Encoding#dummy): minor grammatical fixes
+ in rdoc documentation.
+
+Mon Feb 25 00:01:03 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cygwin/GNUmakefile.in (clean-local): should be double-colon.
+
+Sun Feb 24 23:39:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk, {bcc,win}32/Makefile.sub (clean-local): remove
+ intermediate files.
+
+ * cygwin/GNUmakefile.in (clean-local): remove def file.
+
+Sun Feb 24 06:49:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * debug.c (ruby_set_debug_option): separated ruby_each_words().
+
+ * util.c (ruby_each_words): extracted from ruby_set_debug_option().
+
+ * ruby.c (enable_option, disable_option): allow all for all known
+ features.
+
+ * ruby.c (proc_options): generalized enable/disable options.
+
+ * ruby.c (ruby_init_gems): take enabled flag. [ruby-core:14840]
+
+ * ruby.c (process_options): added --disable-rubyopt flag.
+
+ * include/ruby/util.h (ruby_each_words): prototype.
+
+Sun Feb 24 05:25:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (proc_options): check if argument for -E exists.
+
+Sun Feb 24 05:09:43 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * misc/ruby-style.el (ruby-style-label-indent): fix for labels inside
+ blocks in switch.
+
+Sun Feb 24 03:52:58 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * util.c (valid_filename): use O_EXCL to get rid of clobbering
+ existing files in race conditions.
+
+Sat Feb 23 21:36:13 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/win32ole/win32ole.c (ole_init_cp): should return value.
+
+Sat Feb 23 20:16:05 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (str_sublen): removed.
+
+ * string.c (rb_str_reverse, rb_str_reverse_bang): use
+ single_byte_optimizable.
+
+Sat Feb 23 19:25:18 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_cr_str_copy_for_substr): renamed from
+ rb_enc_cr_str_copy.
+
+ * string.c: use rb_enc_cr_str_copy_for_substr and keep coderange.
+
+Sat Feb 23 18:50:17 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
+
+ * ext/win32ole/win32ole.c (ole_encoding2cp): remove US-ASCII
+ mapping.
+
+Sat Feb 23 01:09:47 2008 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rlimit_resource_type): new function.
+ (rlimit_resource_value): new function.
+ (proc_getrlimit): use rlimit_resource_type to accept
+ symbol and string as resource type.
+ (proc_setrlimit): use rlimit_resource_type and rlimit_resource_value
+ to accept symbol and string as resource type and values.
+
+Fri Feb 22 21:12:42 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_cr_str_copy): check string's coderange is 7bit or
+ valid.
+
+Fri Feb 22 19:50:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * bignum.c (BIGZEROP): fix for longer Bignum zeros. [ruby-Bugs-17454]
+
+Fri Feb 22 15:47:36 2008 Tanaka Akira <akr@fsij.org>
+
+ * encoding.c (rb_enc_mbclen): return minlen instead of 1 when
+ a character is not found properly.
+
+ * string.c (rb_enc_strlen): round up string length with fixed
+ multibyte encoding such as UTF-32.
+ (rb_enc_strlen_cr): ditto.
+ (rb_str_substr): fix substring with fixed multibyte encoding.
+ (rb_str_justify): check number of characters.
+
+Fri Feb 22 12:11:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_inspect): string of ascii incompatible encoding
+ should be escaped and returned as US-ASCII encoding.
+
+Fri Feb 22 11:16:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_substr): copy encoding although empty string.
+
+Fri Feb 22 04:48:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_str_times): empty string's coderange is CODERANGE_7BIT.
+
+ * string.c (rb_str_substr): ditto.
+
+ * encoding.c (rb_enc_compatible): empty string is compatible with not
+ only nonasciicompatible strings. [ruby-dev:33895]
+
+Thu Feb 21 17:15:15 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * transcode.c: Added basic support for passing options to String#encode
+ via a hash. Currently only one option, with one value, is supported:
+ invalid: :ignore (dropping invalid byte sequences instead of
+ producing an error). Option naming is not yet stable!
+
+ * test/ruby/test_transcode.rb: Added a single test for invalid: :ignore
+ option. Not more tests because most data does not yet distinguish
+ between INVALID and UNKNOWN.
+
+Thu Feb 21 16:35:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * array.c (rb_ary_unshift_m): expands enough for argc. [ruby-dev:33880]
+
+Thu Feb 21 14:49:40 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (argf_set_encoding): uses current_file after check if next
+ input is available.
+
+Thu Feb 21 14:13:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_f_putc): invoke stdout method so that redefining putc
+ may take effect. [ruby-talk:291844]
+
+ * io.c (rb_f_puts): ditto.
+
+Thu Feb 21 11:10:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c: replace rb_enc_copy by rb_enc_cr_str_copy or
+ rb_enc_cr_str_exact_copy.
+
+Thu Feb 21 10:35:04 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * include/ruby/encoding.h (rb_enc_asciicompat): dummy encoding is not
+ ascii compatible. [ruby-dev:33878]
+
+Thu Feb 21 00:01:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (RPATHFLAG): -R option of HP-UX ld is not for runtime
+ load path. [ruby-list:44600]
+
+Wed Feb 20 23:55:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_map_errno): exported.
+
+Wed Feb 20 23:28:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/readline/extconf.rb (rl_event_hook): workaround for native
+ windows.
+
+Wed Feb 20 19:42:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * encoding.c (rb_enc_associate_index): doesn't clear coderange
+ when new encoding equals to old one.
+
+Wed Feb 20 19:15:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy.
+ this also copy coderange when ptr and len is equal.
+
+ * string.c (rb_enc_cr_str_copy): added for wrapper for rb_enc_copy.
+ this always copy coderange.
+
+ * string.c (str_replace_shared): use rb_enc_str_copy.
+
+ * string.c (str_new3): don't rb_enc_copy because encoding is copied
+ at str_replace_shared.
+
+Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * instruby.rb (parse_args): added --dir-mode, --script-mode and
+ --cmd-type options. [ruby-dev:33816]
+
+ * instruby.rb (parse_args): added bin-arch and bin-comm to install
+ type, for compiled files and script files.
+
+ * instruby.rb (parse_args): deal with make style command line macros,
+ and count as long style options if prefixed with INSTALL_.
+
+ * instruby.rb (makedirs): use $dir_mode. [ruby-dev:33805]
+
+ * instruby.rb (open_for_install): set file mode, which is now
+ permission mode instead of access mode.
+
+ * instruby.rb (bin-comm): installs scripts with replacing shebang
+ lines.
+
+Wed Feb 20 10:04:22 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (open_key_args): set arg->io even if no options passed.
+ [ruby-dev:33072]
+
+Tue Feb 19 21:11:49 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * string.c (rb_enc_strlen_cr): get length with coderange scan.
+
+ * string.c (str_strlen): use rb_enc_strlen_cr. [ruby-dev:33849]
+
+Tue Feb 19 20:49:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_raise_jump): moved adjustment for control frame.
+
+Tue Feb 19 18:34:32 2008 Tanaka Akira <akr@fsij.org>
+
+ * gc.c (STACK_LENGTH) [SPARC] : 0x80 offset removed. [ruby-dev:33857]
+
+Tue Feb 19 14:27:32 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_event): prevent polling. based on
+ a patch from error errorsson in [ruby-Bugs-17675].
+
+Tue Feb 19 11:14:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (ruby_exec_node): no thread starts inside iseq compilation.
+
+ * eval.c (rb_f_raise): skip current control frame. [ruby-core:15589]
+
+ * insns.def (opt_div): raise as the ordinary method. [ruby-core:15589]
+
Mon Feb 18 15:16:30 2008 Tanaka Akira <akr@fsij.org>
* string.c (rb_str_each_line): fix newline size.
@@ -45,7 +596,7 @@ Sun Feb 17 15:25:08 2008 NARUSE, Yui <naruse@ruby-lang.org>
* encoding.c (ENC_CODERANGE_AND): added.
- * string.c (rb_str_plus, srb_str_times): keep coderange.
+ * string.c (rb_str_plus, rb_str_times): keep coderange.
* parse.y (STR_NEW0) use rb_usascii_str_new.
@@ -4757,7 +5308,7 @@ Fri Dec 21 18:40:54 2007 Koichi Sasada <ko1@atdot.net>
* bootstraptest/test_io.rb, test_knownbug.rb: move a fixed test.
-Fri Dec 21 17:56:30 2007 <nagai@orca16.orcabay.ddo.jp>
+Fri Dec 21 17:56:30 2007 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/tcltklib.c: provisional support on Ruby-VM.
View
3 Makefile.in
@@ -197,11 +197,10 @@ lex.c: keywords
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
clean-local::
- @$(RM) ext/extinit.c ext/extinit.$(OBJEXT)
+ @$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
distclean-local::
@$(RM) ext/config.cache $(RBCONFIG)
- @-$(RM) ext/ripper/y.output
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
View
71 array.c
@@ -2,7 +2,7 @@
array.c -
- $Author: naruse $
+ $Author: nobu $
created at: Fri Aug 6 09:46:12 JST 1993
Copyright (C) 1993-2007 Yukihiro Matsumoto
@@ -604,12 +604,12 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_unshift_m(int argc, VALUE *argv, VALUE ary)
{
- long len = RARRAY(ary)->len;
+ long len;
if (argc == 0) return ary;
rb_ary_modify(ary);
- if (RARRAY(ary)->aux.capa <= RARRAY_LEN(ary)+argc) {
- RESIZE_CAPA(ary, RARRAY(ary)->aux.capa + ARY_DEFAULT_SIZE);
+ if (RARRAY(ary)->aux.capa <= (len = RARRAY(ary)->len) + argc) {
+ RESIZE_CAPA(ary, len + argc + ARY_DEFAULT_SIZE);
}
/* sliding items */
@@ -2349,6 +2349,19 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
return rb_exec_recursive(recursive_equal, ary1, ary2);
}
+static VALUE
+recursive_eql(VALUE ary1, VALUE ary2, int recur)
+{
+ long i;
+
+ if (recur) return Qfalse;
+ for (i=0; i<RARRAY_LEN(ary1); i++) {
+ if (!rb_eql(rb_ary_elt(ary1, i), rb_ary_elt(ary2, i)))
+ return Qfalse;
+ }
+ return Qtrue;
+}
+
/*
* call-seq:
* array.eql?(other) -> true or false
@@ -2431,6 +2444,26 @@ rb_ary_includes(VALUE ary, VALUE item)
}
+static VALUE
+recursive_cmp(VALUE ary1, VALUE ary2, int recur)
+{
+ long i, len;
+
+ if (recur) return Qnil;
+ len = RARRAY_LEN(ary1);
+ if (len > RARRAY_LEN(ary2)) {
+ len = RARRAY_LEN(ary2);
+ }
+ for (i=0; i<len; i++) {
+ VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
+ if (v != INT2FIX(0)) {
+ return v;
+ }
+ }
+ return Qundef;
+}
+
+
/*
* call-seq:
* array <=> other_array -> -1, 0, +1
@@ -2454,19 +2487,13 @@ rb_ary_includes(VALUE ary, VALUE item)
VALUE
rb_ary_cmp(VALUE ary1, VALUE ary2)
{
- long i, len;
+ long len;
+ VALUE v;
ary2 = to_ary(ary2);
- len = RARRAY_LEN(ary1);
- if (len > RARRAY_LEN(ary2)) {
- len = RARRAY_LEN(ary2);
- }
- for (i=0; i<len; i++) {
- VALUE v = rb_funcall(rb_ary_elt(ary1, i), id_cmp, 1, rb_ary_elt(ary2, i));
- if (v != INT2FIX(0)) {
- return v;
- }
- }
+ if (ary1 == ary2) return INT2FIX(0);
+ v = rb_exec_recursive(recursive_cmp, ary1, ary2);
+ if (v != Qundef) return v;
len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2);
if (len == 0) return INT2FIX(0);
if (len > 0) return INT2FIX(1);
@@ -3058,7 +3085,11 @@ combi_len(long n, long k)
if (k < 0) return 0;
val = 1;
for (i=1; i <= k; i++,n--) {
+ long m = val;
val *= n;
+ if (val < m) {
+ rb_raise(rb_eRangeError, "too big for combination");
+ }
val /= i;
}
return val;
@@ -3171,8 +3202,12 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
/* Compute the length of the result array; return [] if any is empty */
for (i = 0; i < n; i++) {
- resultlen *= RARRAY_LEN(arrays[i]);
- if (resultlen == 0) return rb_ary_new2(0);
+ long k = RARRAY_LEN(arrays[i]), l = resultlen;
+ if (k == 0) return rb_ary_new2(0);
+ resultlen *= k;
+ if (resultlen < k || resultlen < l || resultlen / k != l) {
+ rb_raise(rb_eRangeError, "too big to product");
+ }
}
/* Otherwise, allocate and fill in an array of results */
@@ -3218,7 +3253,7 @@ Init_Array(void)
{
#if WITH_OBJC
rb_cArray = rb_define_class("Array",
- rb_objc_import_class((Class)objc_getClass("NSArray")));
+ rb_objc_import_class((Class)objc_getClass("NSMutableArray")));
#else
rb_cArray = rb_define_class("Array", rb_cObject);
#endif
View
3 bcc32/Makefile.sub
@@ -517,12 +517,11 @@ post-install-doc::
clean-local::
@$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
+ @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
distclean-local::
@$(RM) ext\config.cache $(RBCONFIG:/=\)
- @$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF)
@$(RM) $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
- @-$(RM) ext\ripper\y.output
ext/extinit.obj: ext/extinit.c $(SETUP)
$(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
View
24 bignum.c
@@ -2,7 +2,7 @@
bignum.c -
- $Author: matz $
+ $Author: nobu $
created at: Fri Jun 10 00:48:55 JST 1994
Copyright (C) 1993-2007 Yukihiro Matsumoto
@@ -36,7 +36,19 @@ VALUE rb_cBignum;
#define BIGLO(x) ((BDIGIT)((x) & (BIGRAD-1)))
#define BDIGMAX ((BDIGIT)-1)
-#define BIGZEROP(x) (RBIGNUM_LEN(x) == 0 || (RBIGNUM_LEN(x) == 1 && BDIGITS(x)[0] == 0))
+#define BIGZEROP(x) (RBIGNUM_LEN(x) == 0 || \
+ (BDIGITS(x)[0] == 0 && \
+ (RBIGNUM_LEN(x) == 1 || bigzero_p(x))))
+
+static int
+bigzero_p(VALUE x)
+{
+ long i;
+ for (i = 0; i < RBIGNUM_LEN(x); ++i) {
+ if (BDIGITS(x)[i]) return 0;
+ }
+ return 1;
+}
#define RBIGNUM_SET_LEN(b,l) \
((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
@@ -725,6 +737,7 @@ ceil_log2(register unsigned long x)
#define MAX_BIG2STR_TABLE_ENTRIES 64
static VALUE big2str_power_cache[35][MAX_BIG2STR_TABLE_ENTRIES];
+static int power_cache_initialized = 0;
static void
power_cache_init(void)
@@ -816,6 +829,9 @@ big2str_find_n1(VALUE x, int base)
else if (BIGZEROP(x)) {
return 0;
}
+ else if (RBIGNUM_LEN(x) >= LONG_MAX/BITSPERDIG) {
+ rb_raise(rb_eRangeError, "bignum too big to convert into `string'");
+ }
else {
bits = BITSPERDIG*RBIGNUM_LEN(x);
}
@@ -889,6 +905,10 @@ big2str_karatsuba(VALUE x, int base, char* ptr,
return big2str_orig(x, base, ptr, len, hbase, trim);
}
+ if (!power_cache_initialized) {
+ power_cache_init();
+ power_cache_initialized = 1;
+ }
b = power_cache_get_power(base, n1, &m1);
bigdivmod(x, b, &q, &r);
lh = big2str_karatsuba(q, base, ptr, (len - m1)/2,
View
4 bootstraptest/test_io.rb
@@ -69,3 +69,7 @@
File.unlink(tmpname)
:ok
}
+
+assert_normal_exit %q{
+ ARGF.set_encoding "foo"
+}
View
11 bootstraptest/test_knownbug.rb
@@ -31,11 +31,6 @@ class C
C.new.foo
}, '[ruby-core:14813]'
-# test is not written...
-flunk '[ruby-dev:31819] rb_clear_cache_by_class'
-flunk '[ruby-dev:31820] valgrind set_trace_func'
-flunk '[ruby-dev:32746] Invalid read of size 1'
-
assert_equal 'ok', %q{
class X < RuntimeError;end
x = [X]
@@ -46,12 +41,6 @@ class X < RuntimeError;end
end
}, '[ruby-core:14537]'
-assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
-
-assert_normal_exit %q{
- File.read("empty", nil, nil, {})
-}, '[ruby-dev:33072]'
-
assert_normal_exit %q{
"abc".gsub(/./, "a" => "z")
}
View
2 bootstraptest/test_marshal.rb
@@ -1,5 +1,5 @@
assert_normal_exit %q{
- Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| })
+ Marshal.load(Marshal.dump({"k"=>"v"}), lambda {|v| v})
}
View
2 bootstraptest/test_syntax.rb
@@ -765,3 +765,5 @@ def foo
next p(i)
end
}
+
+assert_valid_syntax('1.times {|i|print (42),1;}', '[ruby-list:44479]')
View
19 bs.c
@@ -356,9 +356,6 @@ undecorate_struct_type(const char *src, char *dest, size_t dest_len,
return false;
}
-static bs_element_retval_t default_func_retval =
- { "v", BS_CARRAY_ARG_UNDEFINED, -1, false };
-
static bool
_bs_parse(const char *path, char **loaded_paths,
bs_parse_options_t options, bs_parse_callback_t callback,
@@ -716,7 +713,13 @@ _bs_parse(const char *path, char **loaded_paths,
func->variadic = get_boolean_attribute(reader, "variadic", false);
func->args_count = 0;
func->args = NULL;
- func->retval = &default_func_retval;
+ func->retval = NULL;
+
+ if (xmlTextReaderIsEmptyElement(reader)) {
+ bs_element = func;
+ bs_element_type = BS_ELEMENT_FUNCTION;
+ func = NULL;
+ }
break;
}
@@ -839,7 +842,7 @@ _bs_parse(const char *path, char **loaded_paths,
BAIL("function pointer return value defined more than once");
}
else if (func != NULL) {
- if (func->retval != NULL && func->retval != &default_func_retval)
+ if (func->retval != NULL)
BAIL("function '%s' return value defined more than once",
func->name);
}
@@ -1007,12 +1010,6 @@ _bs_parse(const char *path, char **loaded_paths,
ASSERT_ALLOC(func->args);
memcpy(func->args, args, len);
}
- if (func->retval == NULL || func->retval == &default_func_retval) {
- func->retval =
- (bs_element_retval_t *)malloc(sizeof(bs_element_retval_t));
- memcpy(func->retval, &default_func_retval,
- sizeof(bs_element_retval_t));
- }
bs_element = func;
bs_element_type = BS_ELEMENT_FUNCTION;
View
2 bs.h
@@ -68,7 +68,7 @@ typedef struct {
char *name;
char *type;
char *tollfree;
- CFTypeID type_id;
+ CFTypeID type_id; /* 0 if unknown */
} bs_element_cftype_t;
typedef struct {
View
42 class.c
@@ -20,7 +20,7 @@ extern st_table *rb_class_tbl;
#define VISI(x) ((x)&NOEX_MASK)
#define VISI_CHECK(x,f) (VISI(x) == (f))
-static VALUE
+static VALUE
class_init(VALUE obj)
{
RCLASS(obj)->ptr = ALLOC(rb_classext_t);
@@ -64,7 +64,9 @@ rb_objc_import_class(Class ocklass)
RCLASS_M_TBL(rbklass) = st_init_numtable();
nameid = rb_intern(class_getName(ocklass));
-
+
+ if (rb_cObject != 0 && RCLASS_IV_TBL(rb_cObject) != NULL)
+ st_delete(RCLASS_IV_TBL(rb_cObject), (st_data_t*)&nameid, NULL);
rb_const_set((rb_cObject != 0 ? rb_cObject : rbklass), nameid, rbklass);
/* FIXME do we need to maintain rb_class_tbl anymore? */
@@ -111,10 +113,17 @@ rb_objc_alloc_class(const char *name, VALUE super, VALUE flags, VALUE klass)
snprintf(ocname, sizeof ocname, "RBAnonymous%ld", ++anon_count);
}
else {
- long count = 1;
- snprintf(ocname, sizeof ocname, "RB%s", name);
- while (objc_getClass(ocname) != NULL)
- snprintf(ocname, sizeof ocname, "RB%s%d", name, ++count);
+ if (objc_getClass(name) != NULL) {
+ long count = 1;
+ snprintf(ocname, sizeof ocname, "RB%s", name);
+ while (objc_getClass(ocname) != NULL)
+ snprintf(ocname, sizeof ocname, "RB%s%d", name, ++count);
+ rb_warning("can't create `%s' as an Objective-C class, because " \
+ "it already exists, instead using `%s'", name, ocname);
+ }
+ else {
+ strncpy(ocname, name, sizeof ocname);
+ }
}
ocsuper = super == 0 ? NULL : RCLASS_OCID(super);
@@ -576,10 +585,6 @@ include_class_new(VALUE module, VALUE super)
RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
RCLASS_M_TBL(klass) = RCLASS_M_TBL(module);
RCLASS_SUPER(klass) = super;
-#if WITH_OBJC
-//printf("klass %p super %p\n", RCLASS(klass)->ocklass, RCLASS(super)->ocklass);
-// class_setSuperclass(RCLASS(klass)->ocklass, RCLASS(super)->ocklass);
-#endif
if (TYPE(module) == T_ICLASS) {
RBASIC(klass)->klass = RBASIC(module)->klass;
}
@@ -634,17 +639,7 @@ rb_include_module(VALUE klass, VALUE module)
break;
}
}
-#if WITH_OBJC
- {
- VALUE c2 = include_class_new(module, RCLASS_SUPER(c));
- //class_setSuperclass(RCLASS(c)->ocklass, RCLASS(c2)->ocklass);
- //class_setSuperclass(RCLASS(c2)->ocklass, RCLASS(RCLASS_SUPER(c2))->ocklass);
- //OCCLASS_WEAK_COPY_METHODS(RCLASS(c2)->ocklass, RCLASS(module)->ocklass);
- c = RCLASS_SUPER(c) = c2;
- }
-#else
c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
-#endif
changed = 1;
skip:
module = RCLASS_SUPER(module);
@@ -972,7 +967,7 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
VALUE
rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
{
- VALUE recur, ary, klass, klass_orig;
+ VALUE recur, ary, klass;
st_table *list;
rb_scan_args(argc, argv, "01", &recur);
@@ -980,7 +975,6 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
recur = Qtrue;
}
klass = CLASS_OF(obj);
- klass_orig = rb_obj_class(obj);
list = st_init_numtable();
if (klass && FL_TEST(klass, FL_SINGLETON)) {
st_foreach(RCLASS_M_TBL(klass), method_entry, (st_data_t)list);
@@ -996,10 +990,6 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
st_foreach(list, ins_methods_i, ary);
st_free_table(list);
-#if WITH_OBJC
- //rb_objc_methods(ary, RCLASS(obj)->ocklass);
-#endif
-
return ary;
}
View
4 common.mk
@@ -311,7 +311,7 @@ clean: clean-ext clean-local clean-enc
clean-local::
@$(RM) $(OBJS) $(MINIOBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
@$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT) $(ARCHFILE) .*.time
- @$(RM) *.inc $(GOLFOBJS)
+ @$(RM) *.inc $(GOLFOBJS) y.tab.c y.output
clean-ext:
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) clean
clean-enc:
@@ -321,7 +321,7 @@ distclean: distclean-ext distclean-local distclean-enc
distclean-local:: clean-local
@$(RM) $(MKFILES) config.h rbconfig.rb yasmdata.rb encdb.h
@$(RM) config.cache config.log config.status config.status.lineno $(PRELUDES)
- @$(RM) *~ *.bak *.stackdump core *.core gmon.out y.tab.c y.output $(PREP)
+ @$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
distclean-ext:
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" $(EXTMK_ARGS) distclean
# -$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h
View
2 compile.c
@@ -1997,7 +1997,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
ADD_INSN1(anchor, line, newarray_named_args, INT2FIX(len));
else
#endif
- ADD_INSN1(anchor, line, newarray, INT2FIX(len));
+ ADD_INSN1(anchor, line, newarray, INT2FIX(len));
}
APPEND_LIST(ret, anchor);
}
View
107 configure.in
@@ -95,7 +95,12 @@ AC_CANONICAL_TARGET
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.
-ifelse(currently,disabled, [
+case "$target_os" in
+ darwin*)
+ target_os=`echo $target_os | sed 's/\..*/.0/'`
+ ;;
+esac
+
dnl checks for fat-binary
AC_ARG_ENABLE(fat-binary,
[ --enable-fat-binary=ARCHS
@@ -103,7 +108,7 @@ AC_ARG_ENABLE(fat-binary,
ARCHS is a comma-delimited list of architectures for
which to build; if ARCHS is omitted, then the package
will be built for all architectures supported by the
- platform ("ppc" for MacOS/X and Darwin; "ppc,i386"
+ platform ("ppc,i386" for MacOS/X and Darwin; "ppc,i386"
for Rhapsody; "m68k,i386,sparc" for OpenStep;
"m68k,i386,sparc,hppa" for NextStep); if this option
is disabled or omitted entirely, then the package
@@ -122,7 +127,7 @@ if test "$fat_binary" != no; then
# Choose a default set of architectures based upon platform.
case "$target_os" in
darwin*)
- TARGET_ARCHS="ppc"
+ TARGET_ARCHS="ppc i386"
;;
rhapsody*)
TARGET_ARCHS="ppc i386"
@@ -142,14 +147,13 @@ if test "$fat_binary" != no; then
AC_MSG_RESULT([$TARGET_ARCHS])
# /usr/lib/arch_tool -archify_list $TARGET_ARCHS
- ARCH_FLAG=
+ ARCH_FLAG=""
for archs in $TARGET_ARCHS
do
ARCH_FLAG="$ARCH_FLAG -arch $archs"
done
AC_DEFINE(NEXT_FAT_BINARY)
fi
-], [fat_binary=no])
case $target_cpu in
i?86) frame_address=yes;;
@@ -419,7 +423,13 @@ RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)
RUBY_FUNC_ATTRIBUTE(stdcall)
RUBY_FUNC_ATTRIBUTE(cdecl)
-RUBY_FUNC_ATTRIBUTE(fastcall)
+case "$target_os" in
+ darwin*)
+ ;;
+ *)
+ RUBY_FUNC_ATTRIBUTE(fastcall)
+ ;;
+esac
AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
[rb_cv_ruby_extern=no
@@ -462,6 +472,29 @@ AC_ARG_ENABLE(pthread,
[ --enable-pthread use pthread library.],
[enable_pthread=$enableval], [enable_pthread=$enable_pthread_default])
+AC_ARG_ENABLE(framework,
+ [ --enable-framework build as framework.],
+ [enable_framework=$enableval], [enable_framework=no])
+
+AC_ARG_WITH(framework_name,
+ [ --with-framework-name=NAME framework name (default is MacRuby)],
+ [framework_name=$withval],
+ [framework_name='MacRuby'])
+
+AC_ARG_WITH(framework_path,
+ [ --with-framework-path=DIR framework install path (default is /Library/Frameworks)],
+ [framework_path=$withval],
+ [framework_path='/Library/Frameworks'])
+
+enable_shared_default="no"
+
+if test x"$enable_framework" = xyes; then
+ echo "*** will build as a framework, as $framework_path/$framework_name.framework"
+ macruby_version=`grep "define MACRUBY_VERSION" version.h | awk '{print $4}'`
+ prefix="$framework_path/$framework_name.framework/Versions/$macruby_version/usr"
+ enable_shared_default="yes"
+fi
+
dnl Checks for libraries.
case "$target_os" in
nextstep*) ;;
@@ -473,7 +506,7 @@ darwin*) LIBS="-lobjc -framework Foundation -lffi -lauto $LIBS"
AC_DEFINE(HAVE_BRIDGESUPPORT_FRAMEWORK, 1)
else
LIBS="-lxml2 $LIBS"
- CFLAGS="-I/usr/include/libxml2 $CFLAGS"
+ CFLAGS="$CFLAGS -I/usr/include/libxml2 $CFLAGS"
AC_DEFINE(HAVE_BRIDGESUPPORT_FRAMEWORK, 0)
AC_LIBOBJ([bs])
fi
@@ -1094,11 +1127,23 @@ if test "$with_dln_a_out" != yes; then
esac
fi
+
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath embed run path into extension libraries.],
+ [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
+ if test "$enable_rpath" = yes; then
+ LIBPATHFLAG=" -L%1\$-s"
+ RPATHFLAG=" ${linker_flag}-R%1\$-s"
+ fi
+
case "$target_os" in
hpux*) DLDFLAGS="$DLDFLAGS -E"
: ${LDSHARED='ld -b'}
XLDFLAGS="$XLDFLAGS -Wl,-E"
: ${LIBPATHENV=SHLIB_PATH}
+ if test "$rb_cv_prog_gnu_ld" = no; then
+ RPATHFLAG=' +b %1$-s'
+ fi
rb_cv_dlopen=yes;;
solaris*) if test "$GCC" = yes; then
: ${LDSHARED='$(CC) -shared'}
@@ -1208,14 +1253,6 @@ if test "$with_dln_a_out" != yes; then
*) : ${LDSHARED='ld'} ;;
esac
AC_MSG_RESULT($rb_cv_dlopen)
-
- AC_ARG_ENABLE(rpath,
- [ --disable-rpath embed run path into extension libraries.],
- [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
- if test "$enable_rpath" = yes; then
- LIBPATHFLAG=" -L%1\$-s"
- RPATHFLAG=" ${linker_flag}-R%1\$-s"
- fi
fi
if test "${LDSHAREDXX}" = ""; then
case "${LDSHARED}" in
@@ -1384,9 +1421,12 @@ if test "$prefix" = NONE; then
prefix=$ac_default_prefix
fi
-#if test "$fat_binary" != no ; then
-# CFLAGS="$CFLAGS $ARCH_FLAG"
-#fi
+if test x"$fat_binary" != xno ; then
+ echo "*** building as a fat binary, with arch flags $ARCH_FLAG"
+ CFLAGS="$CFLAGS $ARCH_FLAG"
+ LDSHARED="$LDSHARED $ARCH_FLAG"
+ LIBRUBY_LDSHARED="LIBRUBY_LDSHARED $ARCH_FLAG"
+fi
if test x"$cross_compiling" = xyes; then
test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
@@ -1423,11 +1463,11 @@ LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR).$(TEENY)'
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so'
-ENABLE_SHARED=no
+ENABLE_SHARED=yes
AC_ARG_ENABLE(shared,
[ --enable-shared build a shared library for Ruby. ],
- [enable_shared=$enableval])
+ [enable_shared=$enableval], [enable_shared=$enable_shared_default])
if test "$enable_shared" = 'yes'; then
LIBRUBY='$(LIBRUBY_SO)'
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
@@ -1730,6 +1770,7 @@ RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}.${TEENY}"
AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
+AC_SUBST(enable_framework)dnl
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
AC_SUBST(sitedir)dnl
@@ -1739,16 +1780,24 @@ configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
if test "$fat_binary" != no ; then
- arch="fat-${target_os}"
- AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
- "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
-
- AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
- "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
- "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
- AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
+ case "$target_os" in
+ darwin*)
+ arch="universal-${target_os}"
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+ ;;
+ *)
+ arch="fat-${target_os}"
+ AC_DEFINE_UNQUOTED(RUBY_THIN_ARCHLIB,
+ "${RUBY_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+
+ AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
+ "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
+ "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
+ ;;
+ esac
else
arch="${target_cpu}-${target_os}"
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
View
3 cygwin/GNUmakefile.in
@@ -67,6 +67,9 @@ $(LIBRUBY_SO): $(RUBYDEF)
$(RUBYDEF): $(LIBRUBY_A) $(PREP) $(RBCONFIG)
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
+
+clean-local::
+ @$(RM) $(RUBYDEF)
endif
ifeq (@target_os@,cygwin)
View
36 debug.c