summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Smith2009-11-18 18:26:22 +0000
committerBradley Smith2009-11-18 18:26:22 +0000
commit87db946618bbf20efac2ecf5ba6f223e0cee8d8d (patch)
treec2ee4e3562305c790fba0c9ec2937d8646c9fe56
parentChange email address for Jim Hall, upon request. (diff)
downloadgnurobots-87db946618bbf20efac2ecf5ba6f223e0cee8d8d.tar.gz
Fix issues when compiling with optimisations.
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
-rw-r--r--src/grobot.c10
-rw-r--r--src/main.c3
2 files changed, 7 insertions, 6 deletions
diff --git a/src/grobot.c b/src/grobot.c
index 6971bb8..e9dadc2 100644
--- a/src/grobot.c
+++ b/src/grobot.c
@@ -365,7 +365,7 @@ void g_robot_turn(GRobot *robot, gint num_turns)
gboolean g_robot_move(GRobot *robot, gint steps)
{
gint x_to, y_to;
- gint dx, dy;
+ gint dx = 0, dy = 0;
gint i;
g_return_val_if_fail(robot->ui != NULL && robot->map != NULL, FALSE);
@@ -509,7 +509,7 @@ gboolean g_robot_feel(GRobot *robot, gchar *str)
{
gint th;
gint x_to, y_to;
- gint dx, dy;
+ gint dx = 0, dy = 0;
g_return_val_if_fail(robot->ui != NULL && robot->map != NULL, FALSE);
@@ -573,7 +573,7 @@ gboolean g_robot_look(GRobot *robot, gchar *str)
{
gint th;
gint x_to, y_to;
- gint dx, dy;
+ gint dx = 0, dy = 0;
g_return_val_if_fail(robot->ui != NULL && robot->map != NULL, FALSE);
@@ -635,7 +635,7 @@ gboolean g_robot_look(GRobot *robot, gchar *str)
gboolean g_robot_grab(GRobot *robot)
{
gint x_to, y_to;
- gint dx, dy;
+ gint dx = 0, dy = 0;
g_return_val_if_fail(robot->ui != NULL && robot->map != NULL, FALSE);
@@ -717,7 +717,7 @@ gboolean g_robot_grab(GRobot *robot)
gboolean g_robot_zap(GRobot *robot)
{
gint x_to, y_to;
- gint dx, dy;
+ gint dx = 0, dy = 0;
g_return_val_if_fail(robot->ui != NULL && robot->map != NULL, FALSE);
diff --git a/src/main.c b/src/main.c
index 71a0fe6..ece7cbc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -282,6 +282,7 @@ void main_prog(void *closure, gint argc, gchar *argv[])
gchar *map_file = argv[1];
gchar *robot_program = argv[2];
gboolean loading = TRUE;
+ volatile gboolean *ploading = &loading;
api_init();
@@ -304,7 +305,7 @@ void main_prog(void *closure, gint argc, gchar *argv[])
G_ROBOT_POSITION_X(robot), ROBOT);
g_printf("Loading GTK Interface ... Please wait\n\n");
- while(loading);
+ while(*ploading);
/* Now initialize the rest of the Robot properties */
g_object_set(G_OBJECT(robot),