1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-05-15 11:55:52 +00:00
parent 39da1b6369
commit 3a47cf3395
212 changed files with 846 additions and 846 deletions

View file

@ -21,7 +21,7 @@ Sat May 14 22:45:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Sat May 14 19:52:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> Sat May 14 19:52:22 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name): * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
add for $0 test. add for $0 test.
Sat May 14 19:50:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> Sat May 14 19:50:46 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
@ -50,10 +50,10 @@ Sat May 14 17:42:21 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
Sat May 14 12:12:54 2011 Martin Bosslet <Martin.Bosslet@googlemail.com> Sat May 14 12:12:54 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* test/openssl/test_pkey_dsa.rb: Add basic tests and tests that * test/openssl/test_pkey_dsa.rb: Add basic tests and tests that
ensure new public key PEM encoding behavior and ensure backward ensure new public key PEM encoding behavior and ensure backward
compatibility. compatibility.
[Ruby 1.9 - Bug #4422] [ruby-core:35328] [Ruby 1.9 - Bug #4422] [ruby-core:35328]
* test/openssl/test_pkey_rsa.rb: Remove line with 'puts'. * test/openssl/test_pkey_rsa.rb: Remove line with 'puts'.
Sat May 14 12:06:49 2011 Eric Hodel <drbrain@segment7.net> Sat May 14 12:06:49 2011 Eric Hodel <drbrain@segment7.net>
@ -64,8 +64,8 @@ Sat May 14 12:06:49 2011 Eric Hodel <drbrain@segment7.net>
Sat May 14 10:32:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com> Sat May 14 10:32:36 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* test/openssl/test_pkey_rsa.rb: Add tests that ensure new public key * test/openssl/test_pkey_rsa.rb: Add tests that ensure new public key
encoding behavior and also ensure backward compatibility. encoding behavior and also ensure backward compatibility.
[Ruby 1.9 - Bug #4421] [ruby-core:35327] [Ruby 1.9 - Bug #4421] [ruby-core:35327]
Sat May 14 09:50:10 2011 Eric Hodel <drbrain@segment7.net> Sat May 14 09:50:10 2011 Eric Hodel <drbrain@segment7.net>
@ -87,7 +87,7 @@ Sat May 14 05:08:32 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* ext/openssl/ossl_pkey.c * ext/openssl/ossl_pkey.c
* ext/openssl/ossl_pkey.h * ext/openssl/ossl_pkey.h
* test/openssl/pkey/test_pkey_rsa.rb * test/openssl/pkey/test_pkey_rsa.rb
Reverted premature commit. Sorry for the noise! Reverted premature commit. Sorry for the noise!
Sat May 14 05:02:58 2011 Eric Hodel <drbrain@segment7.net> Sat May 14 05:02:58 2011 Eric Hodel <drbrain@segment7.net>
@ -97,8 +97,8 @@ Sat May 14 05:02:58 2011 Eric Hodel <drbrain@segment7.net>
Sat May 14 04:19:06 2011 Martin Bosslet <Martin.Bosslet@googlemail.com> Sat May 14 04:19:06 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* NEWS: Describe altered behaviour for RSA and DSA public key * NEWS: Describe altered behaviour for RSA and DSA public key
encoding. [Ruby 1.9 - Bug #4421, Bug #4422] encoding. [Ruby 1.9 - Bug #4421, Bug #4422]
[ruby-core:35327,35328] [ruby-core:35327,35328]
Sat May 14 02:57:52 2011 Eric Hodel <drbrain@segment7.net> Sat May 14 02:57:52 2011 Eric Hodel <drbrain@segment7.net>
@ -488,7 +488,7 @@ Fri May 6 23:29:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Fri May 6 23:13:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> Fri May 6 23:13:43 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* configure.in: remove nanosleep check. we no longer use it. * configure.in: remove nanosleep check. we no longer use it.
r20124 removed last usage. r20124 removed last usage.
Fri May 6 22:35:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> Fri May 6 22:35:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
@ -551,7 +551,7 @@ Thu May 5 15:03:51 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* eval.c (frame_func_id): __method__ return different name from * eval.c (frame_func_id): __method__ return different name from
methods defined by Module#define_method with a same block. methods defined by Module#define_method with a same block.
[ruby-core:35386] fixes #4606 [ruby-core:35386] fixes #4606
* eval (method_entry_of_iseq): new helper function. search control * eval.c (method_entry_of_iseq): new helper function. search control
frame stack for a method entry which has given iseq. frame stack for a method entry which has given iseq.
* test/ruby/test_method.rb: add tests for #4696 * test/ruby/test_method.rb: add tests for #4696
@ -573,14 +573,14 @@ Wed May 4 21:11:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Wed May 4 20:22:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> Wed May 4 20:22:12 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* io.c (Init_IO): Added File::CLOEXEC constant. * io.c (Init_IO): Added File::CLOEXEC constant.
[ruby-core:22893] [Feature #1291] [ruby-core:22893] [Feature #1291]
* test/ruby/test_io.rb (TestIO#test_o_cloexec): test for File::CLOEXEC. * test/ruby/test_io.rb (TestIO#test_o_cloexec): test for File::CLOEXEC.
Wed May 4 19:00:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> Wed May 4 19:00:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (rb_wait_for_single_fd): Fix wrong return value. * thread.c (rb_wait_for_single_fd): Fix wrong return value.
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb * test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb
(TestWaitForSingleFD#test_wait_for_closed_pipe): test for it. (TestWaitForSingleFD#test_wait_for_closed_pipe): test for it.
Wed May 4 18:46:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> Wed May 4 18:46:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
@ -1201,7 +1201,7 @@ Tue Apr 12 01:33:00 2011 Luis Lavena <luislavena@gmail.com>
* configure.in: properly evaluate existence of truncate, ftruncate * configure.in: properly evaluate existence of truncate, ftruncate
and ftello for MinGW. [ruby-core:35678] and ftello for MinGW. [ruby-core:35678]
* win32/win32.c: rename truncate, ftruncate and ftello to avoid * win32/win32.c: rename truncate, ftruncate and ftello to avoid
redefinitions. redefinitions.
* win32/win32.h: ditto. * win32/win32.h: ditto.
@ -1409,11 +1409,11 @@ Tue Mar 29 05:19:57 2011 Tanaka Akira <akr@fsij.org>
* ext/socket/raddrinfo.c: parenthesize macro arguments. * ext/socket/raddrinfo.c: parenthesize macro arguments.
Tue Mar 29 00:03:51 2011 Tajima Akio <artonx@yahoo.co.jp> Tue Mar 29 00:03:51 2011 Tajima Akio <artonx@yahoo.co.jp>
* test/webrick/test_filehandler.rb (test_short_filename): * test/webrick/test_filehandler.rb (test_short_filename):
read real short filename by cmd because smb mounted files read real short filename by cmd because smb mounted files
have different naming convention. have different naming convention.
Mon Mar 28 11:38:08 2011 NARUSE, Yui <naruse@ruby-lang.org> Mon Mar 28 11:38:08 2011 NARUSE, Yui <naruse@ruby-lang.org>

View file

@ -48,7 +48,7 @@ class BenchmarkDriver
def progress_message *args def progress_message *args
unless STDOUT.tty? unless STDOUT.tty?
STDERR.print(*args) STDERR.print(*args)
STDERR.flush STDERR.flush
end end
end end

View file

@ -51,14 +51,14 @@ Bench.each{|b|
require 'pp' require 'pp'
# utime # utime
puts Lang.join("\t") puts Lang.join("\t")
Bench.each_with_index{|b, bi| Bench.each_with_index{|b, bi|
print b, "\t" print b, "\t"
puts Result[bi].map{|e| e[0]}.join("\t") puts Result[bi].map{|e| e[0]}.join("\t")
} }
# rtime # rtime
puts Lang.join("\t") puts Lang.join("\t")
Bench.each_with_index{|b, bi| Bench.each_with_index{|b, bi|
print b, "\t" print b, "\t"
puts Result[bi].map{|e| e[1]}.join("\t") puts Result[bi].map{|e| e[1]}.join("\t")

View file

@ -25,7 +25,7 @@ end
def benchmark cmd def benchmark cmd
rubybin = ENV['RUBY'] || RbConfig.ruby rubybin = ENV['RUBY'] || RbConfig.ruby
IO.popen(rubybin, 'r+'){|io| IO.popen(rubybin, 'r+'){|io|
io.write cmd io.write cmd
io.close_write io.close_write

View file

@ -33,8 +33,8 @@ def bm file
bm_name = $1 bm_name = $1
puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly
puts "#{bm_name}: " puts "#{bm_name}: "
puts <<EOS unless $matzrubyonly || $rubyonly puts <<EOS unless $matzrubyonly || $rubyonly
#{prog} #{prog}
-- --
@ -93,7 +93,7 @@ if $0 == __FILE__
ARGV.delete_if{|arg| ARGV.delete_if{|arg|
/\A-/ =~ arg /\A-/ =~ arg
} }
puts "MatzRuby:" puts "MatzRuby:"
system("#{$matzruby_program} -v") system("#{$matzruby_program} -v")
puts "Ruby:" puts "Ruby:"

View file

@ -75,7 +75,7 @@ assert_equal %q{[1, 2, 3]}, %q{
} }
end end
end end
C.new.to_a C.new.to_a
} }
assert_equal %q{[4, 5, 6]}, %q{ assert_equal %q{[4, 5, 6]}, %q{
@ -87,7 +87,7 @@ assert_equal %q{[4, 5, 6]}, %q{
} }
end end
end end
C.new.map{|e| C.new.map{|e|
e + 3 e + 3
} }
@ -110,7 +110,7 @@ assert_equal %q{20}, %q{
def m def m
yield 1 yield 1
end end
m{|ib| m{|ib|
m{|jb| m{|jb|
i = 20 i = 20
@ -121,7 +121,7 @@ assert_equal %q{2}, %q{
def m def m
yield 1 yield 1
end end
m{|ib| m{|ib|
m{|jb| m{|jb|
ib = 20 ib = 20
@ -135,11 +135,11 @@ assert_equal %q{3}, %q{
yield yield
} }
end end
def iter2 def iter2
yield yield
end end
iter1{ iter1{
jb = 2 jb = 2
iter1{ iter1{
@ -154,11 +154,11 @@ assert_equal %q{2}, %q{
yield yield
} }
end end
def iter2 def iter2
yield yield
end end
iter1{ iter1{
jb = 2 jb = 2
iter1{ iter1{
@ -226,11 +226,11 @@ assert_equal %q{[10, 20, 30, 40, nil, nil]}, %q{
} }
assert_equal %q{[1]}, %q{ assert_equal %q{[1]}, %q{
$a = [] $a = []
def iter def iter
yield 1 yield 1
end end
def m def m
x = iter{|x| x = iter{|x|
$a << x $a << x
@ -450,7 +450,7 @@ assert_equal 'ok', %q{
end end
vs1 = [] vs1 = []
C.new.each {|*v| vs1 << v } C.new.each {|*v| vs1 << v }
vs2 = [] vs2 = []
C.new.to_enum.each {|*v| vs2 << v } C.new.to_enum.each {|*v| vs2 << v }
vs1 == vs2 ? :ok : :ng vs1 == vs2 ? :ok : :ng
}, '[ruby-dev:32329]' }, '[ruby-dev:32329]'
@ -468,9 +468,9 @@ assert_equal '[nil, []]', %q{
def m() yield nil,[] end def m() yield nil,[] end
l = lambda {|*v| v} l = lambda {|*v| v}
GC.stress=true GC.stress=true
r = m(&l) r = m(&l)
GC.stress=false GC.stress=false
r.inspect r.inspect
}, '[ruby-dev:32567]' }, '[ruby-dev:32567]'
assert_equal NilClass.to_s, %q{ assert_equal NilClass.to_s, %q{

View file

@ -97,7 +97,7 @@ assert_equal %q{[#<RuntimeError: FOO>, #<RuntimeError: FOO>]}, %q{
def m def m
$! $!
end end
begin begin
begin begin
raise "FOO" raise "FOO"
@ -205,11 +205,11 @@ assert_equal %q{3}, %q{
assert_equal %q{ok3}, %q{ assert_equal %q{ok3}, %q{
class E1 < Exception class E1 < Exception
end end
def m def m
yield yield
end end
begin begin
begin begin
begin begin
@ -239,7 +239,7 @@ assert_equal %q{7}, %q{
$i += 2 $i += 2
break break
ensure ensure
end end
ensure ensure
$i += 4 $i += 4
@ -247,7 +247,7 @@ assert_equal %q{7}, %q{
$i = 0 $i = 0
} }
end end
def iter def iter
yield yield
end end
@ -349,7 +349,7 @@ assert_equal %q{12}, %q{
7+7 7+7
end end
} }
assert_equal %q{ok}, %q{ # assert_equal %q{ok}, %q{ #
proc{ proc{
begin begin
raise raise
@ -376,7 +376,7 @@ assert_match /undefined method `foo\'/, %q{#`
def inspect def inspect
bar {} bar {}
end end
def bar def bar
raise raise
ensure ensure

View file

@ -29,7 +29,7 @@ assert_equal %q{ok}, %q{
end end
end end
end end
('a').lines.map{|e| ('a').lines.map{|e|
break :ok break :ok
} }

View file

@ -100,7 +100,7 @@ assert_equal %q{ok}, %q{
def m def m
yield yield
end end
m{ m{
begin begin
ensure ensure
@ -190,7 +190,7 @@ assert_equal %q{100}, %q{
$i = 100 $i = 100
end end
end end
def iter def iter
yield yield
end end
@ -216,7 +216,7 @@ assert_equal %q{1}, %q{
return 1 return 1
end end
end end
m m
} }
assert_equal %q{1}, %q{ assert_equal %q{1}, %q{
@ -227,7 +227,7 @@ assert_equal %q{1}, %q{
return 1 return 1
end end
end end
m m
} }
assert_equal 'ok', %q{ assert_equal 'ok', %q{

View file

@ -914,7 +914,7 @@ assert_equal %q{[:ok, :ok, :ok, :ok, :ok, :ok, :ng, :ng]}, %q{
o1 = c1.new o1 = c1.new
o2 = c2.new o2 = c2.new
test{o1.m} test{o1.m}
test{o2.mm} test{o2.mm}
test{o1.send :m} test{o1.send :m}
@ -1074,7 +1074,7 @@ assert_equal '[1, 2, [3, 4]]', %q{
def regular(a, b, *c) def regular(a, b, *c)
[a, b, c] [a, b, c]
end end
regular(*[], 1, *[], *[2, 3], *[], 4) regular(*[], 1, *[], *[2, 3], *[], 4)
}, '[ruby-core:19413]' }, '[ruby-core:19413]'
assert_equal '[1, [:foo, 3, 4, :foo]]', %q{ assert_equal '[1, [:foo, 3, 4, :foo]]', %q{
@ -1093,7 +1093,7 @@ assert_equal '["B", "A"]', %q{
end end
class B < A class B < A
define_method(:m) do define_method(:m) do
['B', super()] ['B', super()]
end end
end end

View file

@ -2,11 +2,11 @@ assert_equal %q{[1, 2, 3]}, %q{
def getproc &b def getproc &b
b b
end end
def m def m
yield yield
end end
m{ m{
i = 1 i = 1
m{ m{
@ -24,14 +24,14 @@ assert_equal %q{7}, %q{
def make_proc(&b) def make_proc(&b)
b b
end end
def make_closure def make_closure
a = 0 a = 0
make_proc{ make_proc{
a+=1 a+=1
} }
end end
cl = make_closure cl = make_closure
cl.call + cl.call * cl.call cl.call + cl.call * cl.call
} }
@ -41,7 +41,7 @@ assert_equal %q{ok}, %q{
:ok :ok
end end
end end
def block def block
C.method(:new).to_proc C.method(:new).to_proc
end end
@ -52,7 +52,7 @@ assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{
def proc &b def proc &b
b b
end end
pr = [] pr = []
proc{|i_b| proc{|i_b|
p3 = proc{|j_b| p3 = proc{|j_b|
@ -63,18 +63,18 @@ assert_equal %q{[0, 1, :last, 0, 2, :last]}, %q{
p3.call(1) p3.call(1)
p3.call(2) p3.call(2)
}.call(0) }.call(0)
pr[0].call(:last).concat pr[1].call(:last) pr[0].call(:last).concat pr[1].call(:last)
} }
assert_equal %q{12}, %q{ assert_equal %q{12}, %q{
def iter def iter
yield yield
end end
def getproc &b def getproc &b
b b
end end
iter{ iter{
bvar = 3 bvar = 3
getproc{ getproc{
@ -87,11 +87,11 @@ assert_equal %q{200}, %q{
def iter def iter
yield yield
end end
def getproc &b def getproc &b
b b
end end
loc1 = 0 loc1 = 0
pr1 = iter{ pr1 = iter{
bl1 = 1 bl1 = 1
@ -101,7 +101,7 @@ assert_equal %q{200}, %q{
loc1 + bl1 loc1 + bl1
} }
} }
pr2 = iter{ pr2 = iter{
bl1 = 1 bl1 = 1
getproc{ getproc{
@ -110,7 +110,7 @@ assert_equal %q{200}, %q{
loc1 + bl1 loc1 + bl1
} }
} }
pr1.call; pr2.call pr1.call; pr2.call
pr1.call; pr2.call pr1.call; pr2.call
pr1.call; pr2.call pr1.call; pr2.call
@ -120,21 +120,21 @@ assert_equal %q{[1, 2]}, %q{
def proc(&pr) def proc(&pr)
pr pr
end end
def m def m
a = 1 a = 1
m2{ m2{
a a
} }
end end
def m2 def m2
b = 2 b = 2
proc{ proc{
[yield, b] [yield, b]
} }
end end
pr = m pr = m
x = ['a', 1,2,3,4,5,6,7,8,9,0, x = ['a', 1,2,3,4,5,6,7,8,9,0,
1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,0,
@ -147,14 +147,14 @@ assert_equal %q{1}, %q{
def proc(&pr) def proc(&pr)
pr pr
end end
def m def m
a = 1 a = 1
m2{ m2{
a a
} }
end end
def m2 def m2
b = 2 b = 2
proc{ proc{

View file

@ -110,7 +110,7 @@ assert_equal %q{100}, %q{
end end
return arg return arg
end end
test(100) test(100)
} }
assert_equal %q{ok}, %q{ assert_equal %q{ok}, %q{
@ -169,7 +169,7 @@ assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false,
res res
end end
end end
def each_test def each_test
conds = make_perm(['fv', 'tv'], 3) conds = make_perm(['fv', 'tv'], 3)
bangs = make_perm(['', '!'], 3) bangs = make_perm(['', '!'], 3)
@ -184,10 +184,10 @@ assert_equal %q{[:false, :false, :false, :false, :false, :false, :false, :false,
} }
} }
end end
fv = false fv = false
tv = true tv = true
$ans = [] $ans = []
each_test{|syn, conds, bangs, exprs| each_test{|syn, conds, bangs, exprs|
c1, c2, c3 = conds c1, c2, c3 = conds
@ -695,7 +695,7 @@ assert_equal 'ok', %q{
while true while true
counter -= 1 counter -= 1
break if counter == 0 break if counter == 0
next next
redo redo
end end
:ok :ok
@ -706,7 +706,7 @@ assert_equal 'ok', %q{
while true while true
counter -= 1 counter -= 1
break if counter == 0 break if counter == 0
next next
"#{ redo }" "#{ redo }"
end end
:ok :ok

View file

@ -183,7 +183,7 @@ h3, h4, h5, h6 {
CSS CSS
XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?> XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
} }
@ -510,7 +510,7 @@ FILE_INDEX = XHTML_PREAMBLE + <<HTML
<!-- <!--
body { body {
background-color: #EEE; background-color: #EEE;
font-family: #{FONTS}; font-family: #{FONTS};
color: #000; color: #000;
margin: 0px; margin: 0px;
} }

View file

@ -107,7 +107,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -125,7 +125,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
}, },
{ /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
@ -260,7 +260,7 @@ big5_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
p++; p++;
break; break;
} }
} }
} }
len = enclen(enc, p, end); len = enclen(enc, p, end);
if (p + len > s) return (UChar* )p; if (p + len > s) return (UChar* )p;

View file

@ -90,7 +90,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -108,7 +108,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
} }
}; };
#undef A #undef A
@ -179,7 +179,7 @@ cp949_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end
p++; p++;
break; break;
} }
} }
} }
len = enclen(enc, p, end); len = enclen(enc, p, end);
if (p + len > s) return (UChar* )p; if (p + len > s) return (UChar* )p;

View file

@ -103,7 +103,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A
}, },
{ /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -121,7 +121,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
}, },
{ /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,

View file

@ -71,7 +71,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -89,7 +89,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
}, },
{ /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -107,7 +107,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
}; };
@ -192,7 +192,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
#if 1 #if 1
if (enclen(enc, buf, p) != (p - buf)) if (enclen(enc, buf, p) != (p - buf))
return ONIGERR_INVALID_CODE_POINT_VALUE; return ONIGERR_INVALID_CODE_POINT_VALUE;
#endif #endif
return (int)(p - buf); return (int)(p - buf);
} }

View file

@ -68,7 +68,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -86,7 +86,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
} }
}; };
#undef A #undef A

View file

@ -68,7 +68,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -86,7 +86,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
}, },
{ /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -104,7 +104,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -122,7 +122,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
} }
}; };
#undef A #undef A

View file

@ -82,7 +82,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -100,7 +100,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
}, },
{ /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -118,7 +118,7 @@ static const signed char trans[][0x100] = {
/* c */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* c */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* d */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* d */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* e */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* e */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, F /* f */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, F
}, },
{ /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -136,7 +136,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
} }
}; };
#undef A #undef A

View file

@ -90,7 +90,7 @@ static const signed char trans[][0x100] = {
/* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F /* f */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -108,7 +108,7 @@ static const signed char trans[][0x100] = {
/* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* c */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* d */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* e */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
/* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F /* f */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, F
} }
}; };
#undef A #undef A
@ -179,7 +179,7 @@ gbk_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
p++; p++;
break; break;
} }
} }
} }
len = enclen(enc, p, end); len = enclen(enc, p, end);
if (p + len > s) return (UChar* )p; if (p + len > s) return (UChar* )p;

View file

@ -208,7 +208,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
const UChar** pp, const UChar* end) const UChar** pp, const UChar* end)
{ {
return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end); return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
} }
#endif #endif
@ -243,7 +243,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, Onig
p++; p++;
break; break;
} }
} }
} }
len = enclen(enc, p, end); len = enclen(enc, p, end);
if (p + len > s) return (UChar* )p; if (p + len > s) return (UChar* )p;

View file

@ -2244,7 +2244,7 @@ onigenc_unicode_mbc_case_fold(OnigEncoding enc,
if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) { if (onig_st_lookup(FoldTable, (st_data_t )code, (void* )&to) != 0) {
if (to->n == 1) { if (to->n == 1) {
return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold); return ONIGENC_CODE_TO_MBC(enc, to->code[0], fold);
} }
#if 0 #if 0
/* NO NEEDS TO CHECK */ /* NO NEEDS TO CHECK */
@ -2350,7 +2350,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
for (j = 0; j < CaseUnfold_12[i].to.n; j++) { for (j = 0; j < CaseUnfold_12[i].to.n; j++) {
r = (*f)(CaseUnfold_12[i].to.code[j], r = (*f)(CaseUnfold_12[i].to.code[j],
(OnigCodePoint* )CaseUnfold_12[i].from, 2, arg); (OnigCodePoint* )CaseUnfold_12[i].from, 2, arg);
if (r != 0) return r; if (r != 0) return r;
for (k = 0; k < CaseUnfold_12[i].to.n; k++) { for (k = 0; k < CaseUnfold_12[i].to.n; k++) {
if (k == j) continue; if (k == j) continue;
@ -2369,7 +2369,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
for (j = 0; j < CaseUnfold_12_Locale[i].to.n; j++) { for (j = 0; j < CaseUnfold_12_Locale[i].to.n; j++) {
r = (*f)(CaseUnfold_12_Locale[i].to.code[j], r = (*f)(CaseUnfold_12_Locale[i].to.code[j],
(OnigCodePoint* )CaseUnfold_12_Locale[i].from, 2, arg); (OnigCodePoint* )CaseUnfold_12_Locale[i].from, 2, arg);
if (r != 0) return r; if (r != 0) return r;
for (k = 0; k < CaseUnfold_12_Locale[i].to.n; k++) { for (k = 0; k < CaseUnfold_12_Locale[i].to.n; k++) {
if (k == j) continue; if (k == j) continue;
@ -2389,7 +2389,7 @@ onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag,
for (j = 0; j < CaseUnfold_13[i].to.n; j++) { for (j = 0; j < CaseUnfold_13[i].to.n; j++) {
r = (*f)(CaseUnfold_13[i].to.code[j], r = (*f)(CaseUnfold_13[i].to.code[j],
(OnigCodePoint* )CaseUnfold_13[i].from, 3, arg); (OnigCodePoint* )CaseUnfold_13[i].from, 3, arg);
if (r != 0) return r; if (r != 0) return r;
for (k = 0; k < CaseUnfold_13[i].to.n; k++) { for (k = 0; k < CaseUnfold_13[i].to.n; k++) {
if (k == j) continue; if (k == j) continue;

View file

@ -84,7 +84,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
/* e */ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, /* e */ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3,
/* f */ 5, 6, 6, 6, 7, F, F, F, F, F, F, F, F, F, F, F /* f */ 5, 6, 6, 6, 7, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S1 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -102,7 +102,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S2 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -120,7 +120,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S3 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -138,7 +138,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S4 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S4 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -156,7 +156,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S5 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S5 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -174,7 +174,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S6 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S6 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -192,7 +192,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
{ /* S7 0 1 2 3 4 5 6 7 8 9 a b c d e f */ { /* S7 0 1 2 3 4 5 6 7 8 9 a b c d e f */
/* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* 0 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
@ -210,7 +210,7 @@ static const signed char trans[][0x100] = {
/* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
/* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
}, },
}; };
#undef A #undef A

2
enum.c
View file

@ -1668,7 +1668,7 @@ enum_each_with_index(int argc, VALUE *argv, VALUE obj)
* (1..3).reverse_each {|v| p v } * (1..3).reverse_each {|v| p v }
* *
* produces: * produces:
* *
* 3 * 3
* 2 * 2
* 1 * 1

View file

@ -4645,9 +4645,9 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf)
/* so the representation used (in y->frac) is an array of BDIGIT, where /* so the representation used (in y->frac) is an array of BDIGIT, where
each BDIGIT contains a value between 0 and BASE-1, consisting of BASE_FIG each BDIGIT contains a value between 0 and BASE-1, consisting of BASE_FIG
decimal places. decimal places.
(that numbers of decimal places are typed as ssize_t is somewhat confusing) (that numbers of decimal places are typed as ssize_t is somewhat confusing)
nf is now position (in decimal places) of the digit from the start of nf is now position (in decimal places) of the digit from the start of
the array. the array.
ix is the position (in BDIGITS) of the BDIGIT containing the decimal digit, ix is the position (in BDIGITS) of the BDIGIT containing the decimal digit,
@ -4666,7 +4666,7 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf)
fracf = (v % (shifter * 10) > 0); fracf = (v % (shifter * 10) > 0);
fracf_1further = ((v % shifter) > 0); fracf_1further = ((v % shifter) > 0);
v /= shifter; v /= shifter;
div = v / 10; div = v / 10;
v = v - div*10; v = v - div*10;
@ -4687,12 +4687,12 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf)
break; break;
} }
} }
/* now fracf = does any positive digit exist under the rounding position? /* now fracf = does any positive digit exist under the rounding position?
now fracf_1further = does any positive digit exist under one further than the now fracf_1further = does any positive digit exist under one further than the
rounding position? rounding position?
now v = the first digit under the rounding position */ now v = the first digit under the rounding position */
/* drop digits after pointed digit */ /* drop digits after pointed digit */
memset(y->frac+ix+1, 0, (y->Prec - (ix+1)) * sizeof(BDIGIT)); memset(y->frac+ix+1, 0, (y->Prec - (ix+1)) * sizeof(BDIGIT));

View file

@ -905,7 +905,7 @@ n2i(const char *s, long f, long w)
{ {
long e, i; long e, i;
int v; int v;
e = f + w; e = f + w;
v = 0; v = 0;
for (i = f; i < e; i++) { for (i = f; i < e; i++) {

View file

@ -18,9 +18,9 @@ static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before,
/* /*
* Copyright 2001-2004 Unicode, Inc. * Copyright 2001-2004 Unicode, Inc.
* *
* Disclaimer * Disclaimer
* *
* This source code is provided as is by Unicode, Inc. No claims are * This source code is provided as is by Unicode, Inc. No claims are
* made as to fitness for any particular purpose. No warranties of any * made as to fitness for any particular purpose. No warranties of any
* kind are expressed or implied. The recipient agrees to determine * kind are expressed or implied. The recipient agrees to determine
@ -28,9 +28,9 @@ static ID i_to_s, i_to_json, i_new, i_indent, i_space, i_space_before,
* purchased on magnetic or optical media from Unicode, Inc., the * purchased on magnetic or optical media from Unicode, Inc., the
* sole remedy for any claim will be exchange of defective media * sole remedy for any claim will be exchange of defective media
* within 90 days of receipt. * within 90 days of receipt.
* *
* Limitations on Rights to Redistribute This Code * Limitations on Rights to Redistribute This Code
* *
* Unicode, Inc. hereby grants the right to freely use the information * Unicode, Inc. hereby grants the right to freely use the information
* supplied in this file in the creation of products supporting the * supplied in this file in the creation of products supporting the
* Unicode Standard, and to make copies of this file in any form * Unicode Standard, and to make copies of this file in any form
@ -61,7 +61,7 @@ static const char trailingBytesForUTF8[256] = {
* This table contains as many values as there might be trailing bytes * This table contains as many values as there might be trailing bytes
* in a UTF-8 sequence. * in a UTF-8 sequence.
*/ */
static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
0x03C82080UL, 0xFA082080UL, 0x82082080UL }; 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
/* /*
@ -399,7 +399,7 @@ static FBuffer *fbuffer_dup(FBuffer *fb)
return result; return result;
} }
/* /*
* Document-module: JSON::Ext::Generator * Document-module: JSON::Ext::Generator
* *
* This is the JSON generator implemented as a C extension. It can be * This is the JSON generator implemented as a C extension. It can be
@ -979,7 +979,7 @@ static VALUE cState_generate(VALUE self, VALUE obj)
* * *indent*: a string used to indent levels (default: ''), * * *indent*: a string used to indent levels (default: ''),
* * *space*: a string that is put after, a : or , delimiter (default: ''), * * *space*: a string that is put after, a : or , delimiter (default: ''),
* * *space_before*: a string that is put before a : pair delimiter (default: ''), * * *space_before*: a string that is put before a : pair delimiter (default: ''),
* * *object_nl*: a string that is put at the end of a JSON object (default: ''), * * *object_nl*: a string that is put at the end of a JSON object (default: ''),
* * *array_nl*: a string that is put at the end of a JSON array (default: ''), * * *array_nl*: a string that is put at the end of a JSON array (default: ''),
* * *allow_nan*: true if NaN, Infinity, and -Infinity should be * * *allow_nan*: true if NaN, Infinity, and -Infinity should be
* generated, otherwise an exception is thrown, if these values are * generated, otherwise an exception is thrown, if these values are

View file

@ -185,7 +185,7 @@ module JSON
# * *indent*: a string used to indent levels (default: ''), # * *indent*: a string used to indent levels (default: ''),
# * *space*: a string that is put after, a : or , delimiter (default: ''), # * *space*: a string that is put after, a : or , delimiter (default: ''),
# * *space_before*: a string that is put before a : pair delimiter (default: ''), # * *space_before*: a string that is put before a : pair delimiter (default: ''),
# * *object_nl*: a string that is put at the end of a JSON object (default: ''), # * *object_nl*: a string that is put at the end of a JSON object (default: ''),
# * *array_nl*: a string that is put at the end of a JSON array (default: ''), # * *array_nl*: a string that is put at the end of a JSON array (default: ''),
# * *allow_nan*: true if NaN, Infinity, and -Infinity should be # * *allow_nan*: true if NaN, Infinity, and -Infinity should be
# generated, otherwise an exception is thrown, if these values are # generated, otherwise an exception is thrown, if these values are

View file

@ -109,14 +109,14 @@ static char *JSON_parse_object(JSON_Parser *json, char *p, char *pe, VALUE *resu
*result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class); *result = NIL_P(object_class) ? rb_hash_new() : rb_class_new_instance(0, 0, object_class);
#line 114 "parser.c" #line 114 "parser.c"
{ {
cs = JSON_object_start; cs = JSON_object_start;
} }
#line 159 "parser.rl" #line 159 "parser.rl"
#line 121 "parser.c" #line 121 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -404,32 +404,32 @@ case 26:
goto st2; goto st2;
goto st26; goto st26;
} }
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof; _test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof; _test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof; _test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof; _test_eof9: cs = 9; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof; _test_eof10: cs = 10; goto _test_eof;
_test_eof11: cs = 11; goto _test_eof; _test_eof11: cs = 11; goto _test_eof;
_test_eof12: cs = 12; goto _test_eof; _test_eof12: cs = 12; goto _test_eof;
_test_eof13: cs = 13; goto _test_eof; _test_eof13: cs = 13; goto _test_eof;
_test_eof14: cs = 14; goto _test_eof; _test_eof14: cs = 14; goto _test_eof;
_test_eof15: cs = 15; goto _test_eof; _test_eof15: cs = 15; goto _test_eof;
_test_eof16: cs = 16; goto _test_eof; _test_eof16: cs = 16; goto _test_eof;
_test_eof17: cs = 17; goto _test_eof; _test_eof17: cs = 17; goto _test_eof;
_test_eof18: cs = 18; goto _test_eof; _test_eof18: cs = 18; goto _test_eof;
_test_eof27: cs = 27; goto _test_eof; _test_eof27: cs = 27; goto _test_eof;
_test_eof19: cs = 19; goto _test_eof; _test_eof19: cs = 19; goto _test_eof;
_test_eof20: cs = 20; goto _test_eof; _test_eof20: cs = 20; goto _test_eof;
_test_eof21: cs = 21; goto _test_eof; _test_eof21: cs = 21; goto _test_eof;
_test_eof22: cs = 22; goto _test_eof; _test_eof22: cs = 22; goto _test_eof;
_test_eof23: cs = 23; goto _test_eof; _test_eof23: cs = 23; goto _test_eof;
_test_eof24: cs = 24; goto _test_eof; _test_eof24: cs = 24; goto _test_eof;
_test_eof25: cs = 25; goto _test_eof; _test_eof25: cs = 25; goto _test_eof;
_test_eof26: cs = 26; goto _test_eof; _test_eof26: cs = 26; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}
@ -469,14 +469,14 @@ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *resul
{ {
int cs = EVIL; int cs = EVIL;
#line 474 "parser.c" #line 474 "parser.c"
{ {
cs = JSON_value_start; cs = JSON_value_start;
} }
#line 265 "parser.rl" #line 265 "parser.rl"
#line 481 "parser.c" #line 481 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -728,26 +728,26 @@ case 20:
goto tr28; goto tr28;
goto st0; goto st0;
} }
_test_eof21: cs = 21; goto _test_eof; _test_eof21: cs = 21; goto _test_eof;
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof; _test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof; _test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof; _test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof; _test_eof9: cs = 9; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof; _test_eof10: cs = 10; goto _test_eof;
_test_eof11: cs = 11; goto _test_eof; _test_eof11: cs = 11; goto _test_eof;
_test_eof12: cs = 12; goto _test_eof; _test_eof12: cs = 12; goto _test_eof;
_test_eof13: cs = 13; goto _test_eof; _test_eof13: cs = 13; goto _test_eof;
_test_eof14: cs = 14; goto _test_eof; _test_eof14: cs = 14; goto _test_eof;
_test_eof15: cs = 15; goto _test_eof; _test_eof15: cs = 15; goto _test_eof;
_test_eof16: cs = 16; goto _test_eof; _test_eof16: cs = 16; goto _test_eof;
_test_eof17: cs = 17; goto _test_eof; _test_eof17: cs = 17; goto _test_eof;
_test_eof18: cs = 18; goto _test_eof; _test_eof18: cs = 18; goto _test_eof;
_test_eof19: cs = 19; goto _test_eof; _test_eof19: cs = 19; goto _test_eof;
_test_eof20: cs = 20; goto _test_eof; _test_eof20: cs = 20; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}
@ -778,7 +778,7 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
{ {
int cs = EVIL; int cs = EVIL;
#line 783 "parser.c" #line 783 "parser.c"
{ {
cs = JSON_integer_start; cs = JSON_integer_start;
@ -786,7 +786,7 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
#line 289 "parser.rl" #line 289 "parser.rl"
json->memo = p; json->memo = p;
#line 791 "parser.c" #line 791 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -838,10 +838,10 @@ case 4:
goto st4; goto st4;
goto tr4; goto tr4;
} }
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}
@ -874,7 +874,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
{ {
int cs = EVIL; int cs = EVIL;
#line 879 "parser.c" #line 879 "parser.c"
{ {
cs = JSON_float_start; cs = JSON_float_start;
@ -882,7 +882,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul
#line 320 "parser.rl" #line 320 "parser.rl"
json->memo = p; json->memo = p;
#line 887 "parser.c" #line 887 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -995,15 +995,15 @@ case 9:
goto st9; goto st9;
goto st0; goto st0;
} }
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof; _test_eof10: cs = 10; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof; _test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof; _test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof; _test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof; _test_eof9: cs = 9; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}
@ -1043,14 +1043,14 @@ static char *JSON_parse_array(JSON_Parser *json, char *p, char *pe, VALUE *resul
} }
*result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class); *result = NIL_P(array_class) ? rb_ary_new() : rb_class_new_instance(0, 0, array_class);
#line 1048 "parser.c" #line 1048 "parser.c"
{ {
cs = JSON_array_start; cs = JSON_array_start;
} }
#line 371 "parser.rl" #line 371 "parser.rl"
#line 1055 "parser.c" #line 1055 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -1248,22 +1248,22 @@ case 16:
goto st2; goto st2;
goto st16; goto st16;
} }
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof; _test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof; _test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof; _test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof; _test_eof9: cs = 9; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof; _test_eof10: cs = 10; goto _test_eof;
_test_eof11: cs = 11; goto _test_eof; _test_eof11: cs = 11; goto _test_eof;
_test_eof12: cs = 12; goto _test_eof; _test_eof12: cs = 12; goto _test_eof;
_test_eof17: cs = 17; goto _test_eof; _test_eof17: cs = 17; goto _test_eof;
_test_eof13: cs = 13; goto _test_eof; _test_eof13: cs = 13; goto _test_eof;
_test_eof14: cs = 14; goto _test_eof; _test_eof14: cs = 14; goto _test_eof;
_test_eof15: cs = 15; goto _test_eof; _test_eof15: cs = 15; goto _test_eof;
_test_eof16: cs = 16; goto _test_eof; _test_eof16: cs = 16; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}
@ -1366,7 +1366,7 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
int cs = EVIL; int cs = EVIL;
*result = rb_str_buf_new(0); *result = rb_str_buf_new(0);
#line 1371 "parser.c" #line 1371 "parser.c"
{ {
cs = JSON_string_start; cs = JSON_string_start;
@ -1374,7 +1374,7 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
#line 479 "parser.rl" #line 479 "parser.rl"
json->memo = p; json->memo = p;
#line 1379 "parser.c" #line 1379 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -1482,13 +1482,13 @@ case 7:
goto st2; goto st2;
goto st0; goto st0;
} }
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof; _test_eof8: cs = 8; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof; _test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof; _test_eof7: cs = 7; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}
@ -1701,7 +1701,7 @@ static VALUE cParser_parse(VALUE self)
VALUE result = Qnil; VALUE result = Qnil;
GET_PARSER; GET_PARSER;
#line 1706 "parser.c" #line 1706 "parser.c"
{ {
cs = JSON_start; cs = JSON_start;
@ -1710,7 +1710,7 @@ static VALUE cParser_parse(VALUE self)
#line 703 "parser.rl" #line 703 "parser.rl"
p = json->source; p = json->source;
pe = p + json->len; pe = p + json->len;
#line 1715 "parser.c" #line 1715 "parser.c"
{ {
if ( p == pe ) if ( p == pe )
@ -1830,16 +1830,16 @@ case 9:
goto st10; goto st10;
goto st9; goto st9;
} }
_test_eof1: cs = 1; goto _test_eof; _test_eof1: cs = 1; goto _test_eof;
_test_eof2: cs = 2; goto _test_eof; _test_eof2: cs = 2; goto _test_eof;
_test_eof3: cs = 3; goto _test_eof; _test_eof3: cs = 3; goto _test_eof;
_test_eof4: cs = 4; goto _test_eof; _test_eof4: cs = 4; goto _test_eof;
_test_eof5: cs = 5; goto _test_eof; _test_eof5: cs = 5; goto _test_eof;
_test_eof10: cs = 10; goto _test_eof; _test_eof10: cs = 10; goto _test_eof;
_test_eof6: cs = 6; goto _test_eof; _test_eof6: cs = 6; goto _test_eof;
_test_eof7: cs = 7; goto _test_eof; _test_eof7: cs = 7; goto _test_eof;
_test_eof8: cs = 8; goto _test_eof; _test_eof8: cs = 8; goto _test_eof;
_test_eof9: cs = 9; goto _test_eof; _test_eof9: cs = 9; goto _test_eof;
_test_eof: {} _test_eof: {}
_out: {} _out: {}

View file

@ -821,7 +821,7 @@ nkf_buf_new(int length)
buf->capa = length; buf->capa = length;
buf->len = 0; buf->len = 0;
return buf; return buf;
} }
#if 0 #if 0
static void static void
@ -5874,7 +5874,7 @@ finished:
/* /*
* int options(unsigned char *cp) * int options(unsigned char *cp)
* *
* return values: * return values:
* 0: success * 0: success
* -1: ArgumentError * -1: ArgumentError

View file

@ -845,7 +845,7 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, long depth,
ossl_asn1_set_infinite_length(asn1data, Qtrue); ossl_asn1_set_infinite_length(asn1data, Qtrue);
else else
ossl_asn1_set_infinite_length(asn1data, Qfalse); ossl_asn1_set_infinite_length(asn1data, Qfalse);
rb_ary_push(ary, asn1data); rb_ary_push(ary, asn1data);
length -= len; length -= len;
if(once) break; if(once) break;

View file

@ -108,7 +108,7 @@ struct {
OSSL_SSL_METHOD_ENTRY(TLSv1_server), OSSL_SSL_METHOD_ENTRY(TLSv1_server),
OSSL_SSL_METHOD_ENTRY(TLSv1_client), OSSL_SSL_METHOD_ENTRY(TLSv1_client),
#if defined(HAVE_SSLV2_METHOD) && defined(HAVE_SSLV2_SERVER_METHOD) && \ #if defined(HAVE_SSLV2_METHOD) && defined(HAVE_SSLV2_SERVER_METHOD) && \
defined(HAVE_SSLV2_CLIENT_METHOD) defined(HAVE_SSLV2_CLIENT_METHOD)
OSSL_SSL_METHOD_ENTRY(SSLv2), OSSL_SSL_METHOD_ENTRY(SSLv2),
OSSL_SSL_METHOD_ENTRY(SSLv2_server), OSSL_SSL_METHOD_ENTRY(SSLv2_server),
OSSL_SSL_METHOD_ENTRY(SSLv2_client), OSSL_SSL_METHOD_ENTRY(SSLv2_client),

View file

@ -170,7 +170,7 @@ path_sub(int argc, VALUE *argv, VALUE self)
/* /*
* Return a pathname which the extension of the basename is substituted by * Return a pathname which the extension of the basename is substituted by
* <i>repl</i>. * <i>repl</i>.
* *
* If self has no extension part, <i>repl</i> is appended. * If self has no extension part, <i>repl</i> is appended.
*/ */
static VALUE static VALUE
@ -220,7 +220,7 @@ path_realpath(int argc, VALUE *argv, VALUE self)
/* /*
* Returns the real (absolute) pathname of +self+ in the actual filesystem. * Returns the real (absolute) pathname of +self+ in the actual filesystem.
* The real pathname doesn't contain symlinks or useless dots. * The real pathname doesn't contain symlinks or useless dots.
* *
* The last component of the real pathname can be nonexistent. * The last component of the real pathname can be nonexistent.
*/ */
static VALUE static VALUE
@ -239,10 +239,10 @@ path_realdirpath(int argc, VALUE *argv, VALUE self)
* pathname.each_line(limit [, open_args]) {|line| block } -> nil * pathname.each_line(limit [, open_args]) {|line| block } -> nil
* pathname.each_line(sep, limit [, open_args]) {|line| block } -> nil * pathname.each_line(sep, limit [, open_args]) {|line| block } -> nil
* pathname.each_line(...) -> an_enumerator * pathname.each_line(...) -> an_enumerator
* *
* #each_line iterates over the line in the file. It yields a String object * #each_line iterates over the line in the file. It yields a String object
* for each line. * for each line.
* *
* This method is availabel since 1.8.1. * This method is availabel since 1.8.1.
*/ */
static VALUE static VALUE
@ -265,7 +265,7 @@ path_each_line(int argc, VALUE *argv, VALUE self)
* call-seq: * call-seq:
* pathname.read([length [, offset]]) -> string * pathname.read([length [, offset]]) -> string
* pathname.read([length [, offset]], open_args) -> string * pathname.read([length [, offset]], open_args) -> string
* *
* See <tt>IO.read</tt>. Returns all data from the file, or the first +N+ bytes * See <tt>IO.read</tt>. Returns all data from the file, or the first +N+ bytes
* if specified. * if specified.
* *
@ -284,7 +284,7 @@ path_read(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* pathname.binread([length [, offset]]) -> string * pathname.binread([length [, offset]]) -> string
* *
* See <tt>IO.binread</tt>. Returns all the bytes from the file, or the first +N+ * See <tt>IO.binread</tt>. Returns all the bytes from the file, or the first +N+
* if specified. * if specified.
* *
@ -305,7 +305,7 @@ path_binread(int argc, VALUE *argv, VALUE self)
* pathname.readlines(sep=$/ [, open_args]) -> array * pathname.readlines(sep=$/ [, open_args]) -> array
* pathname.readlines(limit [, open_args]) -> array * pathname.readlines(limit [, open_args]) -> array
* pathname.readlines(sep, limit [, open_args]) -> array * pathname.readlines(sep, limit [, open_args]) -> array
* *
* See <tt>IO.readlines</tt>. Returns all the lines from the file. * See <tt>IO.readlines</tt>. Returns all the lines from the file.
* *
*/ */
@ -323,7 +323,7 @@ path_readlines(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* pathname.sysopen([mode, [perm]]) -> fixnum * pathname.sysopen([mode, [perm]]) -> fixnum
* *
* See <tt>IO.sysopen</tt>. * See <tt>IO.sysopen</tt>.
* *
*/ */
@ -405,7 +405,7 @@ path_lchown(VALUE self, VALUE owner, VALUE group)
* call-seq: * call-seq:
* pathname.fnmatch(pattern, [flags]) -> string * pathname.fnmatch(pattern, [flags]) -> string
* pathname.fnmatch?(pattern, [flags]) -> string * pathname.fnmatch?(pattern, [flags]) -> string
* *
* See <tt>File.fnmatch</tt>. Return +true+ if the receiver matches the given * See <tt>File.fnmatch</tt>. Return +true+ if the receiver matches the given
* pattern. * pattern.
*/ */

View file

@ -31,7 +31,7 @@ module Psych
# doc = Psych::Nodes::Document.new # doc = Psych::Nodes::Document.new
# seq = Psych::Nodes::Sequence.new # seq = Psych::Nodes::Sequence.new
# scalar = Psych::Nodes::Scalar.new('foo') # scalar = Psych::Nodes::Scalar.new('foo')
# #
# # Build up our tree # # Build up our tree
# stream.children << doc # stream.children << doc
# doc.children << seq # doc.children << seq

View file

@ -4,7 +4,7 @@ class IO
# Reads ios until pattern matches or the timeout is over. It returns # Reads ios until pattern matches or the timeout is over. It returns
# an array with the read buffer, followed by the matches. If a block is given, # an array with the read buffer, followed by the matches. If a block is given,
# the result is yielded to the block and returns nil. The optional timeout parameter defines, # the result is yielded to the block and returns nil. The optional timeout parameter defines,
# in seconds, the total time to wait for pattern. If it is over of eof is found, it # in seconds, the total time to wait for pattern. If it is over of eof is found, it
# returns/yields nil. However, the buffer in a timeout session is kept for the next expect call. # returns/yields nil. However, the buffer in a timeout session is kept for the next expect call.
# The default timeout is 9999999 seconds. # The default timeout is 9999999 seconds.
def expect(pat,timeout=9999999) def expect(pat,timeout=9999999)

View file

@ -529,7 +529,7 @@ inspect_ipv4_add_drop_membership(int level, int optname, VALUE data, VALUE ret)
if (RSTRING_LEN(data) == sizeof(struct ip_mreq)) if (RSTRING_LEN(data) == sizeof(struct ip_mreq))
return inspect_ipv4_mreq(level, optname, data, ret); return inspect_ipv4_mreq(level, optname, data, ret);
# if defined(HAVE_TYPE_STRUCT_IP_MREQN) # if defined(HAVE_TYPE_STRUCT_IP_MREQN)
else if (RSTRING_LEN(data) == sizeof(struct ip_mreqn)) else if (RSTRING_LEN(data) == sizeof(struct ip_mreqn))
return inspect_ipv4_mreqn(level, optname, data, ret); return inspect_ipv4_mreqn(level, optname, data, ret);
# endif # endif
else else

View file

@ -5,7 +5,7 @@
require 'mkmf' require 'mkmf'
TkLib_Config = {} TkLib_Config = {}
TkLib_Config['search_versions'] = TkLib_Config['search_versions'] =
# %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2] # %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2]
# %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0] # %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0]
%w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps
@ -26,7 +26,7 @@ end
$cleanfiles << 'config_list' $cleanfiles << 'config_list'
config_list_file = 'config_list' config_list_file = 'config_list'
config_list_file_source = File.join(File.dirname(__FILE__),'config_list.in') config_list_file_source = File.join(File.dirname(__FILE__),'config_list.in')
if !File.exist?(config_list_file) || if !File.exist?(config_list_file) ||
File.ctime(config_list_file_source) > File.ctime(config_list_file) File.ctime(config_list_file_source) > File.ctime(config_list_file)
old_config_list_file = config_list_file_source old_config_list_file = config_list_file_source
else else
@ -92,7 +92,7 @@ if update_flag
else else
makefile = 'Makefile' makefile = 'Makefile'
if File.exist?(makefile) && if File.exist?(makefile) &&
File.ctime(config_list_file) > File.ctime(makefile) File.ctime(config_list_file) > File.ctime(makefile)
# no need to update Makefile # no need to update Makefile
exit exit
@ -197,7 +197,7 @@ def get_shlib_path_head
else else
[ [
'/opt', '/pkg', '/share', '/opt', '/pkg', '/share',
'/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
'/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
].each{|dir| ].each{|dir|
@ -268,7 +268,7 @@ def find_macosx_framework
end end
# framework is disabled? # framework is disabled?
if with_config("tcltk-framework") == false || if with_config("tcltk-framework") == false ||
enable_config("tcltk-framework") == false enable_config("tcltk-framework") == false
return false return false
end end
@ -276,7 +276,7 @@ def find_macosx_framework
use_framework ||= (framework_dir = with_config("tcltk-framework")) use_framework ||= (framework_dir = with_config("tcltk-framework"))
if framework_dir.kind_of? String if framework_dir.kind_of? String
TkLib_Config["tcltk-framework"] = framework_dir.strip.chomp('/') TkLib_Config["tcltk-framework"] = framework_dir.strip.chomp('/')
return [File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework'), return [File.join(TkLib_Config["tcltk-framework"], 'Tcl.framework'),
File.join(TkLib_Config["tcltk-framework"], 'Tk.framework')] File.join(TkLib_Config["tcltk-framework"], 'Tk.framework')]
end end
@ -287,7 +287,7 @@ def find_macosx_framework
end end
paths = [ paths = [
#"~/Library/Frameworks", #"~/Library/Frameworks",
"/Library/Frameworks", "/Library/Frameworks",
"/Network/Library/Frameworks", "/System/Library/Frameworks" "/Network/Library/Frameworks", "/System/Library/Frameworks"
] ]
@ -305,7 +305,7 @@ end
def collect_tcltk_defs(tcl_defs_str, tk_defs_str) def collect_tcltk_defs(tcl_defs_str, tk_defs_str)
conflicts = [ conflicts = [
'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION', 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION',
'PACKAGE_STRING', 'PACKAGE_BUGREPORT' 'PACKAGE_STRING', 'PACKAGE_BUGREPORT'
] ]
@ -347,7 +347,7 @@ def collect_tcltk_defs(tcl_defs_str, tk_defs_str)
defs.delete_if{|name,value| defs.delete_if{|name,value|
conflicts.include?(name) || conflicts.include?(name) ||
( (vtcl = tcl_defs.assoc(name)) && (vtk = tk_defs.assoc(name)) && ( (vtcl = tcl_defs.assoc(name)) && (vtk = tk_defs.assoc(name)) &&
vtcl != vtk ) vtcl != vtk )
} }
@ -433,7 +433,7 @@ def get_tclConfig_dirs
File.join(base, 'Tk.framework', 'Versions', 'Current') File.join(base, 'Tk.framework', 'Versions', 'Current')
] ]
Dir.glob(File.join(base, 'Tcl.framework', Dir.glob(File.join(base, 'Tcl.framework',
'Versions', '*')).sort.reverse.each{|dir| 'Versions', '*')).sort.reverse.each{|dir|
next if dir =~ /Current/ next if dir =~ /Current/
config_dir << [dir, dir.gsub(/Tcl/, 'Tk')] config_dir << [dir, dir.gsub(/Tcl/, 'Tk')]
@ -446,14 +446,14 @@ def get_tclConfig_dirs
config_dir.concat [ config_dir.concat [
RbConfig::CONFIG['libdir'], RbConfig::CONFIG['libdir'],
File.join(RbConfig::CONFIG['exec_prefix'], 'lib'), File.join(RbConfig::CONFIG['exec_prefix'], 'lib'),
File.join(RbConfig::CONFIG['prefix'], 'lib'), File.join(RbConfig::CONFIG['prefix'], 'lib'),
"/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib", "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib",
"/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib", "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib",
"/usr/share/lib", "/usr/contrib/lib", "/usr/lib" "/usr/share/lib", "/usr/contrib/lib", "/usr/lib"
] ]
config_dir.concat [ config_dir.concat [
'/opt', '/pkg', '/share', '/opt', '/pkg', '/share',
'/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
'/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
].map{|dir| ].map{|dir|
@ -483,7 +483,7 @@ def get_tclConfig_dirs
} }
paths = [ paths = [
#"~/Library/Frameworks", #"~/Library/Frameworks",
"/Library/Frameworks", "/Library/Frameworks",
"/Network/Library/Frameworks", "/System/Library/Frameworks" "/Network/Library/Frameworks", "/System/Library/Frameworks"
] ]
@ -500,7 +500,7 @@ def get_tclConfig_dirs
File.join(base, 'Tk.framework', 'Versions', 'Current') File.join(base, 'Tk.framework', 'Versions', 'Current')
] ]
Dir.glob(File.join(base, 'Tcl.framework', Dir.glob(File.join(base, 'Tcl.framework',
'Versions', '*')).sort.reverse.each{|dir| 'Versions', '*')).sort.reverse.each{|dir|
next if dir =~ /Current/ next if dir =~ /Current/
config_dir << [dir, dir.gsub(/Tcl/, 'Tk')] config_dir << [dir, dir.gsub(/Tcl/, 'Tk')]
@ -702,7 +702,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
end end
def get_tclConfig(tclConfig_file, tkConfig_file, tclConfig_dir, tkConfig_dir) def get_tclConfig(tclConfig_file, tkConfig_file, tclConfig_dir, tkConfig_dir)
use_tclConfig = (tclConfig_file != false) && (tkConfig_file != false) && use_tclConfig = (tclConfig_file != false) && (tkConfig_file != false) &&
(tclConfig_dir != false) && (tkConfig_dir != false) (tclConfig_dir != false) && (tkConfig_dir != false)
unless use_tclConfig unless use_tclConfig
@ -736,11 +736,11 @@ def get_tclConfig(tclConfig_file, tkConfig_file, tclConfig_dir, tkConfig_dir)
TkLib_Config["tclConfig-dir"] = tclConfig_dir TkLib_Config["tclConfig-dir"] = tclConfig_dir
TkLib_Config["tkConfig-dir"] = tkConfig_dir TkLib_Config["tkConfig-dir"] = tkConfig_dir
print("Search tclConfig.sh", (tclConfig_dir)? " (in #{tclConfig_dir})": "", print("Search tclConfig.sh", (tclConfig_dir)? " (in #{tclConfig_dir})": "",
" and tkConfig.sh", (tkConfig_dir)? " (in #{tkConfig_dir})": "", ".") " and tkConfig.sh", (tkConfig_dir)? " (in #{tkConfig_dir})": "", ".")
if tclConfig_dir if tclConfig_dir
tclConfig, tkConfig = tclConfig, tkConfig =
search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir), search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir),
((tkConfig_file)? tkConfig_file: tkConfig_dir) ]) ((tkConfig_file)? tkConfig_file: tkConfig_dir) ])
else else
tclConfig, tkConfig = search_tclConfig() tclConfig, tkConfig = search_tclConfig()
@ -1057,7 +1057,7 @@ def find_tk(tklib, stubs, version, *opt_paths)
ret ret
end end
def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion, def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion,
tcl_opt_paths, tk_opt_paths) tcl_opt_paths, tk_opt_paths)
ret = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths) ret = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths)
unless ret && ret.find{|path, val| val} unless ret && ret.find{|path, val| val}
@ -1094,7 +1094,7 @@ def find_tcltk_header(tclver, tkver)
base_dir.delete_if{|path| path =~ / /} base_dir.delete_if{|path| path =~ / /}
end end
if TclConfig_Info['TCL_INCLUDE_SPEC'] && if TclConfig_Info['TCL_INCLUDE_SPEC'] &&
have_tcl_h = try_cpp('#include <tcl.h>', TclConfig_Info['TCL_INCLUDE_SPEC']) have_tcl_h = try_cpp('#include <tcl.h>', TclConfig_Info['TCL_INCLUDE_SPEC'])
$INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC'] $INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC']
elsif have_tcl_h = have_header('tcl.h') elsif have_tcl_h = have_header('tcl.h')
@ -1106,7 +1106,7 @@ def find_tcltk_header(tclver, tkver)
versions = TkLib_Config['search_versions'] versions = TkLib_Config['search_versions']
end end
paths = base_dir.dup paths = base_dir.dup
versions.each{|ver| versions.each{|ver|
paths.concat(base_dir.map{|dir| paths.concat(base_dir.map{|dir|
[dir + '/tcl' + ver, dir + '/tcl' + ver.delete('.')] [dir + '/tcl' + ver, dir + '/tcl' + ver.delete('.')]
}.flatten) }.flatten)
@ -1114,7 +1114,7 @@ def find_tcltk_header(tclver, tkver)
have_tcl_h = find_header('tcl.h', *paths) have_tcl_h = find_header('tcl.h', *paths)
end end
if TkConfig_Info['TK_INCLUDE_SPEC'] && if TkConfig_Info['TK_INCLUDE_SPEC'] &&
have_tk_h = try_cpp('#include <tk.h>', TkConfig_Info['TK_INCLUDE_SPEC']) have_tk_h = try_cpp('#include <tk.h>', TkConfig_Info['TK_INCLUDE_SPEC'])
$INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC'] $INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC']
elsif have_tk_h = have_header('tk.h') elsif have_tk_h = have_header('tk.h')
@ -1126,7 +1126,7 @@ def find_tcltk_header(tclver, tkver)
versions = TkLib_Config['search_versions'] versions = TkLib_Config['search_versions']
end end
paths = base_dir.dup paths = base_dir.dup
versions.each{|ver| versions.each{|ver|
paths.concat(base_dir.map{|dir| paths.concat(base_dir.map{|dir|
[dir + '/tk' + ver, dir + '/tk' + ver.delete('.')] [dir + '/tk' + ver, dir + '/tk' + ver.delete('.')]
}.flatten) }.flatten)
@ -1158,14 +1158,14 @@ def setup_for_macosx_framework(tclver, tkver)
TclConfig_Info['TCL_INCLUDE_SPEC'] << File.join(tcl_base, 'Headers') TclConfig_Info['TCL_INCLUDE_SPEC'] << File.join(tcl_base, 'Headers')
unless tclver unless tclver
dir = Dir.glob(File.join(tcl_base, 'Versions', '*', 'Headers'), dir = Dir.glob(File.join(tcl_base, 'Versions', '*', 'Headers'),
File::FNM_CASEFOLD).sort.reverse[0] File::FNM_CASEFOLD).sort.reverse[0]
TclConfig_Info['TCL_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir TclConfig_Info['TCL_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir
end end
end end
if TkLib_Config["tk-framework-header"] if TkLib_Config["tk-framework-header"]
TkConfig_Info['TK_INCLUDE_SPEC'] = TkConfig_Info['TK_INCLUDE_SPEC'] =
"-I#{TkLib_Config["tk-framework-header"].quote} " "-I#{TkLib_Config["tk-framework-header"].quote} "
else else
TkConfig_Info['TK_INCLUDE_SPEC'] = "" TkConfig_Info['TK_INCLUDE_SPEC'] = ""
@ -1179,7 +1179,7 @@ def setup_for_macosx_framework(tclver, tkver)
TkConfig_Info['TK_INCLUDE_SPEC'] << File.join(tk_base, 'Headers') TkConfig_Info['TK_INCLUDE_SPEC'] << File.join(tk_base, 'Headers')
unless tkver unless tkver
dir = Dir.glob(File.join(tk_base, 'Versions', '*', 'Headers'), dir = Dir.glob(File.join(tk_base, 'Versions', '*', 'Headers'),
File::FNM_CASEFOLD).sort.reverse[0] File::FNM_CASEFOLD).sort.reverse[0]
TkConfig_Info['TK_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir TkConfig_Info['TK_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir
end end
@ -1288,9 +1288,9 @@ def pthread_check()
** **
** NATIVETHREAD SUPPORT CHECK WARNING: ** NATIVETHREAD SUPPORT CHECK WARNING:
** **
** We cannot check the consistency of nativethread support between ** We cannot check the consistency of nativethread support between
** Ruby and the Tcl/Tk library in your environment (are you perhaps ** Ruby and the Tcl/Tk library in your environment (are you perhaps
** cross-compiling?). If nativethread support for these 2 packages ** cross-compiling?). If nativethread support for these 2 packages
** is inconsistent you may find you get errors when running Ruby/Tk ** is inconsistent you may find you get errors when running Ruby/Tk
** (e.g. hangs or segmentation faults). We strongly recommend ** (e.g. hangs or segmentation faults). We strongly recommend
** you to check the consistency manually. ** you to check the consistency manually.
@ -1333,17 +1333,17 @@ EOF
** **
** NATIVETHREAD SUPPORT MODE WARNING: ** NATIVETHREAD SUPPORT MODE WARNING:
** **
** Ruby is compiled with --enable-pthread, but your Tcl/Tk library ** Ruby is compiled with --enable-pthread, but your Tcl/Tk library
** seems to be compiled without nativethread support. Although you can ** seems to be compiled without nativethread support. Although you can
** create the tcltklib library, this combination may cause errors (e.g. ** create the tcltklib library, this combination may cause errors (e.g.
** hangs or segmentation faults). If you have no reason to keep the ** hangs or segmentation faults). If you have no reason to keep the
** current nativethread support status, we recommend you reconfigure and ** current nativethread support status, we recommend you reconfigure and
** recompile the libraries so that both or neither support nativethreads. ** recompile the libraries so that both or neither support nativethreads.
** **
** If you want change the status of nativethread support, please recompile ** If you want change the status of nativethread support, please recompile
** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x ** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x
** or later, you cannot remove this option, because it requires native- ** or later, you cannot remove this option, because it requires native-
** thread support.) or recompile Tcl/Tk with "--enable-threads" configure ** thread support.) or recompile Tcl/Tk with "--enable-threads" configure
** option (if your Tcl/Tk is later than or equal to Tcl/Tk 8.1). ** option (if your Tcl/Tk is later than or equal to Tcl/Tk 8.1).
** **
***************************************************************************** *****************************************************************************
@ -1434,14 +1434,14 @@ end
$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
# Does ruby have nativethread ? # Does ruby have nativethread ?
TkLib_Config["ruby_with_thread"] = TkLib_Config["ruby_with_thread"] =
macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"') macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"')
#--------------------------------------------------- #---------------------------------------------------
# check requirement of Tcl/tk version # check requirement of Tcl/tk version
tcltk_version = with_config("tcltkversion") tcltk_version = with_config("tcltkversion")
tclver, tkver = tclver, tkver =
TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version) TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version)
puts("Specified Tcl/Tk version is #{[tclver, tkver].inspect}") if tclver&&tkver puts("Specified Tcl/Tk version is #{[tclver, tkver].inspect}") if tclver&&tkver
@ -1464,12 +1464,12 @@ end
TkLib_Config["ActiveTcl"] = activeTcl TkLib_Config["ActiveTcl"] = activeTcl
# allow space chars on a libpath # allow space chars on a libpath
TkLib_Config["space-on-tk-libpath"] = TkLib_Config["space-on-tk-libpath"] =
enable_config("space-on-tk-libpath", ! is_win32?) enable_config("space-on-tk-libpath", ! is_win32?)
# enable Tcl/Tk stubs? # enable Tcl/Tk stubs?
=begin =begin
if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] && if TclConfig_Info['TCL_STUB_LIB_SPEC'] && TkConfig_Info['TK_STUB_LIB_SPEC'] &&
!TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty? && !TclConfig_Info['TCL_STUB_LIB_SPEC'].strip.empty? &&
!TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty? !TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty?
stubs = true stubs = true
@ -1562,7 +1562,7 @@ use_X = search_X_libraries
if (TkLib_Config["tcltk-framework"] || if (TkLib_Config["tcltk-framework"] ||
( find_tcltk_header(tclver, tkver) && ( find_tcltk_header(tclver, tkver) &&
find_tcltk_library(tcllib, tklib, stubs, tclver, tkver, find_tcltk_library(tcllib, tklib, stubs, tclver, tkver,
tcl_ldir_list, tk_ldir_list) ) ) && tcl_ldir_list, tk_ldir_list) ) ) &&
(stubs || pthread_check()) (stubs || pthread_check())
# create Makefile # create Makefile

View file

@ -774,7 +774,7 @@ class MultiTkIp
ensure ensure
# interp must be deleted before the thread for interp is dead. # interp must be deleted before the thread for interp is dead.
# If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler
# deleted by the wrong thread. # deleted by the wrong thread.
interp.delete interp.delete
end end
@ -1933,7 +1933,7 @@ class MultiTkIp
end end
=end =end
def cb_eval(cmd, *args) def cb_eval(cmd, *args)
self.eval_callback(*args, self.eval_callback(*args,
&_proc_on_safelevel{|*params| &_proc_on_safelevel{|*params|
TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params)) TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params))
}) })
@ -2121,7 +2121,7 @@ class MultiTkIp
end end
err err
} }
$SAFE=safe if $SAFE < safe; $SAFE=safe if $SAFE < safe;
begin begin
yield(*args) yield(*args)
rescue Exception => e rescue Exception => e
@ -2300,7 +2300,7 @@ end
current[:callback_ip] = backup_ip current[:callback_ip] = backup_ip
end end
else else
eval_proc_core(true, eval_proc_core(true,
proc{|safe, *params| proc{|safe, *params|
Thread.new{cmd.call(safe, *params)}.value Thread.new{cmd.call(safe, *params)}.value
}, },

View file

@ -1306,7 +1306,7 @@ EOS
ensure ensure
# interp must be deleted before the thread for interp is dead. # interp must be deleted before the thread for interp is dead.
# If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler # If not, raise Tcl_Panic on Tcl_AsyncDelete because async handler
# deleted by the wrong thread. # deleted by the wrong thread.
interp.delete interp.delete
end end
@ -1339,7 +1339,7 @@ EOS
INTERP.instance_eval{ INTERP.instance_eval{
# @tk_cmd_tbl = TkUtil.untrust({}) # @tk_cmd_tbl = TkUtil.untrust({})
@tk_cmd_tbl = @tk_cmd_tbl =
TkUtil.untrust(Hash.new{|hash, key| TkUtil.untrust(Hash.new{|hash, key|
fail IndexError, "unknown command ID '#{key}'" fail IndexError, "unknown command ID '#{key}'"
}) })

View file

@ -538,8 +538,8 @@ class << Tk
@TOPLEVEL_ALIAS_TABLE[target][sym] = obj @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
else # NOT topalias_defined?(sym) else # NOT topalias_defined?(sym)
# Nobody controls ALIAS[sym]. # Nobody controls ALIAS[sym].
# At leaset, current widget set doesn't control ALIAS[sym]. # At leaset, current widget set doesn't control ALIAS[sym].
# Keep Object::sym (even if it is not defined) # Keep Object::sym (even if it is not defined)
# Keep OWNER[sym]. # Keep OWNER[sym].
@TOPLEVEL_ALIAS_TABLE[target][sym] = obj @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
@ -552,7 +552,7 @@ class << Tk
@TOPLEVEL_ALIAS_TABLE[target][sym] = obj @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
replace_topalias(sym, obj) replace_topalias(sym, obj)
replace_topobj(sym, obj) replace_topobj(sym, obj)
when nil when nil
# New definition for sym # New definition for sym
@TOPLEVEL_ALIAS_OWNER[sym] = target @TOPLEVEL_ALIAS_OWNER[sym] = target
@ -566,7 +566,7 @@ class << Tk
# Keep ALIAS[sym]. # Keep ALIAS[sym].
# Keep OWNER[sym]. # Keep OWNER[sym].
@TOPLEVEL_ALIAS_TABLE[target][sym] = obj @TOPLEVEL_ALIAS_TABLE[target][sym] = obj
end end
end end
@ -583,7 +583,7 @@ class << Tk
def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols) def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols)
# autopath is an autoload file # autopath is an autoload file
# Currently, this method doesn't support that autoload loads # Currently, this method doesn't support that autoload loads
# different toplevels between <basename>.rb and <basename>.so extension. # different toplevels between <basename>.rb and <basename>.so extension.
shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath
target = target.to_sym target = target.to_sym

View file

@ -86,7 +86,7 @@ class << TkFont::Chooser
def configure(option, value=None) def configure(option, value=None)
if option.kind_of? Hash if option.kind_of? Hash
tk_call('tk', 'fontchooser', 'configure', tk_call('tk', 'fontchooser', 'configure',
*hash_kv(_symbolkey2str(option))) *hash_kv(_symbolkey2str(option)))
else else
opt = option.to_s opt = option.to_s
@ -141,8 +141,8 @@ class << TkFont::Chooser
def set_for(target, title="Font") def set_for(target, title="Font")
if target.kind_of? TkFont if target.kind_of? TkFont
configs = { configs = {
:font=>target.actual_hash, :font=>target.actual_hash,
:command=>proc{|fnt, *args| :command=>proc{|fnt, *args|
target.configure(TkFont.actual_hash(fnt)) target.configure(TkFont.actual_hash(fnt))
} }
} }
@ -152,14 +152,14 @@ class << TkFont::Chooser
fnt = fnt.actual_hash if fnt.kind_of?(TkFont) fnt = fnt.actual_hash if fnt.kind_of?(TkFont)
configs = { configs = {
:font => fnt, :font => fnt,
:command=>proc{|fnt, *args| :command=>proc{|fnt, *args|
target[:font] = TkFont.actual_hash(fnt) target[:font] = TkFont.actual_hash(fnt)
} }
} }
else else
configs = { configs = {
:font=>target.cget_tkstring(:font), :font=>target.cget_tkstring(:font),
:command=>proc{|fnt, *args| :command=>proc{|fnt, *args|
target.font = TkFont.actual_hash_displayof(fnt, target) target.font = TkFont.actual_hash_displayof(fnt, target)
} }
} }

View file

@ -27,7 +27,7 @@
# #
# A menu_info is an array of menu entries: # A menu_info is an array of menu entries:
# [ entry_info, entry_info, ... ] # [ entry_info, entry_info, ... ]
# #
# #
# underline, accelerator, and configs are optional pearameters. # underline, accelerator, and configs are optional pearameters.
# Hashes are OK instead of Arrays. Then the entry type ('command', # Hashes are OK instead of Arrays. Then the entry type ('command',

View file

@ -62,7 +62,7 @@ module Tk
major, minor, type, patchlevel = TclTkLib.get_version major, minor, type, patchlevel = TclTkLib.get_version
# ttk::spinbox is supported on Tcl/Tk8.6b1 or later # ttk::spinbox is supported on Tcl/Tk8.6b1 or later
if ([major,minor,type,patchlevel] <=> if ([major,minor,type,patchlevel] <=>
[8,6,TclTkLib::RELEASE_TYPE::BETA,1]) >= 0 [8,6,TclTkLib::RELEASE_TYPE::BETA,1]) >= 0
@TOPLEVEL_ALIAS_TABLE[:Ttk].update( @TOPLEVEL_ALIAS_TABLE[:Ttk].update(
:TkSpinbox => 'tkextlib/tile/tspinbox' :TkSpinbox => 'tkextlib/tile/tspinbox'

View file

@ -3,7 +3,7 @@
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
# #
# * Part of tcllib extension # * Part of tcllib extension
# * # *
# #
require 'tk' require 'tk'

View file

@ -3,7 +3,7 @@
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
# #
# * Part of tcllib extension # * Part of tcllib extension
# * # *
# #
require 'tk' require 'tk'

View file

@ -3,7 +3,7 @@
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
# #
# * Part of tcllib extension # * Part of tcllib extension
# * chatwidget - Provides a multi-paned view suitable for display of # * chatwidget - Provides a multi-paned view suitable for display of
# chat room or irc channel information # chat room or irc channel information
# #
@ -92,7 +92,7 @@ class Tk::Tcllib::ChatWidget
def hook_add(type, *args, &blk) # args -> [prior, cmd], [prior], [cmd] def hook_add(type, *args, &blk) # args -> [prior, cmd], [prior], [cmd]
#type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url' #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url'
if prior = args.shift if prior = args.shift
if !prior.kind_of?(Numeric) if !prior.kind_of?(Numeric)
cmd = prior cmd = prior

View file

@ -70,6 +70,6 @@ class Tk::Tcllib::IP_Entry
end end
end end
class Tk::Tcllib::IP_Entry6 < Tk::Tcllib::IP_Entry class Tk::Tcllib::IP_Entry6 < Tk::Tcllib::IP_Entry
TkCommandNames = ['::ipentry::ipentry6'.freeze].freeze TkCommandNames = ['::ipentry::ipentry6'.freeze].freeze
end end

View file

@ -43,11 +43,11 @@ class Tk::Tcllib::KHIM
def self.set_config(*args) def self.set_config(*args)
if args.length == 1 if args.length == 1
# cmd_string generated by # cmd_string generated by
#Tk.ip_eval_without_enc(cmd_string) #Tk.ip_eval_without_enc(cmd_string)
Tk.ip_eval(cmd_string) Tk.ip_eval(cmd_string)
else else
# args for setConfig command # args for setConfig command
#Tk.tk_call_without_enc('::khim::setConfig', *args) #Tk.tk_call_without_enc('::khim::setConfig', *args)
Tk.tk_call('::khim::setConfig', *args) Tk.tk_call('::khim::setConfig', *args)
end end

View file

@ -221,7 +221,7 @@ module Tk::Tcllib::Plotchart
end end
def legend(series, text) def legend(series, text)
tk_call_without_enc(@chart, 'legend', tk_call_without_enc(@chart, 'legend',
_get_eval_enc_str(series), _get_eval_enc_str(text)) _get_eval_enc_str(series), _get_eval_enc_str(text))
self self
end end
@ -238,7 +238,7 @@ module Tk::Tcllib::Plotchart
text, dir = args text, dir = args
tk_call_without_enc(@chart, 'balloon', x, y, tk_call_without_enc(@chart, 'balloon', x, y,
_get_eval_enc_str(text), dir) _get_eval_enc_str(text), dir)
self self
end end
@ -263,7 +263,7 @@ module Tk::Tcllib::Plotchart
text, dir = args text, dir = args
tk_call_without_enc(@chart, 'plaintext', x, y, tk_call_without_enc(@chart, 'plaintext', x, y,
_get_eval_enc_str(text), dir) _get_eval_enc_str(text), dir)
self self
end end
@ -485,7 +485,7 @@ module Tk::Tcllib::Plotchart
end end
def dot(series, xcrd, ycrd, value) def dot(series, xcrd, ycrd, value)
tk_call_without_enc(@chart, 'dot', _get_eval_enc_str(series), tk_call_without_enc(@chart, 'dot', _get_eval_enc_str(series),
xcrd, ycrd, value) xcrd, ycrd, value)
self self
end end
@ -804,7 +804,7 @@ module Tk::Tcllib::Plotchart
private :_create_chart private :_create_chart
def plot(label, yvalue, color) def plot(label, yvalue, color)
tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(label), tk_call_without_enc(@chart, 'plot', _get_eval_enc_str(label),
_get_eval_enc_str(yvalue), color) _get_eval_enc_str(yvalue), color)
self self
end end
@ -1262,8 +1262,8 @@ module Tk::Tcllib::Plotchart
# time_begin := String of time format (e.g. "1 january 2004") # time_begin := String of time format (e.g. "1 january 2004")
# time_end := String of time format (e.g. "1 january 2004") # time_end := String of time format (e.g. "1 january 2004")
# args := Expected/maximum number of items # args := Expected/maximum number of items
# ( This determines the vertical spacing. ), # ( This determines the vertical spacing. ),
# Expected/maximum width of items, # Expected/maximum width of items,
# Option Hash ( { key=>value, ... } ) # Option Hash ( { key=>value, ... } )
if args[0].kind_of?(String) if args[0].kind_of?(String)
@time_begin = args.shift @time_begin = args.shift

View file

@ -10,7 +10,7 @@ require 'tkextlib/tcllib.rb'
# check Tile extension :: If already loaded, use tablelist_tile. # check Tile extension :: If already loaded, use tablelist_tile.
unless defined? Tk::Tcllib::Tablelist_usingTile unless defined? Tk::Tcllib::Tablelist_usingTile
Tk::Tcllib::Tablelist_usingTile = Tk::Tcllib::Tablelist_usingTile =
TkPackage.provide('tile') || TkPackage.provide('Ttk') TkPackage.provide('tile') || TkPackage.provide('Ttk')
end end

View file

@ -419,7 +419,7 @@ class Tk::Tcllib::Tablelist
columnwidth(idx, 'total') columnwidth(idx, 'total')
end end
def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...]
ary = [] ary = []
lst.slice(3){|idx, opt, val| lst.slice(3){|idx, opt, val|
ary << _to_idx(idx) << "-#{opt}" << val ary << _to_idx(idx) << "-#{opt}" << val
@ -439,7 +439,7 @@ class Tk::Tcllib::Tablelist
end end
alias config_cells configcells alias config_cells configcells
def configcolumnlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] def configcolumnlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...]
ary = [] ary = []
lst.slice(3){|idx, opt, val| lst.slice(3){|idx, opt, val|
ary << _to_idx(idx) << "-#{opt}" << val ary << _to_idx(idx) << "-#{opt}" << val
@ -459,7 +459,7 @@ class Tk::Tcllib::Tablelist
end end
alias config_columns configcolumns alias config_columns configcolumns
def configrowlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] def configrowlist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...]
ary = [] ary = []
lst.slice(3){|idx, opt, val| lst.slice(3){|idx, opt, val|
ary << _to_idx(idx) << "-#{opt}" << val ary << _to_idx(idx) << "-#{opt}" << val
@ -841,11 +841,11 @@ class Tk::Tcllib::Tablelist
# default of 'labelcommand' option # default of 'labelcommand' option
DEFAULT_labelcommand_value = DEFAULT_labelcommand_value =
DEFAULT_sortByColumn_cmd = '::tablelist::sortByColumn' DEFAULT_sortByColumn_cmd = '::tablelist::sortByColumn'
# default of 'labelcommand2' option # default of 'labelcommand2' option
DEFAULT_labelcommand2_value = DEFAULT_labelcommand2_value =
DEFAULT_addToSortColumns_cmd = '::tablelist::addToSortColumns' DEFAULT_addToSortColumns_cmd = '::tablelist::addToSortColumns'
def sortByColumn_with_event_generate(idx) def sortByColumn_with_event_generate(idx)
@ -1053,7 +1053,7 @@ class << Tk::Tcllib::Tablelist
else else
gmt = None gmt = None
end end
Tk.tk_call('::tablelist::addDateTimeMentry', Tk.tk_call('::tablelist::addDateTimeMentry',
format, date_sep, time_sep, gmt, name) format, date_sep, time_sep, gmt, name)
end end

View file

@ -28,5 +28,5 @@ end
#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, #Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip,
# :TkSizegrip, :TkSizeGrip) # :TkSizegrip, :TkSizeGrip)
Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/sizegrip.rb', Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/sizegrip.rb',
:Ttk, Tk::Tile::Sizegrip, :Ttk, Tk::Tile::Sizegrip,
:TkSizegrip, :TkSizeGrip) :TkSizegrip, :TkSizeGrip)

View file

@ -295,7 +295,7 @@ class << Tk::Tile::Style
fail ArgumentError, "too many arguments" unless args.empty? fail ArgumentError, "too many arguments" unless args.empty?
# define a Microsoft Visual Styles element # define a Microsoft Visual Styles element
tk_call(TkCommandNames[0], 'element', 'create', name, 'vsapi', tk_call(TkCommandNames[0], 'element', 'create', name, 'vsapi',
class_name, part_id, state_map, opts) class_name, part_id, state_map, opts)
end end

View file

@ -27,7 +27,7 @@ class Tk::RbWidget::Editable_Listbox < TkListbox
if idx = @ebox.pos if idx = @ebox.pos
see(idx) if bbox(idx).empty? see(idx) if bbox(idx).empty?
@ebox.focus(true) @ebox.focus(true)
end end
} }
} }

View file

@ -58,7 +58,7 @@ layout_proc = proc{|parent, mbtn|
=end =end
menubar = TkMenubar.new(nil, menu_spec, menubar = TkMenubar.new(nil, menu_spec,
'layout_proc'=>layout_proc, 'layout_proc'=>layout_proc,
'tearoff'=>false, 'tearoff'=>false,
'foreground'=>'grey40', 'foreground'=>'grey40',
'activeforeground'=>'red', 'activeforeground'=>'red',

View file

@ -87,7 +87,7 @@ if false && Object.const_defined?(:RubyVM) && ::RubyVM.class == Class
Thread.new(l, &y).value Thread.new(l, &y).value
}).pack(:fill=>:x, :padx=>5) }).pack(:fill=>:x, :padx=>5)
else else
# KNOWN BUG:: # KNOWN BUG::
# Current multi-tk.rb cannot support long term threads on callbacks. # Current multi-tk.rb cannot support long term threads on callbacks.
# Such a thread freezes the Ruby/Tk process. # Such a thread freezes the Ruby/Tk process.
end end

View file

@ -209,7 +209,7 @@ end
# test # test
if __FILE__ == $0 if __FILE__ == $0
f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10, f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10,
:width=>300, :height=>200) :width=>300, :height=>200)
f.pack(:expand=>true, :fill=>:both) f.pack(:expand=>true, :fill=>:both)
@ -234,13 +234,13 @@ if __FILE__ == $0
# remove a vertical scrollbar, and then the scrollframe is not scrollable. # remove a vertical scrollbar, and then the scrollframe is not scrollable.
Tk.after(6000){ f.vscroll(false) } Tk.after(6000){ f.vscroll(false) }
# add a vertical scrollbar, and make the scrollframe scrollable. # add a vertical scrollbar, and make the scrollframe scrollable.
Tk.after(9000){ f.vscroll(true) } Tk.after(9000){ f.vscroll(true) }
# remove a horizontal scrollbar, and then the scrollframe is not scrollable. # remove a horizontal scrollbar, and then the scrollframe is not scrollable.
Tk.after(12000){ f.hscroll(false) } Tk.after(12000){ f.hscroll(false) }
# add a horizontal scrollbar, and make the scrollframe scrollable. # add a horizontal scrollbar, and make the scrollframe scrollable.
Tk.after(15000){ f.hscroll(true) } Tk.after(15000){ f.hscroll(true) }
Tk.mainloop Tk.mainloop

View file

@ -201,20 +201,20 @@ if __FILE__ == $0
TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaa'),
TkButton.new(f, :text=>'aaaa')) TkButton.new(f, :text=>'aaaa'))
f = Tk::RbWidget::VBox.new(:borderwidth=>5, f = Tk::RbWidget::VBox.new(:borderwidth=>5,
:relief=>'groove').pack(:fill=>:y, :expand=>true) :relief=>'groove').pack(:fill=>:y, :expand=>true)
f.add(TkButton.new(f, :text=>'a'), f.add(TkButton.new(f, :text=>'a'),
TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'), TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'),
TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaa'),
TkButton.new(f, :text=>'aaaa')) TkButton.new(f, :text=>'aaaa'))
f = Tk::RbWidget::HRBox.new(:borderwidth=>3, f = Tk::RbWidget::HRBox.new(:borderwidth=>3,
:relief=>'raised').pack(:fill=>:x) :relief=>'raised').pack(:fill=>:x)
f.add(TkButton.new(f, :text=>'a'), f.add(TkButton.new(f, :text=>'a'),
TkButton.new(f, :text=>'aa'), TkButton.new(f, :text=>'aa'),
TkButton.new(f, :text=>'aaa')) TkButton.new(f, :text=>'aaa'))
f = Tk::RbWidget::VBBox.new(:borderwidth=>3, f = Tk::RbWidget::VBBox.new(:borderwidth=>3,
:relief=>'ridge').pack(:fill=>:x) :relief=>'ridge').pack(:fill=>:x)
f.propagate = false f.propagate = false
f.height 100 f.height 100

View file

@ -64,8 +64,8 @@ class Tk::RbWidget::BalloonHelp<TkLabel
_balloon_binding(@interval) _balloon_binding(@interval)
# @label = TkLabel.new(@frame, 'background'=>'bisque').pack # @label = TkLabel.new(@frame, 'background'=>'bisque').pack
@label = TkLabel.new(@frame, @label = TkLabel.new(@frame,
'foreground'=>DEFAULT_FOREGROUND, 'foreground'=>DEFAULT_FOREGROUND,
'background'=>DEFAULT_BACKGROUND).pack 'background'=>DEFAULT_BACKGROUND).pack
@label.configure(_symbolkey2str(keys)) unless keys.empty? @label.configure(_symbolkey2str(keys)) unless keys.empty?
@path = @label @path = @label
@ -147,7 +147,7 @@ if __FILE__ == $0
} }
TkButton.new('text'=>'This button has another balloon help') {|b| TkButton.new('text'=>'This button has another balloon help') {|b|
pack('fill'=>'x') pack('fill'=>'x')
Tk::RbWidget::BalloonHelp.new(b, Tk::RbWidget::BalloonHelp.new(b,
'text'=>"CONFIGURED MESSAGE\nchange colors, and so on", 'text'=>"CONFIGURED MESSAGE\nchange colors, and so on",
'interval'=>200, 'font'=>'courier', 'interval'=>200, 'font'=>'courier',
'background'=>'gray', 'foreground'=>'red') 'background'=>'gray', 'foreground'=>'red')

View file

@ -370,7 +370,7 @@ EOD
startwait = keys.delete('startwait'){300} startwait = keys.delete('startwait'){300}
interval = keys.delete('interval'){150} interval = keys.delete('interval'){150}
@lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true, @lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true,
:startwait=>startwait, :startwait=>startwait,
:interval=>interval) :interval=>interval)
@lst.pack(:fill=>:both, :expand=>true) @lst.pack(:fill=>:both, :expand=>true)
@ -464,7 +464,7 @@ if __FILE__ == $0
# e0.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu)) # e0.values(%w(aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu))
v = TkVariable.new v = TkVariable.new
e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true, e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true,
:textvariable=>v, :textvariable=>v,
:arrowrelief=>:flat, :arrowborderwidth=>0, :arrowrelief=>:flat, :arrowborderwidth=>0,
:startwait=>400, :interval=>200).pack :startwait=>400, :interval=>200).pack
@ -480,9 +480,9 @@ if __FILE__ == $0
TkFrame.new(:relief=>:raised, :borderwidth=>2, TkFrame.new(:relief=>:raised, :borderwidth=>2,
:height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3) :height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3)
l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove, l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove,
:borderwidth=>4,:height=>7, :borderwidth=>4,:height=>7,
:width=>20).pack(:fill=>:both, :width=>20).pack(:fill=>:both,
:expand=>true) :expand=>true)
(0..20).each{|i| l.insert('end', "line #{i}")} (0..20).each{|i| l.insert('end', "line #{i}")}

View file

@ -334,7 +334,7 @@ ruby_tk_stubs_init(tcl_ip)
FIX ME : dirty hack for Mac OS X frameworks. FIX ME : dirty hack for Mac OS X frameworks.
With stubs, fails to find Resource/Script directory of Tk.framework. With stubs, fails to find Resource/Script directory of Tk.framework.
So, teach it to a Tcl interpreter by an environment variable. So, teach it to a Tcl interpreter by an environment variable.
e.g. when $tcl_library == e.g. when $tcl_library ==
/Library/Frameworks/Tcl.framwwork/8.5/Resources/Scripts /Library/Frameworks/Tcl.framwwork/8.5/Resources/Scripts
==> /Library/Frameworks/Tk.framwwork/8.5/Resources/Scripts ==> /Library/Frameworks/Tk.framwwork/8.5/Resources/Scripts
*/ */

View file

@ -950,7 +950,7 @@ Tcl_AppInitProc Dde_Init, Dde_SafeInit, Registry_Init;
static char *rubytk_kitpath = NULL; static char *rubytk_kitpath = NULL;
static char rubytkkit_preInitCmd[] = static char rubytkkit_preInitCmd[] =
"proc tclKitPreInit {} {\n" "proc tclKitPreInit {} {\n"
"rename tclKitPreInit {}\n" "rename tclKitPreInit {}\n"
"load {} rubytk_kitpath\n" "load {} rubytk_kitpath\n"
@ -1009,7 +1009,7 @@ static char rubytkkit_preInitCmd[] =
; ;
#if 0 #if 0
/* Not use this script. /* Not use this script.
It's a memo to support an initScript for Tcl interpreters in the future. */ It's a memo to support an initScript for Tcl interpreters in the future. */
static const char initScript[] = static const char initScript[] =
"if {[file isfile [file join $::tcl::kitpath main.tcl]]} {\n" "if {[file isfile [file join $::tcl::kitpath main.tcl]]} {\n"
@ -1179,8 +1179,8 @@ static int
call_tclkit_init_script(Tcl_Interp *interp) call_tclkit_init_script(Tcl_Interp *interp)
{ {
#if 0 #if 0
/* Currently, do nothing in this function. /* Currently, do nothing in this function.
It's a memo (quoted from kitInit.c of Tclkit) It's a memo (quoted from kitInit.c of Tclkit)
to support an initScript for Tcl interpreters in the future. */ to support an initScript for Tcl interpreters in the future. */
if (Tcl_EvalEx(interp, initScript, -1, TCL_EVAL_GLOBAL) == TCL_OK) { if (Tcl_EvalEx(interp, initScript, -1, TCL_EVAL_GLOBAL) == TCL_OK) {
const char *encoding = NULL; const char *encoding = NULL;
@ -1247,7 +1247,7 @@ setup_rubytkkit()
/* rbtk_win32_SetHINSTANCE("tcltklib.so"); */ /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */
{ {
volatile VALUE basename; volatile VALUE basename;
basename = rb_funcall(rb_cFile, rb_intern("basename"), 1, basename = rb_funcall(rb_cFile, rb_intern("basename"), 1,
rb_str_new2(rb_sourcefile())); rb_str_new2(rb_sourcefile()));
rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename)); rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename));
} }

View file

@ -24,7 +24,7 @@
((__GNUC__ <= 3) && (__GNUC_MINOR__ < 4)) || \ ((__GNUC__ <= 3) && (__GNUC_MINOR__ < 4)) || \
((__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4))) ((__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4)))
#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
#ifndef NONAMELESSUNION #ifndef NONAMELESSUNION
#define NONAMELESSUNION 1 #define NONAMELESSUNION 1
#endif #endif
@ -56,13 +56,13 @@
#define DOUTI(x) fprintf(stderr, "[%ld]:" #x "=%d\n",__LINE__,x) #define DOUTI(x) fprintf(stderr, "[%ld]:" #x "=%d\n",__LINE__,x)
#define DOUTD(x) fprintf(stderr, "[%d]:" #x "=%f\n",__LINE__,x) #define DOUTD(x) fprintf(stderr, "[%d]:" #x "=%f\n",__LINE__,x)
#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
#define V_UNION1(X, Y) ((X)->u.Y) #define V_UNION1(X, Y) ((X)->u.Y)
#else #else
#define V_UNION1(X, Y) ((X)->Y) #define V_UNION1(X, Y) ((X)->Y)
#endif #endif
#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4)
#undef V_UNION #undef V_UNION
#define V_UNION(X,Y) ((X)->n1.n2.n3.Y) #define V_UNION(X,Y) ((X)->n1.n2.n3.Y)
@ -1105,7 +1105,7 @@ ole_hresult2msg(HRESULT hr)
dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, hr, NULL, hr,
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
(LPTSTR)&p_msg, 0, NULL); (LPTSTR)&p_msg, 0, NULL);
if (dwCount == 0) { if (dwCount == 0) {

View file

@ -219,7 +219,7 @@ static VALUE rb_gzreader_each(int, VALUE*, VALUE);
static VALUE rb_gzreader_readlines(int, VALUE*, VALUE); static VALUE rb_gzreader_readlines(int, VALUE*, VALUE);
#endif /* GZIP_SUPPORT */ #endif /* GZIP_SUPPORT */
/* /*
* Document-module: Zlib * Document-module: Zlib
* *
* == Overview * == Overview
@ -227,7 +227,7 @@ static VALUE rb_gzreader_readlines(int, VALUE*, VALUE);
* Access to the zlib library. * Access to the zlib library.
* *
* == Class tree * == Class tree
* *
* - Zlib::Deflate * - Zlib::Deflate
* - Zlib::Inflate * - Zlib::Inflate
* - Zlib::ZStream * - Zlib::ZStream
@ -1264,7 +1264,7 @@ rb_deflate_s_allocate(VALUE klass)
* filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no * filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no
* string match). * string match).
* *
* == Description * == Description
* *
* Creates a new deflate stream for compression. See zlib.h for details of * Creates a new deflate stream for compression. See zlib.h for details of
* each argument. If an argument is nil, the default value of that argument is * each argument. If an argument is nil, the default value of that argument is
@ -1276,14 +1276,14 @@ rb_deflate_s_allocate(VALUE klass)
* === basic * === basic
* *
* f = File.new("compressed.file","w+") * f = File.new("compressed.file","w+")
* #=> #<File:compressed.file> * #=> #<File:compressed.file>
* f << Zlib::Deflate.new().deflate(File.read("big.file")) * f << Zlib::Deflate.new().deflate(File.read("big.file"))
* #=> #<File:compressed.file> * #=> #<File:compressed.file>
* f.close * f.close
* #=> nil * #=> nil
* *
* === a little more robust * === a little more robust
* *
* compressed_file = File.open("compressed.file", "w+") * compressed_file = File.open("compressed.file", "w+")
* #=> #<File:compressed.file> * #=> #<File:compressed.file>
* zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION, 15, Zlib::MAX_MEM_LEVEL, Zlib::HUFFMAN_ONLY) * zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION, 15, Zlib::MAX_MEM_LEVEL, Zlib::HUFFMAN_ONLY)
@ -1423,7 +1423,7 @@ do_deflate(struct zstream *z, VALUE src, int flush)
* call-seq: deflate(string[, flush]) * call-seq: deflate(string[, flush])
* *
* == Arguments * == Arguments
* *
* +string+:: * +string+::
* String * String
* *
@ -1446,7 +1446,7 @@ do_deflate(struct zstream *z, VALUE src, int flush)
* == Usage * == Usage
* *
* comp = Zlib.deflate(File.read("big.file")) * comp = Zlib.deflate(File.read("big.file"))
* or * or
* comp = Zlib.deflate(File.read("big.file"), Zlib::FULL_FLUSH) * comp = Zlib.deflate(File.read("big.file"), Zlib::FULL_FLUSH)
* *
*/ */
@ -1611,7 +1611,7 @@ rb_inflate_s_allocate(VALUE klass)
} }
/* /*
* Document-method: Zlib::Inflate.new * Document-method: Zlib::Inflate.new
* *
* call-seq: Zlib::Inflate.new(window_bits) * call-seq: Zlib::Inflate.new(window_bits)
* *
@ -1639,7 +1639,7 @@ rb_inflate_s_allocate(VALUE klass)
* zi.close * zi.close
* cf.close * cf.close
* *
* or * or
* *
* File.open("compressed.file") {|cf| * File.open("compressed.file") {|cf|
* zi = Zlib::Inflate.new * zi = Zlib::Inflate.new
@ -4027,13 +4027,13 @@ Init_zlib()
rb_define_method(cZStream, "flush_next_out", rb_zstream_flush_next_out, 0); rb_define_method(cZStream, "flush_next_out", rb_zstream_flush_next_out, 0);
/* Integer representing date types which /* Integer representing date types which
* ZStream#data_type method returns */ * ZStream#data_type method returns */
rb_define_const(mZlib, "BINARY", INT2FIX(Z_BINARY)); rb_define_const(mZlib, "BINARY", INT2FIX(Z_BINARY));
/* Integer representing date types which /* Integer representing date types which
* ZStream#data_type method returns */ * ZStream#data_type method returns */
rb_define_const(mZlib, "ASCII", INT2FIX(Z_ASCII)); rb_define_const(mZlib, "ASCII", INT2FIX(Z_ASCII));
/* Integer representing date types which /* Integer representing date types which
* ZStream#data_type method returns */ * ZStream#data_type method returns */
rb_define_const(mZlib, "UNKNOWN", INT2FIX(Z_UNKNOWN)); rb_define_const(mZlib, "UNKNOWN", INT2FIX(Z_UNKNOWN));
cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream); cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream);
@ -4317,7 +4317,7 @@ Init_zlib()
* *
* Subclass of Zlib::Error * Subclass of Zlib::Error
* *
* When zlib returns a Z_STREAM_ERROR, * When zlib returns a Z_STREAM_ERROR,
* usually if the stream state was inconsistent. * usually if the stream state was inconsistent.
* *
*/ */

View file

@ -274,7 +274,7 @@ extern char **rb_w32_get_environ(void);
extern void rb_w32_free_environ(char **); extern void rb_w32_free_environ(char **);
extern int rb_w32_map_errno(DWORD); extern int rb_w32_map_errno(DWORD);
extern char * WSAAPI rb_w32_inet_ntop(int,void *,char *,size_t); extern char * WSAAPI rb_w32_inet_ntop(int,void *,char *,size_t);
extern DWORD rb_w32_osver(void); extern DWORD rb_w32_osver(void);
extern int chown(const char *, int, int); extern int chown(const char *, int, int);
extern int rb_w32_uchown(const char *, int, int); extern int rb_w32_uchown(const char *, int, int);

4
io.c
View file

@ -7795,7 +7795,7 @@ rb_io_fcntl(int argc, VALUE *argv, VALUE io)
* +String+ objects or +Integer+ objects. A +String+ object is passed * +String+ objects or +Integer+ objects. A +String+ object is passed
* as a pointer to the byte sequence. An +Integer+ object is passed * as a pointer to the byte sequence. An +Integer+ object is passed
* as an integer whose bit size is same as a pointer. * as an integer whose bit size is same as a pointer.
* Up to nine parameters may be passed (14 on the Atari-ST). * Up to nine parameters may be passed (14 on the Atari-ST).
* *
* The function identified by _num_ is system * The function identified by _num_ is system
* dependent. On some Unix systems, the numbers may be obtained from a * dependent. On some Unix systems, the numbers may be obtained from a
@ -7854,7 +7854,7 @@ rb_f_syscall(int argc, VALUE *argv)
int num, retval = -1; int num, retval = -1;
#endif #endif
int i; int i;
if (RTEST(ruby_verbose)) { if (RTEST(ruby_verbose)) {
rb_warning("We plan to remove a syscall function at future release. DL(Fiddle) provides safer alternative."); rb_warning("We plan to remove a syscall function at future release. DL(Fiddle) provides safer alternative.");
} }

View file

@ -266,7 +266,7 @@ end
# ERB::Compiler # ERB::Compiler
class ERB class ERB
# = ERB::Compiler # = ERB::Compiler
# #
# Compiles ERB templates into Ruby code; the compiled code produces the # Compiles ERB templates into Ruby code; the compiled code produces the
# template result when evaluated. ERB::Compiler provides hooks to define how # template result when evaluated. ERB::Compiler provides hooks to define how
# generated output is handled. # generated output is handled.
@ -308,7 +308,7 @@ class ERB
# #
# obj = 'It' # obj = 'It'
# eval code # eval code
# #
# Evaluate using an input: # Evaluate using an input:
# #
# mod = Module.new # mod = Module.new

View file

@ -154,7 +154,7 @@ module IRB
begin begin
candidates = [] candidates = []
rec = eval(receiver, bind) rec = eval(receiver, bind)
if sep == "::" and rec.kind_of?(Module) if sep == "::" and rec.kind_of?(Module)
candidates = rec.constants.collect{|m| m.to_s} candidates = rec.constants.collect{|m| m.to_s}
end end
candidates |= rec.methods.collect{|m| m.to_s} candidates |= rec.methods.collect{|m| m.to_s}

View file

@ -112,9 +112,9 @@ module IRB
# @CONF[:LC_MESSAGES] = "en" # @CONF[:LC_MESSAGES] = "en"
@CONF[:LC_MESSAGES] = Locale.new @CONF[:LC_MESSAGES] = Locale.new
@CONF[:AT_EXIT] = [] @CONF[:AT_EXIT] = []
@CONF[:DEBUG_LEVEL] = 1 @CONF[:DEBUG_LEVEL] = 1
end end
@ -160,7 +160,7 @@ module IRB
opt = $1 || ARGV.shift opt = $1 || ARGV.shift
set_encoding(*opt.split(':', 2)) set_encoding(*opt.split(':', 2))
when "--inspect" when "--inspect"
if /^-/ !~ ARGV.first if /^-/ !~ ARGV.first
@CONF[:INSPECT_MODE] = ARGV.shift @CONF[:INSPECT_MODE] = ARGV.shift
else else
@CONF[:INSPECT_MODE] = true @CONF[:INSPECT_MODE] = true

View file

@ -7,7 +7,7 @@
# #
# -- # --
# #
# #
# #
module IRB module IRB
@ -57,13 +57,13 @@ module IRB
# else # else
# inspector = IRB::Inspector(block, init_p) # inspector = IRB::Inspector(block, init_p)
# end # end
if block_given? if block_given?
inspector = IRB::Inspector(block, arg) inspector = IRB::Inspector(block, arg)
else else
inspector = arg inspector = arg
end end
case key case key
when Array when Array
for k in key for k in key
@ -81,7 +81,7 @@ module IRB
end end
INSPECTORS.def_inspector([false, :to_s, :raw]){|v| v.to_s} 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 begin
v.inspect v.inspect
rescue NoMethodError rescue NoMethodError
@ -89,7 +89,7 @@ module IRB
end end
} }
INSPECTORS.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp} 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 begin
YAML.dump(v) YAML.dump(v)
rescue rescue
@ -98,12 +98,12 @@ module IRB
end end
} }
INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v| INSPECTORS.def_inspector([:marshal, :Marshal, :MARSHAL, Marshal]){|v|
Marshal.dump(v) Marshal.dump(v)
} }
end end

View file

@ -136,7 +136,7 @@ module IRB
end end
# @param paths load paths in which IRB find a localized file. # @param paths load paths in which IRB find a localized file.
# @param dir directory # @param dir directory
# @param file basename to be localized # @param file basename to be localized
# #
# typically, for the parameters and a <path> in paths, it searches # typically, for the parameters and a <path> in paths, it searches

View file

@ -1100,7 +1100,7 @@ class RubyLex
@indent = 0 @indent = 0
@indent_stack = [] @indent_stack = []
@lex_state = EXPR_BEG @lex_state = EXPR_BEG
loop do loop do
@continue = false @continue = false
prompt prompt
@ -1119,7 +1119,7 @@ class RubyLex
@quoted = reserve_quoted @quoted = reserve_quoted
end end
end end
def identify_comment def identify_comment
@ltype = "#" @ltype = "#"

View file

@ -601,7 +601,7 @@ int main() {printf("%d\\n", conftest_const); return 0;}
end end
# You should use +have_func+ rather than +try_func+. # You should use +have_func+ rather than +try_func+.
# #
# [+func+] a String which contains a symbol name # [+func+] a String which contains a symbol name
# [+libs+] a String which contains library names. # [+libs+] a String which contains library names.
# [+headers+] a String or an Array of strings which contains # [+headers+] a String or an Array of strings which contains
@ -691,7 +691,7 @@ def macro_defined?(macro, src, opt = "", &b)
SRC SRC
end end
# Returns whether or not # Returns whether or not
# * the +src+ can be compiled as a C source, # * the +src+ can be compiled as a C source,
# * the result object can be linked with its depending libraries successfully, # * the result object can be linked with its depending libraries successfully,
# * the linked file can be invoked as an executable # * the linked file can be invoked as an executable
@ -1754,7 +1754,7 @@ end
# Processes the data contents of the "depend" file. # Processes the data contents of the "depend" file.
# Each line of this file is expected to be a file name. # Each line of this file is expected to be a file name.
# #
# Returns the output of findings, in Makefile format. # Returns the output of findings, in Makefile format.
# #
def depend_rules(depend) def depend_rules(depend)

View file

@ -313,7 +313,7 @@ module Net
@receiver_thread.join @receiver_thread.join
synchronize do synchronize do
unless @sock.closed? unless @sock.closed?
@sock.close @sock.close
end end
end end
raise e if e raise e if e

View file

@ -90,7 +90,7 @@ class RDoc::Markup::FormatterTestCase < MiniTest::Unit::TestCase
## ##
# Calls start_accepting which needs to verify startup state # Calls start_accepting which needs to verify startup state
def test_start_accepting def test_start_accepting
@to.start_accepting @to.start_accepting
@ -100,7 +100,7 @@ class RDoc::Markup::FormatterTestCase < MiniTest::Unit::TestCase
## ##
# Calls end_accepting on your test case which needs to call # Calls end_accepting on your test case which needs to call
# <tt>@to.end_accepting</tt> and verify document generation # <tt>@to.end_accepting</tt> and verify document generation
def test_end_accepting def test_end_accepting
@to.start_accepting @to.start_accepting
@to.res << 'hi' @to.res << 'hi'
@ -196,7 +196,7 @@ class RDoc::Markup::FormatterTestCase < MiniTest::Unit::TestCase
@to.start_accepting @to.start_accepting
@to.accept_heading @RM::Heading.new(1, '\\Hello') @to.accept_heading @RM::Heading.new(1, '\\Hello')
accept_heading_suppressed_crossref accept_heading_suppressed_crossref
end end

View file

@ -185,7 +185,7 @@ class RDoc::Parser
end end
## ##
# Creates a new Parser storing +top_level+, +file_name+, +content+, # Creates a new Parser storing +top_level+, +file_name+, +content+,
# +options+ and +stats+ in instance variables. # +options+ and +stats+ in instance variables.
# #
# Usually invoked by +super+ # Usually invoked by +super+

View file

@ -1560,7 +1560,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
else else
new_methods = [] new_methods = []
case vis_type case vis_type
when 'module_function' then when 'module_function' then
args = parse_symbol_arg args = parse_symbol_arg
container.set_visibility_for args, :private, false container.set_visibility_for args, :private, false

View file

@ -407,7 +407,7 @@ class RDoc::RubyLex
(ch = getc) (ch = getc)
res << ch res << ch
end end
gets # consume =end gets # consume =end
@ltype = nil @ltype = nil

View file

@ -50,7 +50,7 @@ class Gem::Commands::ServerCommand < Gem::Command
options[:addresses].push(*address) options[:addresses].push(*address)
end end
add_option '-l', '--launch[=COMMAND]', add_option '-l', '--launch[=COMMAND]',
'launches a browser window', 'launches a browser window',
"COMMAND defaults to 'start' on Windows", "COMMAND defaults to 'start' on Windows",
"and 'open' on all other platforms" do |launch, options| "and 'open' on all other platforms" do |launch, options|

View file

@ -19,7 +19,7 @@ class Gem::Ext::Builder
def self.make(dest_path, results) def self.make(dest_path, results)
unless File.exist? 'Makefile' then 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 end
mf = File.read('Makefile') mf = File.read('Makefile')

View file

@ -236,7 +236,7 @@ class Gem::Package::TarWriter
name = newname name = newname
if name.size > 100 or prefix.size > 155 then if name.size > 100 or prefix.size > 155 then
raise Gem::Package::TooLongFileName raise Gem::Package::TooLongFileName
end end
end end

View file

@ -482,35 +482,35 @@ class Set
end end
end end
# #
# SortedSet implements a Set that guarantees that it's element are # SortedSet implements a Set that guarantees that it's element are
# yielded in sorted order (according to the return values of their # yielded in sorted order (according to the return values of their
# #<=> methods) when iterating over them. # #<=> methods) when iterating over them.
# #
# All elements that are added to a SortedSet must respond to the <=> # All elements that are added to a SortedSet must respond to the <=>
# method for comparison. # method for comparison.
# #
# Also, all elements must be <em>mutually comparable</em>: <tt>el1 <=> # Also, all elements must be <em>mutually comparable</em>: <tt>el1 <=>
# el2</tt> must not return <tt>nil</tt> for any elements <tt>el1</tt> # el2</tt> must not return <tt>nil</tt> for any elements <tt>el1</tt>
# and <tt>el2</tt>, else an ArgumentError will be raised when # and <tt>el2</tt>, else an ArgumentError will be raised when
# iterating over the SortedSet. # iterating over the SortedSet.
# #
# == Example # == Example
# #
# require "set" # require "set"
# #
# set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3]) # set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3])
# ary = [] # ary = []
# #
# set.each do |obj| # set.each do |obj|
# ary << obj # ary << obj
# end # end
# #
# p ary # => [1, 2, 3, 4, 5, 6] # p ary # => [1, 2, 3, 4, 5, 6]
# #
# set2 = SortedSet.new([1, 2, "3"]) # set2 = SortedSet.new([1, 2, "3"])
# set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed # set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed
# #
class SortedSet < Set class SortedSet < Set
@@setup = false @@setup = false
@ -535,7 +535,7 @@ class SortedSet < Set
@hash = RBTree.new @hash = RBTree.new
super super
end end
def add(o) def add(o)
o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>" o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
super super

View file

@ -19,10 +19,10 @@ require "e2mmap.rb"
# STDERR.puts "Thread #{t} has terminated." # STDERR.puts "Thread #{t} has terminated."
# end # end
# #
# #
# th = ThreadsWait.new(thread1,...) # th = ThreadsWait.new(thread1,...)
# th.next_wait # next one to be done # th.next_wait # next one to be done
# #
# #
class ThreadsWait class ThreadsWait
RCS_ID='-$Id: thwait.rb,v 1.3 1998/06/26 03:19:34 keiju Exp keiju $-' RCS_ID='-$Id: thwait.rb,v 1.3 1998/06/26 03:19:34 keiju Exp keiju $-'

View file

@ -1,11 +1,11 @@
# tracer.rb - # tracer.rb -
# $Release Version: 0.3$ # $Release Version: 0.3$
# $Revision: 1.12 $ # $Revision: 1.12 $
# by Keiju ISHITSUKA(keiju@ishitsuka.com) # by Keiju ISHITSUKA(keiju@ishitsuka.com)
# #
# -- # --
# #
# #
# #
require "thread" require "thread"
@ -136,7 +136,7 @@ class Tracer
return unless p.call event, file, line, id, binding, klass return unless p.call event, file, line, id, binding, klass
end end
return unless Tracer::display_c_call? or return unless Tracer::display_c_call? or
event != "c-call" && event != "c-return" event != "c-call" && event != "c-return"
Tracer::stdout_mutex.synchronize do Tracer::stdout_mutex.synchronize do
@ -151,7 +151,7 @@ class Tracer
printf("%s:%d:%s:%s: %s", printf("%s:%d:%s:%s: %s",
file, file,
line, line,
klass || '', klass || '',
EVENT_SYMBOL[event], EVENT_SYMBOL[event],
source) source)
end end

View file

@ -10,9 +10,9 @@
# #
module URI module URI
# #
# Includes URI::REGEXP::PATTERN # Includes URI::REGEXP::PATTERN
# #
module REGEXP module REGEXP
# #
# Patterns used to parse URI's # Patterns used to parse URI's
@ -111,7 +111,7 @@ module URI
# see also URI::Parser.initialize_pattern # see also URI::Parser.initialize_pattern
attr_reader :pattern attr_reader :pattern
# The Hash of Regexp # The Hash of Regexp
# #
# see also URI::Parser.initialize_regexp # see also URI::Parser.initialize_regexp
attr_reader :regexp attr_reader :regexp
@ -197,7 +197,7 @@ module URI
# #
# == Description # == Description
# #
# parses +uri+ and constructs either matching URI scheme object # parses +uri+ and constructs either matching URI scheme object
# (FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic # (FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic
# #
# == Usage # == Usage
@ -237,7 +237,7 @@ module URI
uris.inject :merge uris.inject :merge
end end
# #
# :call-seq: # :call-seq:
# extract( str ) # extract( str )
# extract( str, schemes ) # extract( str, schemes )
@ -279,7 +279,7 @@ module URI
end end
end end
# #
# :call-seq: # :call-seq:
# escape( str ) # escape( str )
# escape( str, unsafe ) # escape( str, unsafe )
@ -311,7 +311,7 @@ module URI
end.force_encoding(Encoding::US_ASCII) end.force_encoding(Encoding::US_ASCII)
end end
# #
# :call-seq: # :call-seq:
# unescape( str ) # unescape( str )
# unescape( str, unsafe ) # unescape( str, unsafe )

View file

@ -151,7 +151,7 @@ module URI
end end
end end
# typecode accessor # typecode accessor
# #
# see URI::FTP::COMPONENT # see URI::FTP::COMPONENT
attr_reader :typecode attr_reader :typecode

View file

@ -251,7 +251,7 @@ module URI
# returns the port component of the URI. # returns the port component of the URI.
# #
# URI("http://foo/bar/baz").port #=> "80" # URI("http://foo/bar/baz").port #=> "80"
# #
# URI("http://foo:8080/bar/baz").port #=> "8080" # URI("http://foo:8080/bar/baz").port #=> "8080"
# #
attr_reader :port attr_reader :port
@ -265,13 +265,13 @@ module URI
# returns the path component of the URI. # returns the path component of the URI.
# #
# URI("http://foo/bar/baz").path #=> "/bar/baz" # URI("http://foo/bar/baz").path #=> "/bar/baz"
# #
attr_reader :path attr_reader :path
# returns the query component of the URI. # returns the query component of the URI.
# #
# URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar" # URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar"
# #
attr_reader :query attr_reader :query
# returns the opaque part of the URI. # returns the opaque part of the URI.
@ -287,7 +287,7 @@ module URI
# returns the fragment component of the URI. # returns the fragment component of the URI.
# #
# URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies" # URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies"
# #
attr_reader :fragment attr_reader :fragment
# returns the parser to be used. # returns the parser to be used.
@ -518,7 +518,7 @@ module URI
# (with validation) # (with validation)
# #
# see also URI::Generic.userinfo= # see also URI::Generic.userinfo=
# #
def set_userinfo(user, password = nil) def set_userinfo(user, password = nil)
unless password unless password
user, password = split_userinfo(user) user, password = split_userinfo(user)
@ -1081,7 +1081,7 @@ module URI
end end
private :split_path private :split_path
# #
# Merges a base path +base+, with relative path +rel+, # Merges a base path +base+, with relative path +rel+,
# returns a modified base path. # returns a modified base path.
# #

View file

@ -151,7 +151,7 @@ module WEBrick
# at directory +root+ # at directory +root+
# #
# If +options+ is a Hash the following keys are allowed: # If +options+ is a Hash the following keys are allowed:
# #
# :AcceptableLanguages:: Array of languages allowed for accept-language # :AcceptableLanguages:: Array of languages allowed for accept-language
# :DirectoryCallback:: Allows preprocessing of directory requests # :DirectoryCallback:: Allows preprocessing of directory requests
# :FancyIndexing:: If true, show an index for directories # :FancyIndexing:: If true, show an index for directories
@ -166,7 +166,7 @@ module WEBrick
# #
# If +options+ is true or false then +:FancyIndexing+ is enabled or # If +options+ is true or false then +:FancyIndexing+ is enabled or
# disabled respectively. # disabled respectively.
def initialize(server, root, options={}, default=Config::FileHandler) def initialize(server, root, options={}, default=Config::FileHandler)
@config = server.config @config = server.config
@logger = @config[:Logger] @logger = @config[:Logger]

View file

@ -4,7 +4,7 @@ require 'dbm'
module YAML module YAML
# YAML + DBM = YDBM # YAML + DBM = YDBM
# #
# YAML::DBM provides the same interface as ::DBM. # YAML::DBM provides the same interface as ::DBM.
# #
# However, while DBM only allows strings for both keys and values, # However, while DBM only allows strings for both keys and values,
@ -199,7 +199,7 @@ class DBM < ::DBM
a a
end end
# Converts the contents of the database to an in-memory Hash object, and # Converts the contents of the database to an in-memory Hash object, and
# returns it. # returns it.
def to_hash def to_hash

View file

@ -6,7 +6,7 @@
This implementation of the PWB library alloca() function, This implementation of the PWB library alloca() function,
which is used to allocate space off the run-time stack so 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. was inspired by discussions with J. Q. Johnson of Cornell.
It should work under any C implementation that uses an It should work under any C implementation that uses an

View file

@ -27,7 +27,7 @@ int
flock(int fd, int operation) flock(int fd, int operation)
{ {
struct flock lock; struct flock lock;
switch (operation & ~LOCK_NB) { switch (operation & ~LOCK_NB) {
case LOCK_SH: case LOCK_SH:
lock.l_type = F_RDLCK; lock.l_type = F_RDLCK;
@ -44,7 +44,7 @@ flock(int fd, int operation)
} }
lock.l_whence = SEEK_SET; lock.l_whence = SEEK_SET;
lock.l_start = lock.l_len = 0L; lock.l_start = lock.l_len = 0L;
return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &lock); return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &lock);
} }

View file

@ -27,7 +27,7 @@ isinf(double n)
#include <ieeefp.h> #include <ieeefp.h>
#endif #endif
/* /*
* isinf may be provided only as a macro. * isinf may be provided only as a macro.
* ex. HP-UX, Solaris 10 * ex. HP-UX, Solaris 10
* http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html * http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html

View file

@ -65,7 +65,7 @@ nl_langinfo_codeset(void)
{ {
const char *l, *p; const char *l, *p;
int n; int n;
if (((l = getenv("LC_ALL")) && *l) || if (((l = getenv("LC_ALL")) && *l) ||
((l = getenv("LC_CTYPE")) && *l) || ((l = getenv("LC_CTYPE")) && *l) ||
((l = getenv("LANG")) && *l)) { ((l = getenv("LANG")) && *l)) {

View file

@ -94,14 +94,14 @@ char *cmd;
if (*s == '=') if (*s == '=')
goto doshell; */ goto doshell; */
for (s = cmd; *s; s++) { for (s = cmd; *s; s++) {
if (*sw == '-' && *s != ' ' && if (*sw == '-' && *s != ' ' &&
!isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) { !isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) {
if (*s == '\n' && !s[1]) { if (*s == '\n' && !s[1]) {
*s = '\0'; *s = '\0';
break; break;
} }
goto doshell; goto doshell;
} else if (*sw == '/' && *s != ' ' && } else if (*sw == '/' && *s != ' ' &&
!isalpha(*s) && index("^()<>|&\n",*s)) { !isalpha(*s) && index("^()<>|&\n",*s)) {
if (*s == '\n' && !s[1]) { if (*s == '\n' && !s[1]) {
*s = '\0'; *s = '\0';

View file

@ -572,7 +572,7 @@ num_to_int(VALUE num)
* *
* Floating point has a different arithmetic and is a inexact number. * Floating point has a different arithmetic and is a inexact number.
* So you should know its esoteric system. see following: * So you should know its esoteric system. see following:
* *
* - http://docs.sun.com/source/806-3568/ncg_goldberg.html * - http://docs.sun.com/source/806-3568/ncg_goldberg.html
* - http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#floats_imprecise * - http://wiki.github.com/rdp/ruby_tutorials_core/ruby-talk-faq#floats_imprecise
* - http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems * - http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems

12
pack.c
View file

@ -328,7 +328,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* | | * | |
* U | Integer | UTF-8 character * U | Integer | UTF-8 character
* w | Integer | BER-compressed integer * w | Integer | BER-compressed integer
* *
* Float | | * Float | |
* Directive | | Meaning * Directive | | Meaning
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
@ -338,7 +338,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* e | Float | single-precision, little-endian byte order * e | Float | single-precision, little-endian byte order
* G | Float | double-precision, network (big-endian) byte order * G | Float | double-precision, network (big-endian) byte order
* g | Float | single-precision, network (big-endian) byte order * g | Float | single-precision, network (big-endian) byte order
* *
* String | | * String | |
* Directive | | Meaning * Directive | | Meaning
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
@ -355,7 +355,7 @@ static unsigned long utf8_to_uv(const char*,long*);
* | | (if count is 0, no line feed are added, see RFC 4648) * | | (if count is 0, no line feed are added, see RFC 4648)
* P | String | pointer to a structure (fixed-length string) * P | String | pointer to a structure (fixed-length string)
* p | String | pointer to a null-terminated string * p | String | pointer to a null-terminated string
* *
* Misc. | | * Misc. | |
* Directive | | Meaning * Directive | | Meaning
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
@ -1280,7 +1280,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* | | * | |
* U | Integer | UTF-8 character * U | Integer | UTF-8 character
* w | Integer | BER-compressed integer (see Array.pack) * w | Integer | BER-compressed integer (see Array.pack)
* *
* Float | | * Float | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* ----------------------------------------------------------------- * -----------------------------------------------------------------
@ -1290,7 +1290,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* e | Float | single-precision, little-endian byte order * e | Float | single-precision, little-endian byte order
* G | Float | double-precision, network (big-endian) byte order * G | Float | double-precision, network (big-endian) byte order
* g | Float | single-precision, network (big-endian) byte order * g | Float | single-precision, network (big-endian) byte order
* *
* String | | * String | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* ----------------------------------------------------------------- * -----------------------------------------------------------------
@ -1307,7 +1307,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
* | | base64 encoded string (RFC 4648) if followed by 0 * | | base64 encoded string (RFC 4648) if followed by 0
* P | String | pointer to a structure (fixed-length string) * P | String | pointer to a structure (fixed-length string)
* p | String | pointer to a null-terminated string * p | String | pointer to a null-terminated string
* *
* Misc. | | * Misc. | |
* Directive | Returns | Meaning * Directive | Returns | Meaning
* ----------------------------------------------------------------- * -----------------------------------------------------------------

View file

@ -19,7 +19,7 @@ class Thread
# call-seq: # call-seq:
# Thread.exclusive { block } => obj # Thread.exclusive { block } => obj
# #
# Wraps a block in Thread.critical, restoring the original value # Wraps a block in Thread.critical, restoring the original value
# upon exit from the critical section, and returns the value of the # upon exit from the critical section, and returns the value of the
# block. # block.

View file

@ -1203,7 +1203,7 @@ random_equal(VALUE self, VALUE other)
* range.member(number) == true. * range.member(number) == true.
* *
* Or else converts _max_ to an integer using max1 = * Or else converts _max_ to an integer using max1 =
* max<code>.to_i.abs</code>. * max<code>.to_i.abs</code>.
* *
* Then if _max_ is +nil+ the result is zero, returns a pseudorandom floating * Then if _max_ is +nil+ the result is zero, returns a pseudorandom floating
* point number greater than or equal to 0.0 and less than 1.0. * point number greater than or equal to 0.0 and less than 1.0.

View file

@ -1,13 +1,13 @@
#!/usr/local/bin/ruby #!/usr/local/bin/ruby
# #
# biorhythm.rb - # biorhythm.rb -
# $Release Version: $ # $Release Version: $
# $Revision$ # $Revision$
# by Yasuo OHBA(STAFS Development Room) # by Yasuo OHBA(STAFS Development Room)
# #
# -- # --
# #
# #
# #
# probably based on: # probably based on:
@ -91,7 +91,7 @@ display_period = options[:days]
if ausgabeart == "v" if ausgabeart == "v"
print_header(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a")) print_header(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a"))
print "\n" print "\n"
phys, emot, geist = get_position(dd - bd) phys, emot, geist = get_position(dd - bd)
printf "Biorhythm: %04d.%02d.%02d\n", dd.year, dd.month, dd.day printf "Biorhythm: %04d.%02d.%02d\n", dd.year, dd.month, dd.day
printf "Physical: %d%%\n", phys printf "Physical: %d%%\n", phys
@ -104,10 +104,10 @@ else
print " -------------------------+-------------------------\n" print " -------------------------+-------------------------\n"
print " Bad Condition | Good Condition\n" print " Bad Condition | Good Condition\n"
print " -------------------------+-------------------------\n" print " -------------------------+-------------------------\n"
(dd - bd).step(dd - bd + display_period) do |z| (dd - bd).step(dd - bd + display_period) do |z|
phys, emot, geist = get_position(z) phys, emot, geist = get_position(z)
printf "%04d.%02d.%02d : ", dd.year, dd.month, dd.day printf "%04d.%02d.%02d : ", dd.year, dd.month, dd.day
p = (phys / 2.0 + 0.5).to_i p = (phys / 2.0 + 0.5).to_i
e = (emot / 2.0 + 0.5).to_i e = (emot / 2.0 + 0.5).to_i

Some files were not shown because too many files have changed in this diff Show more