[gnome-chess] Silence new empty if statement warning
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Silence new empty if statement warning
- Date: Sun, 15 Feb 2015 05:13:05 +0000 (UTC)
commit 0b8f5b81d80d094580f3bde36aad65be99cbfde6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Feb 14 21:36:44 2015 -0600
Silence new empty if statement warning
lib/chess-pgn.vala | 12 ++++--------
lib/chess-state.vala | 3 ++-
2 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/lib/chess-pgn.vala b/lib/chess-pgn.vala
index 2a3a829..86348e6 100644
--- a/lib/chess-pgn.vala
+++ b/lib/chess-pgn.vala
@@ -252,15 +252,13 @@ public class PGN : Object
{
case State.TAGS:
home_state = State.TAGS;
- if (c.isspace ())
- ; /* Ignore whitespace */
- else if (c == ';')
+ if (c == ';')
state = State.LINE_COMMENT;
else if (c == '{')
state = State.BRACE_COMMENT;
else if (c == '[')
state = State.TAG_START;
- else
+ else if (!c.isspace ())
{
offset--;
state = State.MOVE_TEXT;
@@ -270,9 +268,7 @@ public class PGN : Object
case State.MOVE_TEXT:
home_state = State.MOVE_TEXT;
- if (c.isspace ())
- ; /* Ignore whitespace */
- else if (c == ';')
+ if (c == ';')
state = State.LINE_COMMENT;
else if (c == '{')
state = State.BRACE_COMMENT;
@@ -313,7 +309,7 @@ public class PGN : Object
else
rav_level--;
}
- else
+ else if (!c.isspace())
state = State.ERROR;
break;
diff --git a/lib/chess-state.vala b/lib/chess-state.vala
index 4b16eb9..52b3b42 100644
--- a/lib/chess-state.vala
+++ b/lib/chess-state.vala
@@ -41,6 +41,7 @@ public class ChessState : Object
{
}
+ // FIXME Enable or remove these exceptions.
public ChessState (string fen)
{
players[Color.WHITE] = new ChessPlayer (Color.WHITE);
@@ -70,7 +71,7 @@ public class ChessState : Object
PieceType type;
var color = c.isupper () ? Color.WHITE : Color.BLACK;
- if (!decode_piece_type (c.toupper (), out type))
+ /*if (!*/ decode_piece_type (c.toupper (), out type) //)
;//throw new Error ("");
int index = get_index (rank, file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]