diff options
Diffstat (limited to 'db/dbinc')
-rw-r--r-- | db/dbinc/db_int.in | 8 | ||||
-rw-r--r-- | db/dbinc/log.h | 8 | ||||
-rw-r--r-- | db/dbinc/region.h | 14 |
3 files changed, 16 insertions, 14 deletions
diff --git a/db/dbinc/db_int.in b/db/dbinc/db_int.in index 351c4f044..522f2f728 100644 --- a/db/dbinc/db_int.in +++ b/db/dbinc/db_int.in @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: db_int.in,v 11.153 2004/10/05 14:43:53 mjc Exp $ + * $Id: db_int.in,v 11.155 2004/10/28 16:07:38 ubell Exp $ */ #ifndef _DB_INTERNAL_H_ @@ -39,7 +39,11 @@ extern "C" { #define UINT16_MAX 65535 /* Maximum 16-bit unsigned. */ #endif #ifndef UINT32_MAX +#ifdef __STDC__ #define UINT32_MAX 4294967295U /* Maximum 32-bit unsigned. */ +#else +#define UINT32_MAX 0xffffffff /* Maximum 32-bit unsigned. */ +#endif #endif #if defined(HAVE_LONG_LONG) && defined(HAVE_UNSIGNED_LONG_LONG) @@ -451,7 +455,7 @@ typedef struct __dbpginfo { (LSN).file = 0; \ (LSN).offset = 0; \ } while (0) -#define IS_ZERO_LSN(LSN) ((LSN).file == 0) +#define IS_ZERO_LSN(LSN) ((LSN).file == 0 && (LSN).offset == 0) #define IS_INIT_LSN(LSN) ((LSN).file == 1 && (LSN).offset == 0) #define INIT_LSN(LSN) do { \ diff --git a/db/dbinc/log.h b/db/dbinc/log.h index 01d3d0259..9a8690138 100644 --- a/db/dbinc/log.h +++ b/db/dbinc/log.h @@ -4,7 +4,7 @@ * Copyright (c) 1996-2004 * Sleepycat Software. All rights reserved. * - * $Id: log.h,v 11.89 2004/09/24 00:43:18 bostic Exp $ + * $Id: log.h,v 11.90 2004/10/15 16:59:39 bostic Exp $ */ #ifndef _LOG_H_ @@ -346,11 +346,9 @@ struct __db_filestart { #define DB_SET_BEGIN_LSNP(txn, rlsnp) do { \ DB_LSN *__lsnp; \ TXN_DETAIL *__td; \ - __td = (TXN_DETAIL *)R_ADDR((txn)->mgrp->dbenv, \ - &(txn)->mgrp->reginfo, (txn)->off); \ + __td = R_ADDR(&(txn)->mgrp->reginfo, (txn)->off); \ while (__td->parent != INVALID_ROFF) \ - __td = (TXN_DETAIL *)R_ADDR((txn)->mgrp->dbenv, \ - &(txn)->mgrp->reginfo, __td->parent); \ + __td = R_ADDR(&(txn)->mgrp->reginfo, __td->parent); \ __lsnp = &__td->begin_lsn; \ if (IS_ZERO_LSN(*__lsnp)) \ *(rlsnp) = __lsnp; \ diff --git a/db/dbinc/region.h b/db/dbinc/region.h index 805acb1ea..98f6ea07b 100644 --- a/db/dbinc/region.h +++ b/db/dbinc/region.h @@ -4,7 +4,7 @@ * Copyright (c) 1998-2004 * Sleepycat Software. All rights reserved. * - * $Id: region.h,v 11.50 2004/09/15 21:49:12 mjc Exp $ + * $Id: region.h,v 11.51 2004/10/15 16:59:39 bostic Exp $ */ #ifndef _DB_REGION_H_ @@ -256,12 +256,12 @@ typedef struct __db_regmaint_t { * R_ADDR Return a per-process address for a shared region offset. * R_OFFSET Return a shared region offset for a per-process address. */ -#define R_ADDR(dbenv, base, offset) \ - (F_ISSET((dbenv), DB_ENV_PRIVATE) ? (void *)(offset) : \ - (void *)((u_int8_t *)((base)->addr) + (offset))) -#define R_OFFSET(dbenv, base, p) \ - (F_ISSET((dbenv), DB_ENV_PRIVATE) ? (roff_t)(p) : \ - (roff_t)((u_int8_t *)(p) - (u_int8_t *)(base)->addr)) +#define R_ADDR(reginfop, offset) \ + (F_ISSET((reginfop)->dbenv, DB_ENV_PRIVATE) ? (void *)(offset) :\ + (void *)((u_int8_t *)((reginfop)->addr) + (offset))) +#define R_OFFSET(reginfop, p) \ + (F_ISSET((reginfop)->dbenv, DB_ENV_PRIVATE) ? (roff_t)(p) : \ + (roff_t)((u_int8_t *)(p) - (u_int8_t *)(reginfop)->addr)) /* * R_LOCK Lock/unlock a region. |