X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fredblack.h;h=a89149b20afedaea67ff28ae7550fb634afa5c73;hb=08ec58075cd87236ea502c2c3b89e38126478167;hp=1776bedbcc20600138dee3decf4c3c3c2e443e6b;hpb=cd2c314243b39109aaa5974a80592fa4b0568feb;p=libucw.git diff --git a/lib/redblack.h b/lib/redblack.h index 1776bedb..a89149b2 100644 --- a/lib/redblack.h +++ b/lib/redblack.h @@ -136,6 +136,7 @@ * undef'd. */ +#include #include #if !defined(TREE_NODE) || !defined(TREE_PREFIX) @@ -263,13 +264,13 @@ typedef struct P(stack_entry) { #else /* Pointers are aligned, hence we can use lower bits. */ static inline uns P(red_flag) (P(bucket) *node) - { return ((addr_int_t) node->son[0]) & 1L; } + { return ((uintptr_t) node->son[0]) & 1L; } static inline void P(set_red_flag) (P(bucket) *node, uns flag) - { node->son[0] = (void*) ( (((addr_int_t) node->son[0]) & ~1L) | (flag & 1L) ); } + { node->son[0] = (void*) ( (((uintptr_t) node->son[0]) & ~1L) | (flag & 1L) ); } static inline P(bucket) * P(tree_son) (P(bucket) *node, uns id) - { return (void *) (((addr_int_t) node->son[id]) & ~1L); } + { return (void *) (((uintptr_t) node->son[id]) & ~1L); } static inline void P(set_tree_son) (P(bucket) *node, uns id, P(bucket) *son) - { node->son[id] = (void *) ((addr_int_t) son | (((addr_int_t) node->son[id]) & 1L) ); } + { node->son[id] = (void *) ((uintptr_t) son | (((uintptr_t) node->son[id]) & 1L) ); } #endif /* Defaults for missing parameters. */