From: Christos Zoulas Date: Mon, 9 Nov 2015 21:03:42 +0000 (+0000) Subject: Add CCAST for const cast. X-Git-Tag: FILE5_26~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50341c8636a2ca1cf9103b675ec1082eaa86e743;p=file Add CCAST for const cast. --- diff --git a/src/file.h b/src/file.h index 842a09ea..8d927023 100644 --- a/src/file.h +++ b/src/file.h @@ -27,7 +27,7 @@ */ /* * file.h - definitions for file(1) program - * @(#)$File: file.h,v 1.171 2015/08/30 14:16:33 christos Exp $ + * @(#)$File: file.h,v 1.172 2015/09/11 17:24:09 christos Exp $ */ #ifndef __file_h__ @@ -365,9 +365,11 @@ struct mlist { #ifdef __cplusplus #define CAST(T, b) static_cast(b) #define RCAST(T, b) reinterpret_cast(b) +#define CCAST(T, b) const_cast(b) #else -#define CAST(T, b) (T)(b) -#define RCAST(T, b) (T)(b) +#define CAST(T, b) ((T)(b)) +#define RCAST(T, b) ((T)(b)) +#define CCAST(T, b) ((T)(uintptr_t)(b)) #endif struct level_info {