#include <errno.h>
#include <string.h>
+#include <stdint.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/uio.h>
#define SFSTREE_VERSION 0x0100
-typedef unsigned long Opaque; /* XXX sizeof(Opaque) == sizeof(void *) */
+typedef uintptr_t Opaque; /* XXX sizeof(Opaque) == sizeof(void *) */
#define CHECK_MEMORY(tree) ( ( (tree)->plainmemory ) ? \
tlog(TL_CRIT|TL_EXIT, "Tree in plain memory - read only access") : (void)0 )
tlog(TL_CRIT|TL_EXIT, "sizeof(Opaque) mismatch");
if ( dh->headersize != SFSTDHSZ )
tlog(TL_CRIT|TL_EXIT, "Tree's header size mismatch (should be %d but %d bytes)", SFSTDHSZ, dh->headersize);
- if ( size && size != dh->totalen + SFSTDHSZ + dh->extrasize )
+ if ( size && size != dh->totalen + SFSTDHSZ + MAXALIGN(dh->extrasize) )
tlog(TL_CRIT|TL_EXIT, "Memory size mismatch (should be %d but %d bytes)", dh->totalen + SFSTDHSZ + dh->extrasize , size);
info->totalen = dh->totalen;