diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-15 11:55:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-15 11:55:52 +0000 |
commit | 3a47cf3395dd4c4fe8bdd5df13aab698f2ca314b (patch) | |
tree | c4a278220ba8141b829c5c7b0777c1049cfe413c /ext | |
parent | 39da1b63699faf30c86e753e193c29b81b16136d (diff) | |
download | ruby-3a47cf3395dd4c4fe8bdd5df13aab698f2ca314b.tar.gz |
* remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
40 files changed, 261 insertions, 261 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 83d090280d..7f64288647 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -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 each BDIGIT contains a value between 0 and BASE-1, consisting of BASE_FIG decimal places. - + (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 the array. 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_1further = ((v % shifter) > 0); - + v /= shifter; div = v / 10; v = v - div*10; @@ -4687,12 +4687,12 @@ VpMidRound(Real *y, unsigned short f, ssize_t nf) break; } } - + /* now fracf = does any positive digit exist under the rounding position? now fracf_1further = does any positive digit exist under one further than the rounding position? now v = the first digit under the rounding position */ - + /* drop digits after pointed digit */ memset(y->frac+ix+1, 0, (y->Prec - (ix+1)) * sizeof(BDIGIT)); diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index 2d206385bd..9a84c0be83 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -905,7 +905,7 @@ n2i(const char *s, long f, long w) { long e, i; int v; - + e = f + w; v = 0; for (i = f; i < e; i++) { diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c index fac7abb6f2..8917cce57e 100644 --- a/ext/json/generator/generator.c +++ b/ext/json/generator/generator.c @@ -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. - * + * * Disclaimer - * + * * 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 * 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 * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. - * + * * Limitations on Rights to Redistribute This Code - * + * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * 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 * in a UTF-8 sequence. */ -static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, +static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; /* @@ -399,7 +399,7 @@ static FBuffer *fbuffer_dup(FBuffer *fb) return result; } -/* +/* * Document-module: JSON::Ext::Generator * * 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: ''), * * *space*: a string that is put after, a : or , 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: ''), * * *allow_nan*: true if NaN, Infinity, and -Infinity should be * generated, otherwise an exception is thrown, if these values are diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb index 91cb3c2190..dd9fef8fad 100644 --- a/ext/json/lib/json/common.rb +++ b/ext/json/lib/json/common.rb @@ -185,7 +185,7 @@ module JSON # * *indent*: a string used to indent levels (default: ''), # * *space*: a string that is put after, a : or , 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: ''), # * *allow_nan*: true if NaN, Infinity, and -Infinity should be # generated, otherwise an exception is thrown, if these values are diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index 418c1c32f0..85094b7301 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -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); - + #line 114 "parser.c" { cs = JSON_object_start; } #line 159 "parser.rl" - + #line 121 "parser.c" { if ( p == pe ) @@ -404,32 +404,32 @@ case 26: goto st2; goto st26; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof18: cs = 18; goto _test_eof; - _test_eof27: cs = 27; goto _test_eof; - _test_eof19: cs = 19; goto _test_eof; - _test_eof20: cs = 20; goto _test_eof; - _test_eof21: cs = 21; goto _test_eof; - _test_eof22: cs = 22; goto _test_eof; - _test_eof23: cs = 23; goto _test_eof; - _test_eof24: cs = 24; goto _test_eof; - _test_eof25: cs = 25; goto _test_eof; - _test_eof26: cs = 26; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof27: cs = 27; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof22: cs = 22; goto _test_eof; + _test_eof23: cs = 23; goto _test_eof; + _test_eof24: cs = 24; goto _test_eof; + _test_eof25: cs = 25; goto _test_eof; + _test_eof26: cs = 26; goto _test_eof; _test_eof: {} _out: {} @@ -469,14 +469,14 @@ static char *JSON_parse_value(JSON_Parser *json, char *p, char *pe, VALUE *resul { int cs = EVIL; - + #line 474 "parser.c" { cs = JSON_value_start; } #line 265 "parser.rl" - + #line 481 "parser.c" { if ( p == pe ) @@ -728,26 +728,26 @@ case 20: goto tr28; goto st0; } - _test_eof21: cs = 21; goto _test_eof; - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof18: cs = 18; goto _test_eof; - _test_eof19: cs = 19; goto _test_eof; - _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; _test_eof: {} _out: {} @@ -778,7 +778,7 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res { int cs = EVIL; - + #line 783 "parser.c" { 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" json->memo = p; - + #line 791 "parser.c" { if ( p == pe ) @@ -838,10 +838,10 @@ case 4: goto st4; goto tr4; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; _test_eof: {} _out: {} @@ -874,7 +874,7 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul { int cs = EVIL; - + #line 879 "parser.c" { 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" json->memo = p; - + #line 887 "parser.c" { if ( p == pe ) @@ -995,15 +995,15 @@ case 9: goto st9; goto st0; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; _test_eof: {} _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); - + #line 1048 "parser.c" { cs = JSON_array_start; } #line 371 "parser.rl" - + #line 1055 "parser.c" { if ( p == pe ) @@ -1248,22 +1248,22 @@ case 16: goto st2; goto st16; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof11: cs = 11; goto _test_eof; - _test_eof12: cs = 12; goto _test_eof; - _test_eof17: cs = 17; goto _test_eof; - _test_eof13: cs = 13; goto _test_eof; - _test_eof14: cs = 14; goto _test_eof; - _test_eof15: cs = 15; goto _test_eof; - _test_eof16: cs = 16; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; _test_eof: {} _out: {} @@ -1366,7 +1366,7 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu int cs = EVIL; *result = rb_str_buf_new(0); - + #line 1371 "parser.c" { 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" json->memo = p; - + #line 1379 "parser.c" { if ( p == pe ) @@ -1482,13 +1482,13 @@ case 7: goto st2; goto st0; } - _test_eof2: cs = 2; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; _test_eof: {} _out: {} @@ -1701,7 +1701,7 @@ static VALUE cParser_parse(VALUE self) VALUE result = Qnil; GET_PARSER; - + #line 1706 "parser.c" { cs = JSON_start; @@ -1710,7 +1710,7 @@ static VALUE cParser_parse(VALUE self) #line 703 "parser.rl" p = json->source; pe = p + json->len; - + #line 1715 "parser.c" { if ( p == pe ) @@ -1830,16 +1830,16 @@ case 9: goto st10; goto st9; } - _test_eof1: cs = 1; goto _test_eof; - _test_eof2: cs = 2; goto _test_eof; - _test_eof3: cs = 3; goto _test_eof; - _test_eof4: cs = 4; goto _test_eof; - _test_eof5: cs = 5; goto _test_eof; - _test_eof10: cs = 10; goto _test_eof; - _test_eof6: cs = 6; goto _test_eof; - _test_eof7: cs = 7; goto _test_eof; - _test_eof8: cs = 8; goto _test_eof; - _test_eof9: cs = 9; goto _test_eof; + _test_eof1: cs = 1; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; _test_eof: {} _out: {} diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c index 28e164ab91..fc5b30d921 100644 --- a/ext/nkf/nkf-utf8/nkf.c +++ b/ext/nkf/nkf-utf8/nkf.c @@ -821,7 +821,7 @@ nkf_buf_new(int length) buf->capa = length; buf->len = 0; return buf; -} +} #if 0 static void @@ -5874,7 +5874,7 @@ finished: /* * int options(unsigned char *cp) - * + * * return values: * 0: success * -1: ArgumentError diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index e50ce544ae..ca811964b5 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -845,7 +845,7 @@ ossl_asn1_decode0(unsigned char **pp, long length, long *offset, long depth, ossl_asn1_set_infinite_length(asn1data, Qtrue); else ossl_asn1_set_infinite_length(asn1data, Qfalse); - + rb_ary_push(ary, asn1data); length -= len; if(once) break; diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index d750e95ca3..3122c0e4ea 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -108,7 +108,7 @@ struct { OSSL_SSL_METHOD_ENTRY(TLSv1_server), OSSL_SSL_METHOD_ENTRY(TLSv1_client), #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_server), OSSL_SSL_METHOD_ENTRY(SSLv2_client), diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index 74efc996dc..e1632c524b 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -170,7 +170,7 @@ path_sub(int argc, VALUE *argv, VALUE self) /* * Return a pathname which the extension of the basename is substituted by * <i>repl</i>. - * + * * If self has no extension part, <i>repl</i> is appended. */ 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. * The real pathname doesn't contain symlinks or useless dots. - * + * * The last component of the real pathname can be nonexistent. */ 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(sep, limit [, open_args]) {|line| block } -> nil * pathname.each_line(...) -> an_enumerator - * + * * #each_line iterates over the line in the file. It yields a String object * for each line. - * + * * This method is availabel since 1.8.1. */ static VALUE @@ -265,7 +265,7 @@ path_each_line(int argc, VALUE *argv, VALUE self) * call-seq: * pathname.read([length [, offset]]) -> string * pathname.read([length [, offset]], open_args) -> string - * + * * See <tt>IO.read</tt>. Returns all data from the file, or the first +N+ bytes * if specified. * @@ -284,7 +284,7 @@ path_read(int argc, VALUE *argv, VALUE self) /* * call-seq: * pathname.binread([length [, offset]]) -> string - * + * * See <tt>IO.binread</tt>. Returns all the bytes from the file, or the first +N+ * if specified. * @@ -305,7 +305,7 @@ path_binread(int argc, VALUE *argv, VALUE self) * pathname.readlines(sep=$/ [, open_args]) -> array * pathname.readlines(limit [, open_args]) -> array * pathname.readlines(sep, limit [, open_args]) -> array - * + * * 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: * pathname.sysopen([mode, [perm]]) -> fixnum - * + * * See <tt>IO.sysopen</tt>. * */ @@ -405,7 +405,7 @@ path_lchown(VALUE self, VALUE owner, VALUE group) * call-seq: * pathname.fnmatch(pattern, [flags]) -> string * pathname.fnmatch?(pattern, [flags]) -> string - * + * * See <tt>File.fnmatch</tt>. Return +true+ if the receiver matches the given * pattern. */ diff --git a/ext/psych/lib/psych/nodes.rb b/ext/psych/lib/psych/nodes.rb index 9e5946daa9..f3b33fe975 100644 --- a/ext/psych/lib/psych/nodes.rb +++ b/ext/psych/lib/psych/nodes.rb @@ -31,7 +31,7 @@ module Psych # doc = Psych::Nodes::Document.new # seq = Psych::Nodes::Sequence.new # scalar = Psych::Nodes::Scalar.new('foo') - # + # # # Build up our tree # stream.children << doc # doc.children << seq diff --git a/ext/pty/lib/expect.rb b/ext/pty/lib/expect.rb index 54cf709ee2..0b238af8be 100644 --- a/ext/pty/lib/expect.rb +++ b/ext/pty/lib/expect.rb @@ -4,7 +4,7 @@ class IO # 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, # 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. # The default timeout is 9999999 seconds. def expect(pat,timeout=9999999) diff --git a/ext/socket/option.c b/ext/socket/option.c index 4e7f8735a4..49288a17eb 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -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)) return inspect_ipv4_mreq(level, optname, data, ret); # 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); # endif else diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 388d6fc1aa..c7bc45f150 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -5,7 +5,7 @@ require 'mkmf' 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.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 @@ -26,7 +26,7 @@ end $cleanfiles << 'config_list' config_list_file = 'config_list' 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) old_config_list_file = config_list_file_source else @@ -92,7 +92,7 @@ if update_flag else makefile = 'Makefile' - if File.exist?(makefile) && + if File.exist?(makefile) && File.ctime(config_list_file) > File.ctime(makefile) # no need to update Makefile exit @@ -197,7 +197,7 @@ def get_shlib_path_head else [ - '/opt', '/pkg', '/share', + '/opt', '/pkg', '/share', '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' ].each{|dir| @@ -268,7 +268,7 @@ def find_macosx_framework end # framework is disabled? - if with_config("tcltk-framework") == false || + if with_config("tcltk-framework") == false || enable_config("tcltk-framework") == false return false end @@ -276,7 +276,7 @@ def find_macosx_framework use_framework ||= (framework_dir = with_config("tcltk-framework")) if framework_dir.kind_of? String 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')] end @@ -287,7 +287,7 @@ def find_macosx_framework end paths = [ - #"~/Library/Frameworks", + #"~/Library/Frameworks", "/Library/Frameworks", "/Network/Library/Frameworks", "/System/Library/Frameworks" ] @@ -305,7 +305,7 @@ end def collect_tcltk_defs(tcl_defs_str, tk_defs_str) conflicts = [ - 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION', + 'PACKAGE_NAME', 'PACKAGE_TARNAME', 'PACKAGE_VERSION', 'PACKAGE_STRING', 'PACKAGE_BUGREPORT' ] @@ -347,7 +347,7 @@ def collect_tcltk_defs(tcl_defs_str, tk_defs_str) defs.delete_if{|name,value| 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 ) } @@ -433,7 +433,7 @@ def get_tclConfig_dirs 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| next if dir =~ /Current/ config_dir << [dir, dir.gsub(/Tcl/, 'Tk')] @@ -446,14 +446,14 @@ def get_tclConfig_dirs config_dir.concat [ RbConfig::CONFIG['libdir'], File.join(RbConfig::CONFIG['exec_prefix'], 'lib'), - File.join(RbConfig::CONFIG['prefix'], 'lib'), - "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib", - "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib", + File.join(RbConfig::CONFIG['prefix'], 'lib'), + "/usr/local/opt/lib", "/usr/local/pkg/lib", "/usr/local/share/lib", + "/usr/local/lib", "/usr/opt/lib", "/usr/pkg/lib", "/usr/share/lib", "/usr/contrib/lib", "/usr/lib" ] config_dir.concat [ - '/opt', '/pkg', '/share', + '/opt', '/pkg', '/share', '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local', '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr' ].map{|dir| @@ -483,7 +483,7 @@ def get_tclConfig_dirs } paths = [ - #"~/Library/Frameworks", + #"~/Library/Frameworks", "/Library/Frameworks", "/Network/Library/Frameworks", "/System/Library/Frameworks" ] @@ -500,7 +500,7 @@ def get_tclConfig_dirs 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| next if dir =~ /Current/ 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 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) 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["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})": "", ".") if tclConfig_dir - tclConfig, tkConfig = - search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir), + tclConfig, tkConfig = + search_tclConfig([ ((tclConfig_file)? tclConfig_file: tclConfig_dir), ((tkConfig_file)? tkConfig_file: tkConfig_dir) ]) else tclConfig, tkConfig = search_tclConfig() @@ -1057,7 +1057,7 @@ def find_tk(tklib, stubs, version, *opt_paths) ret 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) ret = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths) unless ret && ret.find{|path, val| val} @@ -1094,7 +1094,7 @@ def find_tcltk_header(tclver, tkver) base_dir.delete_if{|path| path =~ / /} 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']) $INCFLAGS << " " << TclConfig_Info['TCL_INCLUDE_SPEC'] elsif have_tcl_h = have_header('tcl.h') @@ -1106,7 +1106,7 @@ def find_tcltk_header(tclver, tkver) versions = TkLib_Config['search_versions'] end paths = base_dir.dup - versions.each{|ver| + versions.each{|ver| paths.concat(base_dir.map{|dir| [dir + '/tcl' + ver, dir + '/tcl' + ver.delete('.')] }.flatten) @@ -1114,7 +1114,7 @@ def find_tcltk_header(tclver, tkver) have_tcl_h = find_header('tcl.h', *paths) 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']) $INCFLAGS << " " << TkConfig_Info['TK_INCLUDE_SPEC'] elsif have_tk_h = have_header('tk.h') @@ -1126,7 +1126,7 @@ def find_tcltk_header(tclver, tkver) versions = TkLib_Config['search_versions'] end paths = base_dir.dup - versions.each{|ver| + versions.each{|ver| paths.concat(base_dir.map{|dir| [dir + '/tk' + ver, dir + '/tk' + ver.delete('.')] }.flatten) @@ -1158,14 +1158,14 @@ def setup_for_macosx_framework(tclver, tkver) TclConfig_Info['TCL_INCLUDE_SPEC'] << File.join(tcl_base, 'Headers') 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] TclConfig_Info['TCL_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir end end if TkLib_Config["tk-framework-header"] - TkConfig_Info['TK_INCLUDE_SPEC'] = + TkConfig_Info['TK_INCLUDE_SPEC'] = "-I#{TkLib_Config["tk-framework-header"].quote} " else 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') 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] TkConfig_Info['TK_INCLUDE_SPEC'] << "-I#{dir.quote} " if dir end @@ -1288,9 +1288,9 @@ def pthread_check() ** ** 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 -** 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 ** (e.g. hangs or segmentation faults). We strongly recommend ** you to check the consistency manually. @@ -1333,17 +1333,17 @@ EOF ** ** NATIVETHREAD SUPPORT MODE WARNING: ** -** Ruby is compiled with --enable-pthread, but your Tcl/Tk library -** seems to be compiled without nativethread support. Although you can -** create the tcltklib library, this combination may cause errors (e.g. -** hangs or segmentation faults). If you have no reason to keep the -** current nativethread support status, we recommend you reconfigure and +** Ruby is compiled with --enable-pthread, but your Tcl/Tk library +** seems to be compiled without nativethread support. Although you can +** create the tcltklib library, this combination may cause errors (e.g. +** hangs or segmentation faults). If you have no reason to keep the +** current nativethread support status, we recommend you reconfigure and ** recompile the libraries so that both or neither support nativethreads. ** ** If you want change the status of nativethread support, please recompile ** Ruby without "--enable-pthread" configure option (If you use Ruby 1.9.x ** 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). ** ***************************************************************************** @@ -1434,14 +1434,14 @@ end $CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM # Does ruby have nativethread ? -TkLib_Config["ruby_with_thread"] = +TkLib_Config["ruby_with_thread"] = macro_defined?('HAVE_NATIVETHREAD', '#include "ruby.h"') #--------------------------------------------------- # check requirement of Tcl/tk version tcltk_version = with_config("tcltkversion") -tclver, tkver = +tclver, tkver = TkLib_Config["tcltkversion"] = check_tcltk_version(tcltk_version) puts("Specified Tcl/Tk version is #{[tclver, tkver].inspect}") if tclver&&tkver @@ -1464,12 +1464,12 @@ end TkLib_Config["ActiveTcl"] = activeTcl # 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 Tcl/Tk stubs? =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? && !TkConfig_Info['TK_STUB_LIB_SPEC'].strip.empty? stubs = true @@ -1562,7 +1562,7 @@ use_X = search_X_libraries if (TkLib_Config["tcltk-framework"] || ( 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) ) ) && (stubs || pthread_check()) # create Makefile diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index efeaf9830a..b125c6e18e 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -774,7 +774,7 @@ class MultiTkIp ensure # 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. interp.delete end @@ -1933,7 +1933,7 @@ class MultiTkIp end =end def cb_eval(cmd, *args) - self.eval_callback(*args, + self.eval_callback(*args, &_proc_on_safelevel{|*params| TkComm._get_eval_string(TkUtil.eval_cmd(cmd, *params)) }) @@ -2121,7 +2121,7 @@ class MultiTkIp end err } - $SAFE=safe if $SAFE < safe; + $SAFE=safe if $SAFE < safe; begin yield(*args) rescue Exception => e @@ -2300,7 +2300,7 @@ end current[:callback_ip] = backup_ip end else - eval_proc_core(true, + eval_proc_core(true, proc{|safe, *params| Thread.new{cmd.call(safe, *params)}.value }, diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index f00afe9ea0..0fd8cfdb20 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -1306,7 +1306,7 @@ EOS ensure # 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. interp.delete end @@ -1339,7 +1339,7 @@ EOS INTERP.instance_eval{ # @tk_cmd_tbl = TkUtil.untrust({}) - @tk_cmd_tbl = + @tk_cmd_tbl = TkUtil.untrust(Hash.new{|hash, key| fail IndexError, "unknown command ID '#{key}'" }) diff --git a/ext/tk/lib/tk/autoload.rb b/ext/tk/lib/tk/autoload.rb index 2ebee9ea24..f6ca261da9 100644 --- a/ext/tk/lib/tk/autoload.rb +++ b/ext/tk/lib/tk/autoload.rb @@ -538,8 +538,8 @@ class << Tk @TOPLEVEL_ALIAS_TABLE[target][sym] = obj else # NOT topalias_defined?(sym) - # Nobody controls ALIAS[sym]. - # At leaset, current widget set doesn't control ALIAS[sym]. + # Nobody controls ALIAS[sym]. + # At leaset, current widget set doesn't control ALIAS[sym]. # Keep Object::sym (even if it is not defined) # Keep OWNER[sym]. @TOPLEVEL_ALIAS_TABLE[target][sym] = obj @@ -552,7 +552,7 @@ class << Tk @TOPLEVEL_ALIAS_TABLE[target][sym] = obj replace_topalias(sym, obj) replace_topobj(sym, obj) - + when nil # New definition for sym @TOPLEVEL_ALIAS_OWNER[sym] = target @@ -566,7 +566,7 @@ class << Tk # Keep ALIAS[sym]. # Keep OWNER[sym]. @TOPLEVEL_ALIAS_TABLE[target][sym] = obj - + end end @@ -583,7 +583,7 @@ class << Tk def __set_loaded_toplevel_aliases__(autopath, target, obj, *symbols) # 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. shortpath = (autopath =~ /^(.*)(.rb|.so)$/)? $1: autopath target = target.to_sym diff --git a/ext/tk/lib/tk/fontchooser.rb b/ext/tk/lib/tk/fontchooser.rb index 092ffc04bf..694c58a607 100644 --- a/ext/tk/lib/tk/fontchooser.rb +++ b/ext/tk/lib/tk/fontchooser.rb @@ -86,7 +86,7 @@ class << TkFont::Chooser def configure(option, value=None) if option.kind_of? Hash - tk_call('tk', 'fontchooser', 'configure', + tk_call('tk', 'fontchooser', 'configure', *hash_kv(_symbolkey2str(option))) else opt = option.to_s @@ -141,8 +141,8 @@ class << TkFont::Chooser def set_for(target, title="Font") if target.kind_of? TkFont configs = { - :font=>target.actual_hash, - :command=>proc{|fnt, *args| + :font=>target.actual_hash, + :command=>proc{|fnt, *args| target.configure(TkFont.actual_hash(fnt)) } } @@ -152,14 +152,14 @@ class << TkFont::Chooser fnt = fnt.actual_hash if fnt.kind_of?(TkFont) configs = { :font => fnt, - :command=>proc{|fnt, *args| + :command=>proc{|fnt, *args| target[:font] = TkFont.actual_hash(fnt) } } else configs = { - :font=>target.cget_tkstring(:font), - :command=>proc{|fnt, *args| + :font=>target.cget_tkstring(:font), + :command=>proc{|fnt, *args| target.font = TkFont.actual_hash_displayof(fnt, target) } } diff --git a/ext/tk/lib/tk/menuspec.rb b/ext/tk/lib/tk/menuspec.rb index 9521a157d9..cb3597eec9 100644 --- a/ext/tk/lib/tk/menuspec.rb +++ b/ext/tk/lib/tk/menuspec.rb @@ -27,7 +27,7 @@ # # A menu_info is an array of menu entries: # [ entry_info, entry_info, ... ] -# +# # # underline, accelerator, and configs are optional pearameters. # Hashes are OK instead of Arrays. Then the entry type ('command', diff --git a/ext/tk/lib/tk/ttk_selector.rb b/ext/tk/lib/tk/ttk_selector.rb index 522249e6a9..cc9e9928cb 100644 --- a/ext/tk/lib/tk/ttk_selector.rb +++ b/ext/tk/lib/tk/ttk_selector.rb @@ -62,7 +62,7 @@ module Tk major, minor, type, patchlevel = TclTkLib.get_version # 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 @TOPLEVEL_ALIAS_TABLE[:Ttk].update( :TkSpinbox => 'tkextlib/tile/tspinbox' diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb index 0bd59511c1..ba87cd3aae 100644 --- a/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb +++ b/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * +# * # require 'tk' diff --git a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb index e2a5061112..f4ffb48ece 100644 --- a/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb +++ b/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * Part of tcllib extension -# * +# * # require 'tk' diff --git a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb index 860b9e899b..ddb0340c31 100644 --- a/ext/tk/lib/tkextlib/tcllib/chatwidget.rb +++ b/ext/tk/lib/tkextlib/tcllib/chatwidget.rb @@ -3,7 +3,7 @@ # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # # * 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 # @@ -92,7 +92,7 @@ class Tk::Tcllib::ChatWidget def hook_add(type, *args, &blk) # args -> [prior, cmd], [prior], [cmd] #type -> 'message', 'post', 'names_group', 'names_nick', 'chatstate', 'url' - + if prior = args.shift if !prior.kind_of?(Numeric) cmd = prior diff --git a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb index e5e0f8d42d..4878cc3c23 100644 --- a/ext/tk/lib/tkextlib/tcllib/ip_entry.rb +++ b/ext/tk/lib/tkextlib/tcllib/ip_entry.rb @@ -70,6 +70,6 @@ class Tk::Tcllib::IP_Entry 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 end diff --git a/ext/tk/lib/tkextlib/tcllib/khim.rb b/ext/tk/lib/tkextlib/tcllib/khim.rb index 00acff91d9..5dc2130b35 100644 --- a/ext/tk/lib/tkextlib/tcllib/khim.rb +++ b/ext/tk/lib/tkextlib/tcllib/khim.rb @@ -43,11 +43,11 @@ class Tk::Tcllib::KHIM def self.set_config(*args) if args.length == 1 - # cmd_string generated by + # cmd_string generated by #Tk.ip_eval_without_enc(cmd_string) Tk.ip_eval(cmd_string) else - # args for setConfig command + # args for setConfig command #Tk.tk_call_without_enc('::khim::setConfig', *args) Tk.tk_call('::khim::setConfig', *args) end diff --git a/ext/tk/lib/tkextlib/tcllib/plotchart.rb b/ext/tk/lib/tkextlib/tcllib/plotchart.rb index 3c944bb266..2f3d79d427 100644 --- a/ext/tk/lib/tkextlib/tcllib/plotchart.rb +++ b/ext/tk/lib/tkextlib/tcllib/plotchart.rb @@ -221,7 +221,7 @@ module Tk::Tcllib::Plotchart end 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)) self end @@ -238,7 +238,7 @@ module Tk::Tcllib::Plotchart 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) self end @@ -263,7 +263,7 @@ module Tk::Tcllib::Plotchart 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) self end @@ -485,7 +485,7 @@ module Tk::Tcllib::Plotchart end 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) self end @@ -804,7 +804,7 @@ module Tk::Tcllib::Plotchart private :_create_chart 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) self end @@ -1262,8 +1262,8 @@ module Tk::Tcllib::Plotchart # time_begin := 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 - # ( This determines the vertical spacing. ), - # Expected/maximum width of items, + # ( This determines the vertical spacing. ), + # Expected/maximum width of items, # Option Hash ( { key=>value, ... } ) if args[0].kind_of?(String) @time_begin = args.shift diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist.rb b/ext/tk/lib/tkextlib/tcllib/tablelist.rb index b40f7a5b8b..bf5ab6620a 100644 --- a/ext/tk/lib/tkextlib/tcllib/tablelist.rb +++ b/ext/tk/lib/tkextlib/tcllib/tablelist.rb @@ -10,7 +10,7 @@ require 'tkextlib/tcllib.rb' # check Tile extension :: If already loaded, use tablelist_tile. unless defined? Tk::Tcllib::Tablelist_usingTile - Tk::Tcllib::Tablelist_usingTile = + Tk::Tcllib::Tablelist_usingTile = TkPackage.provide('tile') || TkPackage.provide('Ttk') end diff --git a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb index 850e75d845..2a5c415cc7 100644 --- a/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb +++ b/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb @@ -419,7 +419,7 @@ class Tk::Tcllib::Tablelist columnwidth(idx, 'total') end - def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] + def configcelllist(lst) # lst ==> [idx, opt, val, idx, opt, val, ...] ary = [] lst.slice(3){|idx, opt, val| ary << _to_idx(idx) << "-#{opt}" << val @@ -439,7 +439,7 @@ class Tk::Tcllib::Tablelist end 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 = [] lst.slice(3){|idx, opt, val| ary << _to_idx(idx) << "-#{opt}" << val @@ -459,7 +459,7 @@ class Tk::Tcllib::Tablelist end 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 = [] lst.slice(3){|idx, opt, val| ary << _to_idx(idx) << "-#{opt}" << val @@ -841,11 +841,11 @@ class Tk::Tcllib::Tablelist # default of 'labelcommand' option - DEFAULT_labelcommand_value = + DEFAULT_labelcommand_value = DEFAULT_sortByColumn_cmd = '::tablelist::sortByColumn' # default of 'labelcommand2' option - DEFAULT_labelcommand2_value = + DEFAULT_labelcommand2_value = DEFAULT_addToSortColumns_cmd = '::tablelist::addToSortColumns' def sortByColumn_with_event_generate(idx) @@ -1053,7 +1053,7 @@ class << Tk::Tcllib::Tablelist else gmt = None end - Tk.tk_call('::tablelist::addDateTimeMentry', + Tk.tk_call('::tablelist::addDateTimeMentry', format, date_sep, time_sep, gmt, name) end diff --git a/ext/tk/lib/tkextlib/tile/sizegrip.rb b/ext/tk/lib/tkextlib/tile/sizegrip.rb index d7da0a4075..9947e0d870 100644 --- a/ext/tk/lib/tkextlib/tile/sizegrip.rb +++ b/ext/tk/lib/tkextlib/tile/sizegrip.rb @@ -28,5 +28,5 @@ end #Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Sizegrip, # :TkSizegrip, :TkSizeGrip) Tk.__set_loaded_toplevel_aliases__('tkextlib/tile/sizegrip.rb', - :Ttk, Tk::Tile::Sizegrip, + :Ttk, Tk::Tile::Sizegrip, :TkSizegrip, :TkSizeGrip) diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb index f38deda503..108d81f88b 100644 --- a/ext/tk/lib/tkextlib/tile/style.rb +++ b/ext/tk/lib/tkextlib/tile/style.rb @@ -295,7 +295,7 @@ class << Tk::Tile::Style fail ArgumentError, "too many arguments" unless args.empty? # 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) end diff --git a/ext/tk/sample/editable_listbox.rb b/ext/tk/sample/editable_listbox.rb index 7a9ad4450b..890aec032e 100644 --- a/ext/tk/sample/editable_listbox.rb +++ b/ext/tk/sample/editable_listbox.rb @@ -27,7 +27,7 @@ class Tk::RbWidget::Editable_Listbox < TkListbox if idx = @ebox.pos see(idx) if bbox(idx).empty? @ebox.focus(true) - end + end } } diff --git a/ext/tk/sample/menubar3.rb b/ext/tk/sample/menubar3.rb index 129cfd779b..4f42f81c88 100644 --- a/ext/tk/sample/menubar3.rb +++ b/ext/tk/sample/menubar3.rb @@ -58,7 +58,7 @@ layout_proc = proc{|parent, mbtn| =end menubar = TkMenubar.new(nil, menu_spec, - 'layout_proc'=>layout_proc, + 'layout_proc'=>layout_proc, 'tearoff'=>false, 'foreground'=>'grey40', 'activeforeground'=>'red', diff --git a/ext/tk/sample/safe-tk.rb b/ext/tk/sample/safe-tk.rb index 2aeae235df..38131c0155 100644 --- a/ext/tk/sample/safe-tk.rb +++ b/ext/tk/sample/safe-tk.rb @@ -87,7 +87,7 @@ if false && Object.const_defined?(:RubyVM) && ::RubyVM.class == Class Thread.new(l, &y).value }).pack(:fill=>:x, :padx=>5) else - # KNOWN BUG:: + # KNOWN BUG:: # Current multi-tk.rb cannot support long term threads on callbacks. # Such a thread freezes the Ruby/Tk process. end diff --git a/ext/tk/sample/scrollframe.rb b/ext/tk/sample/scrollframe.rb index 6a9381d465..e340e1da3c 100644 --- a/ext/tk/sample/scrollframe.rb +++ b/ext/tk/sample/scrollframe.rb @@ -209,7 +209,7 @@ end # test if __FILE__ == $0 - f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10, + f = Tk::RbWidget::ScrollFrame.new(:scrollbarwidth=>10, :width=>300, :height=>200) f.pack(:expand=>true, :fill=>:both) @@ -234,13 +234,13 @@ if __FILE__ == $0 # remove a vertical scrollbar, and then the scrollframe is not scrollable. 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) } # remove a horizontal scrollbar, and then the scrollframe is not scrollable. 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.mainloop diff --git a/ext/tk/sample/tkalignbox.rb b/ext/tk/sample/tkalignbox.rb index fb1b58f458..f3d083c33d 100644 --- a/ext/tk/sample/tkalignbox.rb +++ b/ext/tk/sample/tkalignbox.rb @@ -201,20 +201,20 @@ if __FILE__ == $0 TkButton.new(f, :text=>'aaa'), 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) f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa', :font=>'Helvetica 30'), TkButton.new(f, :text=>'aaa'), TkButton.new(f, :text=>'aaaa')) - f = Tk::RbWidget::HRBox.new(:borderwidth=>3, + f = Tk::RbWidget::HRBox.new(:borderwidth=>3, :relief=>'raised').pack(:fill=>:x) f.add(TkButton.new(f, :text=>'a'), TkButton.new(f, :text=>'aa'), TkButton.new(f, :text=>'aaa')) - f = Tk::RbWidget::VBBox.new(:borderwidth=>3, + f = Tk::RbWidget::VBBox.new(:borderwidth=>3, :relief=>'ridge').pack(:fill=>:x) f.propagate = false f.height 100 diff --git a/ext/tk/sample/tkballoonhelp.rb b/ext/tk/sample/tkballoonhelp.rb index a9c00d230d..2daa522601 100644 --- a/ext/tk/sample/tkballoonhelp.rb +++ b/ext/tk/sample/tkballoonhelp.rb @@ -64,8 +64,8 @@ class Tk::RbWidget::BalloonHelp<TkLabel _balloon_binding(@interval) # @label = TkLabel.new(@frame, 'background'=>'bisque').pack - @label = TkLabel.new(@frame, - 'foreground'=>DEFAULT_FOREGROUND, + @label = TkLabel.new(@frame, + 'foreground'=>DEFAULT_FOREGROUND, 'background'=>DEFAULT_BACKGROUND).pack @label.configure(_symbolkey2str(keys)) unless keys.empty? @path = @label @@ -147,7 +147,7 @@ if __FILE__ == $0 } TkButton.new('text'=>'This button has another balloon help') {|b| pack('fill'=>'x') - Tk::RbWidget::BalloonHelp.new(b, + Tk::RbWidget::BalloonHelp.new(b, 'text'=>"CONFIGURED MESSAGE\nchange colors, and so on", 'interval'=>200, 'font'=>'courier', 'background'=>'gray', 'foreground'=>'red') diff --git a/ext/tk/sample/tkcombobox.rb b/ext/tk/sample/tkcombobox.rb index 59db565f06..c38bde10d4 100644 --- a/ext/tk/sample/tkcombobox.rb +++ b/ext/tk/sample/tkcombobox.rb @@ -370,7 +370,7 @@ EOD startwait = keys.delete('startwait'){300} interval = keys.delete('interval'){150} - @lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true, + @lst = Tk::RbWidget::AutoScrollListbox.new(@top, :scrollbar=>true, :startwait=>startwait, :interval=>interval) @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)) v = TkVariable.new - e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true, + e = Tk::RbWidget::Combobox.new(:height=>7, :scrollbar=>true, :textvariable=>v, :arrowrelief=>:flat, :arrowborderwidth=>0, :startwait=>400, :interval=>200).pack @@ -480,9 +480,9 @@ if __FILE__ == $0 TkFrame.new(:relief=>:raised, :borderwidth=>2, :height=>3).pack(:fill=>:x, :expand=>true, :padx=>5, :pady=>3) - l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove, - :borderwidth=>4,:height=>7, - :width=>20).pack(:fill=>:both, + l = Tk::RbWidget::AutoScrollListbox.new(nil, :relief=>:groove, + :borderwidth=>4,:height=>7, + :width=>20).pack(:fill=>:both, :expand=>true) (0..20).each{|i| l.insert('end', "line #{i}")} diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c index 4b02fdd728..dd475c3455 100644 --- a/ext/tk/stubs.c +++ b/ext/tk/stubs.c @@ -334,7 +334,7 @@ ruby_tk_stubs_init(tcl_ip) FIX ME : dirty hack for Mac OS X frameworks. With stubs, fails to find Resource/Script directory of Tk.framework. 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/Tk.framwwork/8.5/Resources/Scripts */ diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 5135dfa8db..aecd90302c 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -950,7 +950,7 @@ Tcl_AppInitProc Dde_Init, Dde_SafeInit, Registry_Init; static char *rubytk_kitpath = NULL; -static char rubytkkit_preInitCmd[] = +static char rubytkkit_preInitCmd[] = "proc tclKitPreInit {} {\n" "rename tclKitPreInit {}\n" "load {} rubytk_kitpath\n" @@ -1009,7 +1009,7 @@ static char rubytkkit_preInitCmd[] = ; #if 0 -/* Not use this script. +/* Not use this script. It's a memo to support an initScript for Tcl interpreters in the future. */ static const char initScript[] = "if {[file isfile [file join $::tcl::kitpath main.tcl]]} {\n" @@ -1179,8 +1179,8 @@ static int call_tclkit_init_script(Tcl_Interp *interp) { #if 0 - /* Currently, do nothing in this function. - It's a memo (quoted from kitInit.c of Tclkit) + /* Currently, do nothing in this function. + It's a memo (quoted from kitInit.c of Tclkit) to support an initScript for Tcl interpreters in the future. */ if (Tcl_EvalEx(interp, initScript, -1, TCL_EVAL_GLOBAL) == TCL_OK) { const char *encoding = NULL; @@ -1247,7 +1247,7 @@ setup_rubytkkit() /* rbtk_win32_SetHINSTANCE("tcltklib.so"); */ { 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())); rbtk_win32_SetHINSTANCE(RSTRING_PTR(basename)); } diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index d308db75e7..acc2fea39d 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -24,7 +24,7 @@ ((__GNUC__ <= 3) && (__GNUC_MINOR__ < 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 #define NONAMELESSUNION 1 #endif @@ -56,13 +56,13 @@ #define DOUTI(x) fprintf(stderr, "[%ld]:" #x "=%d\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) #else #define V_UNION1(X, Y) ((X)->Y) #endif -#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #undef V_UNION #define V_UNION(X,Y) ((X)->n1.n2.n3.Y) @@ -1105,7 +1105,7 @@ ole_hresult2msg(HRESULT hr) dwCount = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, hr, + NULL, hr, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (LPTSTR)&p_msg, 0, NULL); if (dwCount == 0) { diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 7a595e32ee..c41e4e29eb 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -219,7 +219,7 @@ static VALUE rb_gzreader_each(int, VALUE*, VALUE); static VALUE rb_gzreader_readlines(int, VALUE*, VALUE); #endif /* GZIP_SUPPORT */ -/* +/* * Document-module: Zlib * * == Overview @@ -227,7 +227,7 @@ static VALUE rb_gzreader_readlines(int, VALUE*, VALUE); * Access to the zlib library. * * == Class tree - * + * * - Zlib::Deflate * - Zlib::Inflate * - Zlib::ZStream @@ -1264,7 +1264,7 @@ rb_deflate_s_allocate(VALUE klass) * filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no * string match). * - * == Description + * == Description * * 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 @@ -1276,14 +1276,14 @@ rb_deflate_s_allocate(VALUE klass) * === basic * * f = File.new("compressed.file","w+") - * #=> #<File:compressed.file> + * #=> #<File:compressed.file> * f << Zlib::Deflate.new().deflate(File.read("big.file")) - * #=> #<File:compressed.file> + * #=> #<File:compressed.file> * f.close - * #=> nil + * #=> nil * * === a little more robust - * + * * compressed_file = File.open("compressed.file", "w+") * #=> #<File:compressed.file> * 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]) * * == Arguments - * + * * +string+:: * String * @@ -1446,7 +1446,7 @@ do_deflate(struct zstream *z, VALUE src, int flush) * == Usage * * comp = Zlib.deflate(File.read("big.file")) - * or + * or * 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) * @@ -1639,7 +1639,7 @@ rb_inflate_s_allocate(VALUE klass) * zi.close * cf.close * - * or + * or * * File.open("compressed.file") {|cf| * zi = Zlib::Inflate.new @@ -4027,13 +4027,13 @@ Init_zlib() rb_define_method(cZStream, "flush_next_out", rb_zstream_flush_next_out, 0); /* Integer representing date types which - * ZStream#data_type method returns */ + * ZStream#data_type method returns */ rb_define_const(mZlib, "BINARY", INT2FIX(Z_BINARY)); /* Integer representing date types which - * ZStream#data_type method returns */ + * ZStream#data_type method returns */ rb_define_const(mZlib, "ASCII", INT2FIX(Z_ASCII)); /* Integer representing date types which - * ZStream#data_type method returns */ + * ZStream#data_type method returns */ rb_define_const(mZlib, "UNKNOWN", INT2FIX(Z_UNKNOWN)); cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream); @@ -4317,7 +4317,7 @@ Init_zlib() * * 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. * */ |