mdbx: more explicit casting to size_t (paranoia).

Change-Id: I1c65943cdcdd77cc12bc27d9ced19765ea7911bb
This commit is contained in:
Leonid Yuriev 2020-04-07 03:22:09 +03:00
parent bf0cff9a8a
commit 94e58d7acc

View File

@ -328,7 +328,7 @@ node_largedata_pgno(const MDBX_node *const __restrict node) {
*/
#define PAGEROOM(pagesize) ((pagesize)-PAGEHDRSZ)
#define EVEN_FLOOR(n) ((n) & ~1ul)
#define EVEN_FLOOR(n) ((n) & ~(size_t)1)
#define BRANCH_NODEMAX(pagesize) \
(EVEN_FLOOR(PAGEROOM(pagesize) / (MDBX_MINKEYS * 2 - 1)) - sizeof(indx_t))
#define LEAF_NODEMAX(pagesize) (PAGEROOM(pagesize) - sizeof(indx_t))
@ -12749,7 +12749,7 @@ static void mdbx_node_shrink(MDBX_page *mp, unsigned indx) {
/* Prepare to shift upward, set len = length(subpage part to shift) */
if (IS_LEAF2(sp)) {
delta &= /* do not make the node uneven-sized */ ~1u;
delta &= /* do not make the node uneven-sized */ ~(size_t)1;
if (unlikely(delta) == 0)
return;
nsize = node_ds(node) - delta;