]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
ABS should be a macro.
authorMartin Mares <mj@ucw.cz>
Wed, 13 Nov 2002 08:47:19 +0000 (08:47 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 13 Nov 2002 08:47:19 +0000 (08:47 +0000)
lib/birdlib.h
proto/ospf/lsalib.c

index fc27db9b9070cacc6ada85228ec1eb4aa6f16142..1904d666ef4aa469e06f78a290d199882762599c 100644 (file)
@@ -19,6 +19,7 @@
 
 #define MIN(a,b) (((a)<(b))?(a):(b))
 #define MAX(a,b) (((a)>(b))?(a):(b))
+#define ABS(a)   ((a)>=0 ? (a) : -(a))
 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(*(a)))
 
 #ifndef NULL
index 46dc707a242578336a9c9386901457730b923d8e..cf45fd4e6666acf59485f1342ccb1a70e2d5a231 100644 (file)
@@ -399,7 +399,7 @@ lsa_comp(struct ospf_lsa_header *l1, struct ospf_lsa_header *l2)
   if((l1->age==LSA_MAXAGE)&&(l2->age!=LSA_MAXAGE)) return CMP_NEWER;
   if((l2->age==LSA_MAXAGE)&&(l1->age!=LSA_MAXAGE)) return CMP_OLDER;
 
-  if(abs(l1->age-l2->age)>LSA_MAXAGEDIFF)
+  if(ABS(l1->age-l2->age)>LSA_MAXAGEDIFF)
     return l1->age<l2->age ? CMP_NEWER : CMP_OLDER;
 
   return CMP_SAME;