Fix some warnings
* Fix unused functions when no `mmap`. ``` shape.c:285:1: warning: unused function 'redblack_insert' [-Wunused-function] 285 | redblack_insert(redblack_node_t * tree, ID key, rb_shape_t * value) | ^~~~~~~~~~~~~~~ ``` * Fix unknown warning group '-Wmaybe-uninitialized' with clang. ``` thread_win32.c:596:1: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option] 596 | COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized) | ^ ``` Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
This commit is contained in:
parent
c06fbb192f
commit
018bd07f07
Notes:
git
2024-08-16 05:51:43 +00:00
Merged: https://github.com/ruby/ruby/pull/11376 Merged-By: nobu <nobu@ruby-lang.org>
18
shape.c
18
shape.c
@ -98,6 +98,15 @@ redblack_find(redblack_node_t * tree, ID key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline rb_shape_t *
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
static inline char
|
static inline char
|
||||||
redblack_color(redblack_node_t * node)
|
redblack_color(redblack_node_t * node)
|
||||||
{
|
{
|
||||||
@ -110,15 +119,6 @@ redblack_red_p(redblack_node_t * node)
|
|||||||
return redblack_color(node) == RED;
|
return redblack_color(node) == RED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline rb_shape_t *
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
|
||||||
static redblack_id_t
|
static redblack_id_t
|
||||||
redblack_id_for(redblack_node_t * node)
|
redblack_id_for(redblack_node_t * node)
|
||||||
{
|
{
|
||||||
|
@ -589,7 +589,7 @@ rb_native_cond_destroy(rb_nativethread_cond_t *cond)
|
|||||||
{if (!(expr)) {rb_bug("err: %lu - %s", GetLastError(), #expr);}}
|
{if (!(expr)) {rb_bug("err: %lu - %s", GetLastError(), #expr);}}
|
||||||
|
|
||||||
COMPILER_WARNING_PUSH
|
COMPILER_WARNING_PUSH
|
||||||
#if defined(__GNUC__)
|
#if __has_warning("-Wmaybe-uninitialized")
|
||||||
COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized)
|
COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized)
|
||||||
#endif
|
#endif
|
||||||
static inline SIZE_T
|
static inline SIZE_T
|
||||||
|
Loading…
x
Reference in New Issue
Block a user