[Mesa-dev] [PATCH] util/rb_tree: Fix a compiler warning

Jason Ekstrand jason at jlekstrand.net
Thu Jul 12 05:49:49 UTC 2018


Gcc 8 warns "cast to pointer from integer of different size" in 32-bit
builds.
---
 src/util/rb_tree.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/rb_tree.h b/src/util/rb_tree.h
index e8750b32d0e..c77e9255ea2 100644
--- a/src/util/rb_tree.h
+++ b/src/util/rb_tree.h
@@ -55,7 +55,7 @@ struct rb_node {
 static inline struct rb_node *
 rb_node_parent(struct rb_node *n)
 {
-    return (struct rb_node *)(n->parent & ~1ull);
+    return (struct rb_node *)(n->parent & ~(uintptr_t)1);
 }
 
 /** A red-black tree
-- 
2.17.1



More information about the mesa-dev mailing list