summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2018-11-15 13:59:52 +0100
committerGitHub <noreply@github.com>2018-11-15 13:59:52 +0100
commitf335a0a602d402ffcea46a161d7638076dda446b (patch)
treef776d560006c6e0655ab73618c73594747f30687
parentMerge pull request #3332 from qlyoung/fix-code-block-err (diff)
parentlibs: rename two id_alloc macros to resolve bsd conflict (diff)
downloadfrr-f335a0a602d402ffcea46a161d7638076dda446b.tar.xz
frr-f335a0a602d402ffcea46a161d7638076dda446b.zip
Merge pull request #3331 from mjstapp/fix_lib_id_warning
libs: rename two id_alloc macros to resolve bsd conflict
-rw-r--r--lib/id_alloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/id_alloc.c b/lib/id_alloc.c
index b4d37dbdc..222ba651b 100644
--- a/lib/id_alloc.c
+++ b/lib/id_alloc.c
@@ -42,7 +42,7 @@ DEFINE_MTYPE_STATIC(LIB, IDALLOC_POOL, "ID Number temporary holding pool entry")
#define DIR_MASK ((1<<IDALLOC_DIR_BITS)-1)
#define SUBDIR_MASK ((1<<IDALLOC_SUBDIR_BITS)-1)
-#define PAGE_MASK ((1<<IDALLOC_PAGE_BITS)-1)
+#define FRR_ID_PAGE_MASK ((1<<IDALLOC_PAGE_BITS)-1)
#define WORD_MASK ((1<<IDALLOC_WORD_BITS)-1)
#define OFFSET_MASK ((1<<IDALLOC_OFFSET_BITS)-1)
@@ -50,13 +50,13 @@ DEFINE_MTYPE_STATIC(LIB, IDALLOC_POOL, "ID Number temporary holding pool entry")
IDALLOC_PAGE_BITS + IDALLOC_SUBDIR_BITS)
#define SUBDIR_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS + \
IDALLOC_PAGE_BITS)
-#define PAGE_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS)
+#define FRR_ID_PAGE_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS)
#define WORD_SHIFT (IDALLOC_OFFSET_BITS)
#define OFFSET_SHIFT (0)
#define ID_DIR(id) ((id >> DIR_SHIFT) & DIR_MASK)
#define ID_SUBDIR(id) ((id >> SUBDIR_SHIFT) & SUBDIR_MASK)
-#define ID_PAGE(id) ((id >> PAGE_SHIFT) & PAGE_MASK)
+#define ID_PAGE(id) ((id >> FRR_ID_PAGE_SHIFT) & FRR_ID_PAGE_MASK)
#define ID_WORD(id) ((id >> WORD_SHIFT) & WORD_MASK)
#define ID_OFFSET(id) ((id >> OFFSET_SHIFT) & OFFSET_MASK)
@@ -98,7 +98,7 @@ static struct id_alloc_page *find_or_create_page(struct id_alloc *alloc,
page->base_value = id;
subdir->sublevels[ID_PAGE(id)] = page;
- alloc->capacity += 1 << PAGE_SHIFT;
+ alloc->capacity += 1 << FRR_ID_PAGE_SHIFT;
page->next_has_free = alloc->has_free;
alloc->has_free = page;
} else if (page != NULL && create) {