diff options
author | Bradley Smith | 2008-03-10 00:55:01 +0000 |
---|---|---|
committer | Bradley Smith | 2008-03-10 00:55:01 +0000 |
commit | 6a52075c557c3d64dfa9e6c05ab2b67e30b900f2 (patch) | |
tree | 1687403a7fd0529eb93b328203be10865b95d0a6 /src | |
parent | Change x11plugin GType style. (diff) | |
download | gnurobots-6a52075c557c3d64dfa9e6c05ab2b67e30b900f2.tar.gz |
Remove sign hack.
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/api.c | 1 | ||||
-rw-r--r-- | src/grobot.c | 3 | ||||
-rw-r--r-- | src/sign.c | 18 |
4 files changed, 2 insertions, 22 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index eb3496b..865a5de 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,5 +25,5 @@ INCLUDES = $(GLIB2_CFLAGS) $(GUILE_CFLAGS) -I$(top_builddir)/include \ -DMAPS_PATH=\"$(mapsdir)\" \ -DSCRIPTS_PATH=\"$(schemedir)\" -gnurobots_SOURCES = main.c api.c sign.c map.c grobot.c userinterface.c +gnurobots_SOURCES = main.c api.c map.c grobot.c userinterface.c gnurobots_LDFLAGS = $(GLIB2_LIBS) $(GUILE_LDFLAGS) -lltdl @@ -26,7 +26,6 @@ #include "api.h" /* GNU Robots API */ #include "main.h" /* for exit_nicely */ -#include "sign.h" /* a hack for +/- sign */ #include "grobot.h" extern GRobot *robot; diff --git a/src/grobot.c b/src/grobot.c index 91c8b32..d39ea91 100644 --- a/src/grobot.c +++ b/src/grobot.c @@ -25,7 +25,6 @@ #include <glib.h> #include <string.h> #include <stdlib.h> -#include "sign.h" G_DEFINE_TYPE(GRobot, g_robot, G_TYPE_OBJECT) @@ -374,7 +373,7 @@ g_robot_turn (GRobot *robot, gint num_turns) /* turn left or right? */ - incr = sign (num_turns); + incr = sign(num_turns); for (i = 0; i < abs (num_turns); i++) { diff --git a/src/sign.c b/src/sign.c deleted file mode 100644 index 9b1743e..0000000 --- a/src/sign.c +++ /dev/null @@ -1,18 +0,0 @@ -/* TODO: Either this needs to go, or it needs a copyright header */ - -#include <stdio.h> -#include <glib.h> - -/* is there a standard C function to do this? */ - -gint -sign (gint n) -{ - if (n < 0) { - return (-1); - } else if (n > 0) { - return (+1); - } - - return (0); -} |