From b5346ee7658511bb4c8e03b181fd7910a22c3cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Fri, 8 Jul 2022 21:48:08 +0300 Subject: [PATCH] mdbx: use unsigned constants for page flags (to avoid MSVC warnings). --- src/internals.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/internals.h b/src/internals.h index da54282d..8cd0f329 100644 --- a/src/internals.h +++ b/src/internals.h @@ -516,17 +516,17 @@ typedef struct MDBX_page { struct MDBX_page *mp_next; /* for in-memory list of freed pages */ }; uint16_t mp_leaf2_ksize; /* key size if this is a LEAF2 page */ -#define P_BRANCH 0x01 /* branch page */ -#define P_LEAF 0x02 /* leaf page */ -#define P_OVERFLOW 0x04 /* overflow page */ -#define P_META 0x08 /* meta page */ -#define P_LEGACY_DIRTY 0x10 /* legacy P_DIRTY flag prior to v0.10 958fd5b9 */ +#define P_BRANCH 0x01u /* branch page */ +#define P_LEAF 0x02u /* leaf page */ +#define P_OVERFLOW 0x04u /* overflow page */ +#define P_META 0x08u /* meta page */ +#define P_LEGACY_DIRTY 0x10u /* legacy P_DIRTY flag prior to v0.10 958fd5b9 */ #define P_BAD P_LEGACY_DIRTY /* explicit flag for invalid/bad page */ -#define P_LEAF2 0x20 /* for MDBX_DUPFIXED records */ -#define P_SUBP 0x40 /* for MDBX_DUPSORT sub-pages */ -#define P_SPILLED 0x2000 /* spilled in parent txn */ -#define P_LOOSE 0x4000 /* page was dirtied then freed, can be reused */ -#define P_FROZEN 0x8000 /* used for retire page with known status */ +#define P_LEAF2 0x20u /* for MDBX_DUPFIXED records */ +#define P_SUBP 0x40u /* for MDBX_DUPSORT sub-pages */ +#define P_SPILLED 0x2000u /* spilled in parent txn */ +#define P_LOOSE 0x4000u /* page was dirtied then freed, can be reused */ +#define P_FROZEN 0x8000u /* used for retire page with known status */ #define P_ILL_BITS \ ((uint16_t) ~(P_BRANCH | P_LEAF | P_LEAF2 | P_OVERFLOW | P_SPILLED)) uint16_t mp_flags; @@ -545,7 +545,7 @@ typedef struct MDBX_page { #endif /* C99 */ } MDBX_page; -#define PAGETYPE_WHOLE(p) ((char)(p)->mp_flags) +#define PAGETYPE_WHOLE(p) ((uint8_t)(p)->mp_flags) /* Drop legacy P_DIRTY flag for sub-pages for compatilibity */ #define PAGETYPE_COMPAT(p) \