From b1c6681c929e07a7868cd73869498f2ee389ef32 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 26 May 2017 15:49:09 +0200 Subject: [PATCH] Use of M_CONST_CAST --- m-shared.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/m-shared.h b/m-shared.h index b08ee302..28bf2cf6 100644 --- a/m-shared.h +++ b/m-shared.h @@ -75,19 +75,6 @@ struct M_C3(shared_, name, _s) ptr; \ } M_C3(shared_contain_, name, _t)[1]; \ \ - typedef union { \ - type *ptr; \ - const type *cptr; \ - } M_C3(shared_union_, name,_t); \ - \ - static inline const type * \ - M_C3(shared_, name, _const_cast)(type *ptr) \ - { \ - M_C3(shared_union_, name,_t) u; \ - u.ptr = ptr; \ - return u.cptr; \ - } \ - \ static inline void \ M_C3(shared_, name, _init)(M_C3(shared_, name, _t) shared) \ { \ @@ -231,7 +218,7 @@ assert(*shared != NULL); \ type *data = (*shared)->data; \ assert (data != NULL); \ - return M_C3(shared_, name, _const_cast) (data); \ + return M_CONST_CAST (type, data); \ } \ \ static inline type * \