From abe090ec1f2255ce422f74e5b59bffc83aaff875 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Aug 2013 19:58:52 +0200 Subject: *: remove remaining __cplusplus checks --- src/util/StringUtil.hxx | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/util/StringUtil.hxx') diff --git a/src/util/StringUtil.hxx b/src/util/StringUtil.hxx index 72d613798..6eeca893d 100644 --- a/src/util/StringUtil.hxx +++ b/src/util/StringUtil.hxx @@ -22,28 +22,6 @@ #include "gcc.h" -/** - * Remove the "const" attribute from a string pointer. This is a - * dirty hack, don't use it unless you know what you're doing! - */ -gcc_const -static inline char * -deconst_string(const char *p) -{ -#ifdef __cplusplus - return const_cast(p); -#else - union { - const char *in; - char *out; - } u = { - .in = p, - }; - - return u.out; -#endif -} - /** * Returns a pointer to the first non-whitespace character in the * string, or to the end of the string. @@ -62,7 +40,7 @@ gcc_pure static inline char * strchug_fast(char *p) { - return deconst_string(strchug_fast_c(p)); + return const_cast(strchug_fast_c(p)); } /** -- cgit v1.2.3