diff options
author | Max Kellermann <max@duempel.org> | 2013-08-07 19:58:52 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-07 19:58:52 +0200 |
commit | abe090ec1f2255ce422f74e5b59bffc83aaff875 (patch) | |
tree | a5fb54e1484faeb549b9b0c1c5b27936a63a9099 | |
parent | dff05c71e61b2fe1aab4bef4fabf9bb093769bf1 (diff) | |
download | mpd-abe090ec1f2255ce422f74e5b59bffc83aaff875.tar.gz mpd-abe090ec1f2255ce422f74e5b59bffc83aaff875.tar.xz mpd-abe090ec1f2255ce422f74e5b59bffc83aaff875.zip |
*: remove remaining __cplusplus checks
-rw-r--r-- | src/ConfigGlobal.hxx | 14 | ||||
-rw-r--r-- | src/DatabaseLock.hxx | 4 | ||||
-rw-r--r-- | src/DecoderPlugin.hxx | 8 | ||||
-rw-r--r-- | src/MixerControl.hxx | 8 | ||||
-rw-r--r-- | src/PlaylistFile.hxx | 4 | ||||
-rw-r--r-- | src/mixer/PulseMixerPlugin.hxx | 8 | ||||
-rw-r--r-- | src/output/PulseOutputPlugin.hxx | 8 | ||||
-rw-r--r-- | src/util/StringUtil.hxx | 24 |
8 files changed, 1 insertions, 77 deletions
diff --git a/src/ConfigGlobal.hxx b/src/ConfigGlobal.hxx index 9abfb2b5d..fff813f3e 100644 --- a/src/ConfigGlobal.hxx +++ b/src/ConfigGlobal.hxx @@ -30,9 +30,7 @@ #define DEFAULT_PLAYLIST_MAX_LENGTH (1024*16) #define DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS false -#ifdef __cplusplus class Path; -#endif void config_global_init(void); void config_global_finish(void); @@ -43,17 +41,9 @@ void config_global_finish(void); */ void config_global_check(void); -#ifdef __cplusplus - bool ReadConfigFile(const Path &path, GError **error_r); -#endif - -#ifdef __cplusplus -extern "C" { -#endif - /* don't free the returned value set _last_ to NULL to get first entry */ gcc_pure @@ -102,8 +92,4 @@ config_get_positive(enum ConfigOption option, unsigned default_value); gcc_pure bool config_get_bool(enum ConfigOption option, bool default_value); -#ifdef __cplusplus -} -#endif - #endif diff --git a/src/DatabaseLock.hxx b/src/DatabaseLock.hxx index 739f56658..ba6157999 100644 --- a/src/DatabaseLock.hxx +++ b/src/DatabaseLock.hxx @@ -82,8 +82,6 @@ db_unlock(void) db_mutex.unlock(); } -#ifdef __cplusplus - class ScopeDatabaseLock { public: ScopeDatabaseLock() { @@ -96,5 +94,3 @@ public: }; #endif - -#endif diff --git a/src/DecoderPlugin.hxx b/src/DecoderPlugin.hxx index 687447dee..693b8feee 100644 --- a/src/DecoderPlugin.hxx +++ b/src/DecoderPlugin.hxx @@ -187,10 +187,6 @@ decoder_plugin_container_scan( const struct decoder_plugin *plugin, return plugin->container_scan(pathname, tnum); } -#ifdef __cplusplus -extern "C" { -#endif - /** * Does the plugin announce the specified file name suffix? */ @@ -205,8 +201,4 @@ bool decoder_plugin_supports_mime_type(const struct decoder_plugin *plugin, const char *mime_type); -#ifdef __cplusplus -} -#endif - #endif diff --git a/src/MixerControl.hxx b/src/MixerControl.hxx index e7b65d6e8..cf609e817 100644 --- a/src/MixerControl.hxx +++ b/src/MixerControl.hxx @@ -31,10 +31,6 @@ class Mixer; struct mixer_plugin; struct config_param; -#ifdef __cplusplus -extern "C" { -#endif - Mixer * mixer_new(const struct mixer_plugin *plugin, void *ao, const config_param ¶m, @@ -62,8 +58,4 @@ mixer_get_volume(Mixer *mixer, GError **error_r); bool mixer_set_volume(Mixer *mixer, unsigned volume, GError **error_r); -#ifdef __cplusplus -} -#endif - #endif diff --git a/src/PlaylistFile.hxx b/src/PlaylistFile.hxx index 4fcecc8da..15dfd480d 100644 --- a/src/PlaylistFile.hxx +++ b/src/PlaylistFile.hxx @@ -39,8 +39,6 @@ extern bool playlist_saveAbsolutePaths; void spl_global_init(void); -#ifdef __cplusplus - /** * Determines whether the specified string is a valid name for a * stored playlist. @@ -81,5 +79,3 @@ bool spl_rename(const char *utf8from, const char *utf8to, GError **error_r); #endif - -#endif diff --git a/src/mixer/PulseMixerPlugin.hxx b/src/mixer/PulseMixerPlugin.hxx index debc2cf3c..fa73e0f5e 100644 --- a/src/mixer/PulseMixerPlugin.hxx +++ b/src/mixer/PulseMixerPlugin.hxx @@ -26,10 +26,6 @@ struct PulseMixer; struct pa_context; struct pa_stream; -#ifdef __cplusplus -extern "C" { -#endif - void pulse_mixer_on_connect(PulseMixer *pm, struct pa_context *context); @@ -40,8 +36,4 @@ void pulse_mixer_on_change(PulseMixer *pm, struct pa_context *context, struct pa_stream *stream); -#ifdef __cplusplus -} -#endif - #endif diff --git a/src/output/PulseOutputPlugin.hxx b/src/output/PulseOutputPlugin.hxx index 58dc6703c..278969f8d 100644 --- a/src/output/PulseOutputPlugin.hxx +++ b/src/output/PulseOutputPlugin.hxx @@ -28,10 +28,6 @@ struct pa_cvolume; extern const struct audio_output_plugin pulse_output_plugin; -#ifdef __cplusplus -extern "C" { -#endif - void pulse_output_lock(PulseOutput *po); @@ -48,8 +44,4 @@ bool pulse_output_set_volume(PulseOutput *po, const struct pa_cvolume *volume, GError **error_r); -#ifdef __cplusplus -} -#endif - #endif 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 @@ -23,28 +23,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<char *>(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<char *>(strchug_fast_c(p)); } /** |