diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/grobot.c | 10 | ||||
-rw-r--r-- | src/main.c | 3 |
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); @@ -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), |