Mesa (master): util/rb_tree: Fix a compiler warning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 12 17:26:05 UTC 2018


Module: Mesa
Branch: master
Commit: ccb8309516792fedd4ed50f8db81d84682b967c3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ccb8309516792fedd4ed50f8db81d84682b967c3

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Jul 11 17:06:26 2018 -0700

util/rb_tree: Fix a compiler warning

Gcc 8 warns "cast to pointer from integer of different size" in 32-bit
builds.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>

---

 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 e8750b32d0..c77e9255ea 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




More information about the mesa-commit mailing list