From e269ea78a9b6ecae6e4948f7b1a3ad6938a5adfd Mon Sep 17 00:00:00 2001 From: svnhieber Date: Tue, 11 Jan 2011 17:04:23 +0000 Subject: [PATCH] fix compile error git-svn-id: https://svn.itm.uni-luebeck.de/wisebed/wiselib/trunk/pc_apps/roomba_tests@4002 f8795833-4959-0410-8ae9-8bcb0cfab428 --- main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cc b/main.cc index 3eb6874..09bf40b 100644 --- a/main.cc +++ b/main.cc @@ -88,10 +88,10 @@ struct SensorData { int nearest_diff(unsigned short last, unsigned short current) { int d = current - last; if(d < -0x8000) { // overflow in positive direction - d = (0x10000 - last_i + this_i); + d = (0x10000 - last + current); } if(d >= 0x8000) { // overflow in negative direction - d = -(0x10000 - this_i + last_i); + d = -(0x10000 - current + last); } } -- 2.20.1