From 8bc0536a7ba614efb913a704c20d84067f6f5d7c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 7 Jan 2012 16:32:14 +0100 Subject: [PATCH] Avoid conflict with PAGE_SIZE define --- bacula/src/lib/bregex.c | 18 +++++++++--------- bacula/src/lib/htable.c | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bacula/src/lib/bregex.c b/bacula/src/lib/bregex.c index 6df0c74556..e07de3b48b 100644 --- a/bacula/src/lib/bregex.c +++ b/bacula/src/lib/bregex.c @@ -110,13 +110,13 @@ typedef union item_t { } cntr; } item_t; -#define STACK_PAGE_SIZE 256 +#define B_STACK_PAGE_SIZE 256 #define NUM_REGISTERS 256 /* A 'page' of stack items. */ typedef struct item_page_t { - item_t items[STACK_PAGE_SIZE]; + item_t items[B_STACK_PAGE_SIZE]; struct item_page_t *prev; struct item_page_t *next; } item_page_t; @@ -154,8 +154,8 @@ typedef struct match_state { struct { /* index into the current page. If index == 0 and you need * to pop an item, move to the previous page and set index - * = STACK_PAGE_SIZE - 1. Otherwise decrement index to - * push a page. If index == STACK_PAGE_SIZE and you need + * = B_STACK_PAGE_SIZE - 1. Otherwise decrement index to + * push a page. If index == B_STACK_PAGE_SIZE and you need * to push a page move to the next page and set index = * 0. If there is no new next page, allocate a new page * and link it in. Otherwise, increment index to push a @@ -215,7 +215,7 @@ while (stack.index < 0) \ if (stack.current->prev == NULL) \ on_error; \ stack.current = stack.current->prev; \ - stack.index += STACK_PAGE_SIZE; \ + stack.index += B_STACK_PAGE_SIZE; \ } /* Store a pointer to the previous item on the stack. Used to pop an @@ -227,7 +227,7 @@ if (stack.index == 0) \ if (stack.current->prev == NULL) \ on_error; \ stack.current = stack.current->prev; \ - stack.index = STACK_PAGE_SIZE - 1; \ + stack.index = B_STACK_PAGE_SIZE - 1; \ } \ else \ { \ @@ -239,7 +239,7 @@ top = &(stack.current->items[stack.index]) * on to the stack. */ #define STACK_NEXT(stack, top, on_error) \ -if (stack.index == STACK_PAGE_SIZE) \ +if (stack.index == B_STACK_PAGE_SIZE) \ { \ if (stack.current->next == NULL) \ { \ @@ -269,7 +269,7 @@ top = &(stack.current->items[stack.index++]) if (current->prev == NULL) \ on_error; \ current = current->prev; \ - index += STACK_PAGE_SIZE; \ + index += B_STACK_PAGE_SIZE; \ } \ top = &(current->items[index]); \ } @@ -282,7 +282,7 @@ if (stack.index == 0) \ { \ if (stack.current->prev == NULL) \ on_error; \ - top = &(stack.current->prev->items[STACK_PAGE_SIZE - 1]); \ + top = &(stack.current->prev->items[B_STACK_PAGE_SIZE - 1]); \ } \ else \ { \ diff --git a/bacula/src/lib/htable.c b/bacula/src/lib/htable.c index 66f5040cb7..af3896037c 100644 --- a/bacula/src/lib/htable.c +++ b/bacula/src/lib/htable.c @@ -50,11 +50,11 @@ #include "bacula.h" -#define PAGE_SIZE 4096 +#define B_PAGE_SIZE 4096 #define MIN_PAGES 32 #define MAX_PAGES 2400 -#define MIN_BUF_SIZE (MIN_PAGES * PAGE_SIZE) /* 128 Kb */ -#define MAX_BUF_SIZE (MAX_PAGES * PAGE_SIZE) /* approx 10MB */ +#define MIN_BUF_SIZE (MIN_PAGES * B_PAGE_SIZE) /* 128 Kb */ +#define MAX_BUF_SIZE (MAX_PAGES * B_PAGE_SIZE) /* approx 10MB */ static const int dbglvl = 500; @@ -181,7 +181,7 @@ void htable::init(void *item, void *link, int tsize, int nr_pages) #ifdef HAVE_GETPAGESIZE pagesize = getpagesize(); #else - pagesize = PAGE_SIZE; + pagesize = B_PAGE_SIZE; #endif if (nr_pages == 0) { buffer_size = MAX_BUF_SIZE; -- 2.39.5