From 43a34f666320b886cea76a0e40d1b0ec25bc57c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 21 Feb 2019 14:34:08 -0500 Subject: [PATCH] roken: tsearch use rk_UNCONST instead of __DECONST #307 The rk_UNCONST macro exists because neither __DECONST nor uintptr_t are available on all platforms (for example, AIX). Change-Id: Ie36f0dd7a9ce454d411761ee4dbd6fc1f7c6692c --- lib/roken/tsearch.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/roken/tsearch.c b/lib/roken/tsearch.c index 0820bb62c..e5df84633 100644 --- a/lib/roken/tsearch.c +++ b/lib/roken/tsearch.c @@ -24,10 +24,6 @@ typedef struct node { struct node *llink, *rlink; } node_t; -#ifndef __DECONST -#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) -#endif - /* * find or insert datum into search tree * @@ -61,7 +57,7 @@ rk_tsearch(const void *vkey, void **vrootp, if (q != 0) { /* make new node */ *rootp = q; /* link new node to old */ /* LINTED const castaway ok */ - q->key = __DECONST(void *, vkey); /* initialize new node */ + q->key = rk_UNCONST(vkey); /* initialize new node */ q->llink = q->rlink = NULL; } return q;