From 129b4936bf8c556e9d400852ccd5b165dbe91499 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 16 Aug 2024 11:43:35 +0900 Subject: [PATCH] Simplify and clarify bitmask calculation --- shape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shape.c b/shape.c index 0200a6e526..f9e8b31861 100644 --- a/shape.c +++ b/shape.c @@ -103,7 +103,7 @@ redblack_value(redblack_node_t * node) { // Color is stored in the bottom bit of the shape pointer // Mask away the bit so we get the actual pointer back - return (rb_shape_t *)((uintptr_t)node->value & (((uintptr_t)-1) - 1)); + return (rb_shape_t *)((uintptr_t)node->value & ~(uintptr_t)1); } #ifdef HAVE_MMAP