]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Fix compilation errors on recent Linux distributions
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 19 Sep 2012 15:11:17 +0000 (17:11 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 19 Sep 2012 15:15:29 +0000 (17:15 +0200)
Note: This fix is not needed for master branch because it includes
stdio.h which provides NULL. However, to keep the differences between
master and demo branches minimal, I apply this change also to master.

src/motion/arc.cc
src/motion/turn.cc

index f3b67e6e92bf87241b0683dc9be1f6a9bc2c5de8..fa34acaf6ce04c6b52473a848f1575cd7e91b2aa 100644 (file)
@@ -1,4 +1,4 @@
-//     Copyright 2009 Michal Sojka <sojkam1@fel.cvut.cz>
+//     Copyright 2009, 2012 Michal Sojka <sojkam1@fel.cvut.cz>
 //     Copyright 2009 Petr Beneš
 //
 //     This file is part of Trgen library.
@@ -87,7 +87,7 @@ namespace Segment {
 
     TrajectorySegment* Arc::splitAt(double distance, Point *newEnd) {
         if (distance <= 0 || distance >= length)
-            return NULL;
+            return 0;
 
         getPointAt(distance, newEnd);
         Arc *ns = new Arc(*this);
index 49bc1fe9e95285b2f3bb0196e37b80ab5b844d2a..76a4b271f4747fe06194b635ed4ea815d11980d3 100644 (file)
@@ -1,4 +1,4 @@
-//     Copyright 2009 Michal Sojka <sojkam1@fel.cvut.cz>
+//     Copyright 2009, 2012 Michal Sojka <sojkam1@fel.cvut.cz>
 //     Copyright 2009 Petr Beneš
 //
 //     This file is part of Trgen library.
@@ -54,7 +54,7 @@ namespace Segment {
     TrajectorySegment* Turn::splitAt(double distance, Point *newEnd) {
        if (distance <= 0 || distance >= fabs(turnBy)) {
             dbgPrintf("splitAt: distance=%g turnBy=%g\n", distance, turnBy);
-            return NULL;
+            return 0;
         }
 
         Turn *ns = new Turn(*this);
@@ -69,7 +69,7 @@ namespace Segment {
     TrajectorySegment* Turn::splitAtByTime(double time, Point *newEnd) {
        if (time <= t1 || time >= t2) {
             dbgPrintf("splitAt: distance=%g turnBy=%g\n", time, turnBy);
-            return NULL;
+            return 0;
         }
 
         Turn *ns = new Turn(*this);