Skip to content

Commit

Permalink
imap.h: imap__xpfx__: fix return type to be 64-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
billziss-gh committed Jun 21, 2023
1 parent 831fe0e commit d56bf19
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ extern "C" {
}

static inline
imap_u32_t imap__xpfx__(imap_u64_t x, imap_u32_t pos)
imap_u64_t imap__xpfx__(imap_u64_t x, imap_u32_t pos)
{
return x & (~0xfull << (pos << 2));
}
Expand Down
10 changes: 10 additions & 0 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,16 @@ static void imap_locate_test(void)
ASSERT(0 == pair.x && 0 == pair.slot);
imap_free(tree);

tree = 0;
tree = imap_ensure(tree, +5);
ASSERT(0 != tree);
slot = imap_assign(tree, 0xA0000056);
ASSERT(0 != slot);
imap_setval(tree, slot, 0x56);
pair = imap_locate(tree, &iter, 0xA00000560);
ASSERT(0 == pair.x && 0 == pair.slot);
imap_free(tree);

tree = 0;
tree = imap_ensure(tree, +5);
ASSERT(0 != tree);
Expand Down

0 comments on commit d56bf19

Please sign in to comment.