vala r2020 - in trunk: . vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2020 - in trunk: . vala
- Date: Fri, 14 Nov 2008 20:14:46 +0000 (UTC)
Author: juergbi
Date: Fri Nov 14 20:14:46 2008
New Revision: 2020
URL: http://svn.gnome.org/viewvc/vala?rev=2020&view=rev
Log:
2008-11-14 JÃrg Billeter <j bitron ch>
* vala/valagenieparser.vala:
* vala/valaparser.vala:
Avoid C compiler warnings with switch statements
Modified:
trunk/ChangeLog
trunk/vala/valagenieparser.vala
trunk/vala/valaparser.vala
Modified: trunk/vala/valagenieparser.vala
==============================================================================
--- trunk/vala/valagenieparser.vala (original)
+++ trunk/vala/valagenieparser.vala Fri Nov 14 20:14:46 2008
@@ -291,9 +291,9 @@
case TokenType.WHILE:
next ();
return;
+ default:
+ throw new ParseError.SYNTAX (get_error ("expected identifier"));
}
-
- throw new ParseError.SYNTAX (get_error ("expected identifier"));
}
string parse_identifier () throws ParseError {
@@ -326,9 +326,9 @@
case TokenType.NULL:
next ();
return new NullLiteral (get_src (begin));
+ default:
+ throw new ParseError.SYNTAX (get_error ("expected literal"));
}
-
- throw new ParseError.SYNTAX (get_error ("expected literal"));
}
public void parse_file (SourceFile source_file) {
@@ -1091,9 +1091,13 @@
}
var inner = parse_unary_expression ();
return new CastExpression (inner, type, get_src (begin), false);
+ default:
+ break;
}
}
break;
+ default:
+ break;
}
// no cast expression
rollback (begin);
@@ -1106,6 +1110,8 @@
next ();
var op = parse_unary_expression ();
return new AddressofExpression (op, get_src (begin));
+ default:
+ break;
}
var expr = parse_primary_expression ();
@@ -1631,10 +1637,10 @@
case TokenType.OP_PTR:
rollback (begin);
return true;
+ default:
+ rollback (begin);
+ return false;
}
-
- rollback (begin);
- return false;
}
Block parse_embedded_statement () throws ParseError {
Modified: trunk/vala/valaparser.vala
==============================================================================
--- trunk/vala/valaparser.vala (original)
+++ trunk/vala/valaparser.vala Fri Nov 14 20:14:46 2008
@@ -236,9 +236,9 @@
case TokenType.YIELDS:
next ();
return;
+ default:
+ throw new ParseError.SYNTAX (get_error ("expected identifier"));
}
-
- throw new ParseError.SYNTAX (get_error ("expected identifier"));
}
string parse_identifier () throws ParseError {
@@ -281,9 +281,9 @@
case TokenType.NULL:
next ();
return new NullLiteral (get_src (begin));
+ default:
+ throw new ParseError.SYNTAX (get_error ("expected literal"));
}
-
- throw new ParseError.SYNTAX (get_error ("expected literal"));
}
public void parse_file (SourceFile source_file) {
@@ -821,9 +821,13 @@
}
var inner = parse_unary_expression ();
return new CastExpression (inner, type, get_src (begin), false);
+ default:
+ break;
}
}
break;
+ default:
+ break;
}
// no cast expression
rollback (begin);
@@ -836,6 +840,8 @@
next ();
var op = parse_unary_expression ();
return new AddressofExpression (op, get_src (begin));
+ default:
+ break;
}
var expr = parse_primary_expression ();
@@ -1293,10 +1299,10 @@
case TokenType.OP_PTR:
rollback (begin);
return true;
+ default:
+ rollback (begin);
+ return false;
}
-
- rollback (begin);
- return false;
}
Block parse_embedded_statement () throws ParseError {
@@ -1737,6 +1743,7 @@
case TokenType.INTERFACE: return parse_interface_declaration (attrs);
case TokenType.NAMESPACE: return parse_namespace_declaration (attrs);
case TokenType.STRUCT: return parse_struct_declaration (attrs);
+ default: break;
}
break;
case TokenType.OPEN_PARENS:
@@ -1762,6 +1769,8 @@
case TokenType.OPEN_BRACE:
rollback (begin);
return parse_property_declaration (attrs);
+ default:
+ break;
}
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]