From: Michal Sojka Date: Wed, 19 Sep 2012 15:11:17 +0000 (+0200) Subject: Fix compilation errors on recent Linux distributions X-Git-Url: http://rtime.felk.cvut.cz/gitweb/eurobot/public.git/commitdiff_plain/5677e0559ec90f6114b6a9eeb377c256570d05b8 Fix compilation errors on recent Linux distributions 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. --- diff --git a/src/motion/arc.cc b/src/motion/arc.cc index f3b67e6e..fa34acaf 100644 --- a/src/motion/arc.cc +++ b/src/motion/arc.cc @@ -1,4 +1,4 @@ -// Copyright 2009 Michal Sojka +// Copyright 2009, 2012 Michal Sojka // 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); diff --git a/src/motion/turn.cc b/src/motion/turn.cc index 49bc1fe9..76a4b271 100644 --- a/src/motion/turn.cc +++ b/src/motion/turn.cc @@ -1,4 +1,4 @@ -// Copyright 2009 Michal Sojka +// Copyright 2009, 2012 Michal Sojka // 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);