]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
ALIGN -> BIRD_ALIGN
authorOndrej Filip <feela@network.cz>
Tue, 1 Jun 2004 10:28:25 +0000 (10:28 +0000)
committerOndrej Filip <feela@network.cz>
Tue, 1 Jun 2004 10:28:25 +0000 (10:28 +0000)
lib/birdlib.h
lib/mempool.c
proto/bgp/attrs.c

index 1a575bf8efb7a5e51005313535d201e7256afc58..1a27e969b3e65d573016283e793fa279741275e6 100644 (file)
@@ -13,9 +13,7 @@
 
 #define OFFSETOF(s, i) ((unsigned int)&((s *)0)->i)
 #define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i)))
-#ifndef ALIGN
-#define ALIGN(s, a) (((s)+a-1)&~(a-1))
-#endif
+#define BIRD_ALIGN(s, a) (((s)+a-1)&~(a-1))
 
 /* Utility macros */
 
index ba95323cc0903170e4b0bf331e7b1f13bb0efde2..bb6dcff33ce2dba792c75f0a8bbc88c3a5fc2d8a 100644 (file)
@@ -90,7 +90,7 @@ linpool
 void *
 lp_alloc(linpool *m, unsigned size)
 {
-  byte *a = (byte *) ALIGN((unsigned long) m->ptr, CPU_STRUCT_ALIGN);
+  byte *a = (byte *) BIRD_ALIGN((unsigned long) m->ptr, CPU_STRUCT_ALIGN);
   byte *e = a + size;
 
   if (e <= m->end)
index ba3efec4d2038746c78e44c7d9c45edd7ba7f919..7fb817a49c6431165dbe00911d091691b70e5b38 100644 (file)
@@ -327,7 +327,7 @@ bgp_new_bucket(struct bgp_proto *p, ea_list *new, unsigned hash)
 {
   struct bgp_bucket *b;
   unsigned ea_size = sizeof(ea_list) + new->count * sizeof(eattr);
-  unsigned ea_size_aligned = ALIGN(ea_size, CPU_STRUCT_ALIGN);
+  unsigned ea_size_aligned = BIRD_ALIGN(ea_size, CPU_STRUCT_ALIGN);
   unsigned size = sizeof(struct bgp_bucket) + ea_size;
   unsigned i;
   byte *dest;
@@ -338,7 +338,7 @@ bgp_new_bucket(struct bgp_proto *p, ea_list *new, unsigned hash)
     {
       eattr *a = &new->attrs[i];
       if (!(a->type & EAF_EMBEDDED))
-       size += ALIGN(sizeof(struct adata) + a->u.ptr->length, CPU_STRUCT_ALIGN);
+       size += BIRD_ALIGN(sizeof(struct adata) + a->u.ptr->length, CPU_STRUCT_ALIGN);
     }
 
   /* Create the bucket and hash it */
@@ -364,7 +364,7 @@ bgp_new_bucket(struct bgp_proto *p, ea_list *new, unsigned hash)
          struct adata *na = (struct adata *) dest;
          memcpy(na, oa, sizeof(struct adata) + oa->length);
          a->u.ptr = na;
-         dest += ALIGN(sizeof(struct adata) + na->length, CPU_STRUCT_ALIGN);
+         dest += BIRD_ALIGN(sizeof(struct adata) + na->length, CPU_STRUCT_ALIGN);
        }
     }