]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix arithmetic macro definition
authorGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Sat, 25 Sep 2010 11:47:41 +0000 (13:47 +0200)
committerGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Sat, 25 Sep 2010 11:47:41 +0000 (13:47 +0200)
cpp macro are only text substitutions.
We have to ensure VIK_METERS_TO_FEET(3+1) will do what coder expect.

src/globals.h

index 8d8258fa0446004a058518927d975e147202ca90..8e0aa0b1392827700b5989ae2f7f59588c7340ee 100644 (file)
@@ -33,7 +33,7 @@
 #define MPP_TO_ALTI 0.7134044
 
 #define VIK_FEET_IN_METER 3.2808399
-#define VIK_METERS_TO_FEET(X) (X*VIK_FEET_IN_METER)
+#define VIK_METERS_TO_FEET(X) ((X)*VIK_FEET_IN_METER)
 
 #define VIK_DEFAULT_ALTITUDE 0.0
 #define VIK_DEFAULT_DOP 0.0