#if (BYTE_ORDER == LITTLE_ENDIAN) == (BYTE_ORDER == BIG_ENDIAN)
# error "Unknown or unsupported endianness (BYTE_ORDER)"
-#elif (-6 & 5) || CHAR_BIT != 8 || UINT_MAX < 0xffffffff || ULONG_MAX % 0xFFFF
+#elif (-6 & 5) || CHAR_BIT!=8 || UINT_MAX!=0xffffffff || MDB_SIZE_MAX%UINT_MAX
# error "Two's complement, reasonably sized integer types, please"
#endif
#ifdef MISALIGNED_OK
#define COPY_PGNO(dst,src) dst = src
#else
-#if SIZE_MAX > 4294967295UL
+#if MDB_SIZE_MAX > 0xffffffffU
#define COPY_PGNO(dst,src) do { \
unsigned short *s, *d; \
s = (unsigned short *)&(src); \
* the write offset, to at least save the overhead of a Seek
* system call.
*/
- DPRINTF(("committing page %"Z"u", pgno));
+ DPRINTF(("committing page %"Y"u", pgno));
memset(&ov, 0, sizeof(ov));
ov.Offset = pos & 0xffffffff;
ov.OffsetHigh = pos >> 16 >> 16;
mx->mx_cursor.mc_flags |= C_INITIALIZED;
mx->mx_cursor.mc_ki[0] = 0;
mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */
-#if UINT_MAX < SIZE_MAX
+#if UINT_MAX < MDB_SIZE_MAX /* matches mdb_xcursor_init1:NEED_CMP_CLONG() */
mx->mx_dbx.md_cmp = src_mx->mx_dbx.md_cmp;
#endif
} else if (!(mx->mx_cursor.mc_flags & C_INITIALIZED)) {
if (freinfo) {
MDB_cursor *cursor;
MDB_val key, data;
- size_t pages = 0, *iptr;
+ mdb_size_t pages = 0, *iptr;
printf("Freelist Status\n");
dbi = 0;
pages += *iptr;
if (freinfo > 1) {
char *bad = "";
- size_t pg, prev;
+ mdb_size_t pg, prev;
ssize_t i, j, span = 0;
j = *iptr++;
for (i = j, prev = 1; --i >= 0; ) {
pg += span;
for (; i >= span && iptr[i-span] == pg; span++, pg++) ;
}
- printf(" Transaction %"Z"u, %"Z"d pages, maxspan %"Z"d%s\n",
- *(size_t *)key.mv_data, j, span, bad);
+ printf(" Transaction %"Y"u, %"Z"d pages, maxspan %"Z"d%s\n",
+ *(mdb_size_t *)key.mv_data, j, span, bad);
if (freinfo > 2) {
for (--j; j >= 0; ) {
pg = iptr[j];
for (span=1; --j >= 0 && iptr[j] == pg+span; span++) ;
- printf(span>1 ? " %9"Z"u[%"Z"d]\n" : " %9"Z"u\n",
+ printf(span>1 ? " %9"Y"u[%"Z"d]\n" : " %9"Y"u\n",
pg, span);
}
}
}
}
mdb_cursor_close(cursor);
- printf(" Free pages: %"Z"u\n", pages);
+ printf(" Free pages: %"Y"u\n", pages);
}
rc = mdb_open(txn, subname, 0, &dbi);