summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-20 06:53:16 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-20 06:53:16 +0000
commite745f9b2702613441435594791cea8ddf0734774 (patch)
treebf175b005eadbd128b2ea7f93b37b5ee647dad20
parentbfdd14d50533d84af67008a6788d7093c844850a (diff)
Merge trivial changes to reduce diffs from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--dir.c2
-rw-r--r--lib/optparse.rb12
-rw-r--r--pack.c5
-rw-r--r--parse.y12
4 files changed, 14 insertions, 17 deletions
diff --git a/dir.c b/dir.c
index c7af1508e0..de3118e5c8 100644
--- a/dir.c
+++ b/dir.c
@@ -1061,7 +1061,7 @@ find_dirsep(const char *s, int flags)
return (char *)p-1;
}
-/* Remove escaping baskclashes */
+/* Remove escaping baskslashes */
static void
remove_backslashes(p)
char *p;
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 2c034043e0..2c91cd004f 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -398,8 +398,7 @@ class OptionParser
self
end
- # :nodoc:
- def add_banner(to)
+ def add_banner(to) # :nodoc:
unless @short or @long
s = desc.join
to << " [" + s + "]..." unless s.empty?
@@ -407,8 +406,7 @@ class OptionParser
to
end
- # :nodoc:
- def match_nonswitch?(str)
+ def match_nonswitch?(str) # :nodoc:
@pattern =~ str unless @short or @long
end
@@ -643,8 +641,7 @@ class OptionParser
end
end
- # :nodoc:
- def add_banner(to)
+ def add_banner(to) # :nodoc:
list.each do |opt|
if opt.respond_to?(:add_banner)
opt.add_banner(to)
@@ -1244,8 +1241,7 @@ class OptionParser
parse_in_order(argv, &nonopt)
end
- # :nodoc:
- def parse_in_order(argv = default_argv, setter = nil, &nonopt)
+ def parse_in_order(argv = default_argv, setter = nil, &nonopt) # :nodoc:
opt, arg, sw, val, rest = nil
nonopt ||= proc {|arg| throw :terminate, arg}
argv.unshift(arg) if arg = catch(:terminate) {
diff --git a/pack.c b/pack.c
index d58792f825..4ee3a9019d 100644
--- a/pack.c
+++ b/pack.c
@@ -1402,7 +1402,6 @@ pack_unpack(str, fmt)
s += len;
break;
-
case 'b':
{
VALUE bitstr;
@@ -1562,6 +1561,7 @@ pack_unpack(str, fmt)
}
PACK_ITEM_ADJUST();
break;
+
case 'L':
PACK_LENGTH_ADJUST(unsigned long,4);
while (len-- > 0) {
@@ -1582,7 +1582,8 @@ pack_unpack(str, fmt)
}
PACK_ITEM_ADJUST();
break;
- case 'Q':
+
+ case 'Q':
PACK_LENGTH_ADJUST_SIZE(QUAD_SIZE);
while (len-- > 0) {
char *tmp = (char*)s;
diff --git a/parse.y b/parse.y
index d1a4d65829..c458661890 100644
--- a/parse.y
+++ b/parse.y
@@ -83,11 +83,11 @@ static int yyerror();
static enum lex_state {
EXPR_BEG, /* ignore newline, +/- is a sign. */
- EXPR_END, /* newline significant, +/- is a operator. */
- EXPR_ARG, /* newline significant, +/- is a operator. */
- EXPR_CMDARG, /* newline significant, +/- is a operator. */
- EXPR_ENDARG, /* newline significant, +/- is a operator. */
- EXPR_MID, /* newline significant, +/- is a operator. */
+ EXPR_END, /* newline significant, +/- is an operator. */
+ EXPR_ARG, /* newline significant, +/- is an operator. */
+ EXPR_CMDARG, /* newline significant, +/- is an operator. */
+ EXPR_ENDARG, /* newline significant, +/- is an operator. */
+ EXPR_MID, /* newline significant, +/- is an operator. */
EXPR_FNAME, /* ignore newline, no reserved words. */
EXPR_DOT, /* right after `.' or `::', no reserved words. */
EXPR_CLASS, /* immediate after `class', no here document. */
@@ -6105,7 +6105,7 @@ rb_id2name(id)
char *name;
if (id < tLAST_TOKEN) {
- int i = 0;
+ int i;
for (i=0; op_tbl[i].token; i++) {
if (op_tbl[i].token == id)