From: Martin Mares Date: Wed, 18 Jun 2003 10:19:46 +0000 (+0000) Subject: Casting addresses to longs is not portable, use addr_int_t instead. X-Git-Tag: holmes-import~1243 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=743a18ead30263da092f79b41af84aa4c3d0adcb;p=libucw.git Casting addresses to longs is not portable, use addr_int_t instead. --- diff --git a/lib/redblack.h b/lib/redblack.h index b6c37852..b423f453 100644 --- a/lib/redblack.h +++ b/lib/redblack.h @@ -256,13 +256,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 ((long) node->son[0]) & 1L; } + { return ((addr_int_t) node->son[0]) & 1L; } static inline void P(set_red_flag) (P(bucket) *node, uns flag) - { (long) node->son[0] = (((long) node->son[0]) & ~1L) | (flag & 1L); } + { (addr_int_t) node->son[0] = (((addr_int_t) node->son[0]) & ~1L) | (flag & 1L); } static inline P(bucket) * P(tree_son) (P(bucket) *node, uns id) - { return (void *) (((long) node->son[id]) & ~1L); } + { return (void *) (((addr_int_t) node->son[id]) & ~1L); } static inline void P(set_tree_son) (P(bucket) *node, uns id, P(bucket) *son) - { node->son[id] = (void *) ((long) son | (((long) node->son[id]) & 1L) ); } + { node->son[id] = (void *) ((addr_int_t) son | (((addr_int_t) node->son[id]) & 1L) ); } #endif /* Defaults for missing parameters. */