[gnome-games] chess: Use int.parse() instead of string.to_int()
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] chess: Use int.parse() instead of string.to_int()
- Date: Sat, 19 Feb 2011 04:00:54 +0000 (UTC)
commit 95f26d937fd61de2fc69366633927acb3b2b927b
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Feb 19 15:00:46 2011 +1100
chess: Use int.parse() instead of string.to_int()
glchess/src/chess-game.vala | 4 ++--
glchess/src/glchess.vala | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glchess/src/chess-game.vala b/glchess/src/chess-game.vala
index 22777da..8d1bd3b 100644
--- a/glchess/src/chess-game.vala
+++ b/glchess/src/chess-game.vala
@@ -348,10 +348,10 @@ public class ChessState
}
/* Field 5: Halfmove clock */
- halfmove_clock = fields[4].to_int ();
+ halfmove_clock = int.parse (fields[4]);
/* Field 6: Fullmove number */
- number = (fields[5].to_int () - 1) * 2;
+ number = (int.parse (fields[5]) - 1) * 2;
if (current_player.color == Color.BLACK)
number++;
diff --git a/glchess/src/glchess.vala b/glchess/src/glchess.vala
index 9e916ff..10854b2 100644
--- a/glchess/src/glchess.vala
+++ b/glchess/src/glchess.vala
@@ -256,7 +256,7 @@ public class Application
foreach (var control in controls)
{
/* We only support simple timeouts */
- var duration = control.to_int ();
+ var duration = int.parse (control);
if (duration > 0)
game.clock = new ChessClock (duration, duration);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]