From ae774ed0ecbae5ef47604bd89e739cc96ad22671 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Tue, 14 Sep 2010 19:43:28 +0200 Subject: [PATCH 1/2] mendel.c: remove unused references to standard C lib. --- mendel.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mendel.c b/mendel.c index fe45239..25ceabf 100644 --- a/mendel.c +++ b/mendel.c @@ -1,6 +1,3 @@ -#include -#include -#include #include #include From bd1e357c35fe8f8e75f17b451173fdb8007baa07 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 12 Sep 2010 12:21:11 +0200 Subject: [PATCH 2/2] dda.c: remove ABSDELTA() and delta32() implementations as they're unused. --- dda.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/dda.c b/dda.c index 6d409f5..cda4f72 100644 --- a/dda.c +++ b/dda.c @@ -14,10 +14,6 @@ #define ABS(v) (((v) >= 0)?(v):(-(v))) #endif -#ifndef ABSDELTA -#define ABSDELTA(a, b) (((a) >= (b))?((a) - (b)):((b) - (a))) -#endif - /* step timeout */ @@ -35,7 +31,7 @@ TARGET current_position __attribute__ ((__section__ (".bss"))); utility functions */ -// courtesy of http://www.oroboro.com/rafael/docserv.php/index/programming/article/distance +// courtesy of http://www.flipcode.com/archives/Fast_Approximate_Distance_Functions.shtml uint32_t approx_distance( uint32_t dx, uint32_t dy ) { uint32_t min, max, approx; @@ -92,12 +88,6 @@ uint32_t approx_distance_3( uint32_t dx, uint32_t dy, uint32_t dz ) return (( approx + 512 ) >> 10 ); } -uint32_t delta32(uint32_t v1, uint32_t v2) { - if (v1 >= v2) - return v1 - v2; - return v2 - v1; -} - // this is an ultra-crude pseudo-logarithm routine, such that: // 2 ^ msbloc(v) >= v const uint8_t msbloc (uint32_t v) {