X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Fprivate.h;h=8778dbc382c4c52ed40303883c9b57c5fec59674;hb=3a34aa1a0c71b0be86511a8aa83af9935351dad1;hp=75e44ad8cb736f5505943eb898c671fafc9cfb2c;hpb=6d3832ee613adeb9ae7ed6454996ffa39c32650f;p=ccan diff --git a/ccan/tdb2/private.h b/ccan/tdb2/private.h index 75e44ad8..8778dbc3 100644 --- a/ccan/tdb2/private.h +++ b/ccan/tdb2/private.h @@ -65,7 +65,9 @@ typedef uint64_t tdb_off_t; #define TDB_RECOVERY_MAGIC (0xf53bc0e7ad124589ULL) #define TDB_RECOVERY_INVALID_MAGIC (0x0ULL) -#define TDB_OFF_IS_ERR(off) unlikely(off >= (tdb_off_t)TDB_ERR_LAST) +#define TDB_OFF_IS_ERR(off) unlikely(off >= (tdb_off_t)(long)TDB_ERR_LAST) +#define TDB_OFF_TO_ERR(off) ((enum TDB_ERROR)(long)(off)) +#define TDB_ERR_TO_OFF(ecode) ((tdb_off_t)(long)(ecode)) /* Packing errors into pointers and v.v. */ #define TDB_PTR_IS_ERR(ptr) \