From edf811fa0271da729e9962e3976f2a68ac35a395 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Aug 2012 18:20:46 +0200 Subject: DatabaseVisitor, ...: use GError forward declaration --- Makefile.am | 1 + src/DatabaseVisitor.hxx | 4 ++-- src/audio_parser.h | 2 +- src/dbUtils.h | 2 +- src/db_print.h | 2 +- src/db_save.h | 3 ++- src/db_selection.h | 1 + src/encoder_plugin.h | 2 +- src/event_pipe.h | 2 -- src/filter/null_filter_plugin.c | 1 + src/filter_plugin.h | 2 +- src/gerror.h | 25 +++++++++++++++++++++++++ src/inotify_source.c | 2 ++ src/inotify_source.h | 2 +- src/input_init.h | 3 +-- src/listen.h | 2 +- src/mapper.h | 2 ++ src/mixer_control.h | 2 +- src/mixer_plugin.h | 2 +- src/output/pulse_output_plugin.h | 4 ++-- src/output_plugin.h | 2 ++ src/server_socket.h | 5 +++-- src/socket_util.c | 2 ++ src/socket_util.h | 4 +++- src/sticker.h | 10 +++++----- src/sticker_print.c | 2 +- src/tag_id3.h | 1 + src/tokenizer.c | 2 ++ src/tokenizer.h | 2 +- src/utils.h | 3 ++- test/run_inotify.c | 2 ++ 31 files changed, 72 insertions(+), 29 deletions(-) create mode 100644 src/gerror.h diff --git a/Makefile.am b/Makefile.am index 12c76b89c..a39267f4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,6 +87,7 @@ mpd_headers = \ src/encoder_api.h \ src/exclude.h \ src/fd_util.h \ + src/gerror.h \ src/glib_compat.h \ src/update.h \ src/inotify_source.h \ diff --git a/src/DatabaseVisitor.hxx b/src/DatabaseVisitor.hxx index 1676cae19..96d24911f 100644 --- a/src/DatabaseVisitor.hxx +++ b/src/DatabaseVisitor.hxx @@ -20,9 +20,9 @@ #ifndef MPD_DATABASE_VISITOR_HXX #define MPD_DATABASE_VISITOR_HXX -#include +#include "gerror.h" -#include +#include struct directory; struct song; diff --git a/src/audio_parser.h b/src/audio_parser.h index a963eb467..49926999e 100644 --- a/src/audio_parser.h +++ b/src/audio_parser.h @@ -25,7 +25,7 @@ #ifndef AUDIO_PARSER_H #define AUDIO_PARSER_H -#include +#include "gerror.h" #include diff --git a/src/dbUtils.h b/src/dbUtils.h index 706c807fd..95884daa1 100644 --- a/src/dbUtils.h +++ b/src/dbUtils.h @@ -21,8 +21,8 @@ #define MPD_DB_UTILS_H #include "gcc.h" +#include "gerror.h" -#include #include struct locate_item_list; diff --git a/src/db_print.h b/src/db_print.h index 1b957da18..078d4e582 100644 --- a/src/db_print.h +++ b/src/db_print.h @@ -21,8 +21,8 @@ #define MPD_DB_PRINT_H #include "gcc.h" +#include "gerror.h" -#include #include struct client; diff --git a/src/db_save.h b/src/db_save.h index e760ec881..d232d7331 100644 --- a/src/db_save.h +++ b/src/db_save.h @@ -20,7 +20,8 @@ #ifndef MPD_DB_SAVE_H #define MPD_DB_SAVE_H -#include +#include "gerror.h" + #include #include diff --git a/src/db_selection.h b/src/db_selection.h index 2cebb4907..002acdc73 100644 --- a/src/db_selection.h +++ b/src/db_selection.h @@ -23,6 +23,7 @@ #include "gcc.h" #include +#include struct directory; struct song; diff --git a/src/encoder_plugin.h b/src/encoder_plugin.h index 33a379115..68a89d573 100644 --- a/src/encoder_plugin.h +++ b/src/encoder_plugin.h @@ -20,7 +20,7 @@ #ifndef MPD_ENCODER_PLUGIN_H #define MPD_ENCODER_PLUGIN_H -#include +#include "gerror.h" #include #include diff --git a/src/event_pipe.h b/src/event_pipe.h index 3734bb86c..3749ccf79 100644 --- a/src/event_pipe.h +++ b/src/event_pipe.h @@ -20,8 +20,6 @@ #ifndef EVENT_PIPE_H #define EVENT_PIPE_H -#include - enum pipe_event { /** database update was finished */ PIPE_EVENT_UPDATE, diff --git a/src/filter/null_filter_plugin.c b/src/filter/null_filter_plugin.c index e7c998827..7728c55bf 100644 --- a/src/filter/null_filter_plugin.c +++ b/src/filter/null_filter_plugin.c @@ -29,6 +29,7 @@ #include "filter_internal.h" #include "filter_registry.h" +#include #include struct null_filter { diff --git a/src/filter_plugin.h b/src/filter_plugin.h index 58e34dfb2..d45faee1f 100644 --- a/src/filter_plugin.h +++ b/src/filter_plugin.h @@ -26,7 +26,7 @@ #ifndef MPD_FILTER_PLUGIN_H #define MPD_FILTER_PLUGIN_H -#include +#include "gerror.h" #include #include diff --git a/src/gerror.h b/src/gerror.h new file mode 100644 index 000000000..fe4c54da9 --- /dev/null +++ b/src/gerror.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2003-2011 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_GERROR_H +#define MPD_GERROR_H + +typedef struct _GError GError; + +#endif diff --git a/src/inotify_source.c b/src/inotify_source.c index e415f5e72..2fbfdff7e 100644 --- a/src/inotify_source.c +++ b/src/inotify_source.c @@ -23,6 +23,8 @@ #include "fd_util.h" #include "mpd_error.h" +#include + #include #include #include diff --git a/src/inotify_source.h b/src/inotify_source.h index f92e18e39..7aec18b3d 100644 --- a/src/inotify_source.h +++ b/src/inotify_source.h @@ -20,7 +20,7 @@ #ifndef MPD_INOTIFY_SOURCE_H #define MPD_INOTIFY_SOURCE_H -#include +#include "gerror.h" typedef void (*mpd_inotify_callback_t)(int wd, unsigned mask, const char *name, void *ctx); diff --git a/src/input_init.h b/src/input_init.h index ad92cda08..1a73e5ef9 100644 --- a/src/input_init.h +++ b/src/input_init.h @@ -20,9 +20,8 @@ #ifndef MPD_INPUT_INIT_H #define MPD_INPUT_INIT_H -#include "check.h" +#include "gerror.h" -#include #include /** diff --git a/src/listen.h b/src/listen.h index 246e83706..100fe252e 100644 --- a/src/listen.h +++ b/src/listen.h @@ -20,7 +20,7 @@ #ifndef MPD_LISTEN_H #define MPD_LISTEN_H -#include +#include "gerror.h" #include diff --git a/src/mapper.h b/src/mapper.h index ed4a60b56..da2bf3daf 100644 --- a/src/mapper.h +++ b/src/mapper.h @@ -24,6 +24,8 @@ #ifndef MPD_MAPPER_H #define MPD_MAPPER_H +#include "gerror.h" + #include #include diff --git a/src/mixer_control.h b/src/mixer_control.h index 6c3468aca..307298e47 100644 --- a/src/mixer_control.h +++ b/src/mixer_control.h @@ -25,7 +25,7 @@ #ifndef MPD_MIXER_CONTROL_H #define MPD_MIXER_CONTROL_H -#include +#include "gerror.h" #include diff --git a/src/mixer_plugin.h b/src/mixer_plugin.h index 9532b95cb..2f3beed1d 100644 --- a/src/mixer_plugin.h +++ b/src/mixer_plugin.h @@ -27,7 +27,7 @@ #ifndef MPD_MIXER_PLUGIN_H #define MPD_MIXER_PLUGIN_H -#include +#include "gerror.h" #include diff --git a/src/output/pulse_output_plugin.h b/src/output/pulse_output_plugin.h index 02a51f27b..b285b5e4d 100644 --- a/src/output/pulse_output_plugin.h +++ b/src/output/pulse_output_plugin.h @@ -20,9 +20,9 @@ #ifndef MPD_PULSE_OUTPUT_PLUGIN_H #define MPD_PULSE_OUTPUT_PLUGIN_H -#include +#include "gerror.h" -#include +#include struct pulse_output; struct pulse_mixer; diff --git a/src/output_plugin.h b/src/output_plugin.h index 209ca6221..7ac8e0c4f 100644 --- a/src/output_plugin.h +++ b/src/output_plugin.h @@ -20,6 +20,8 @@ #ifndef MPD_OUTPUT_PLUGIN_H #define MPD_OUTPUT_PLUGIN_H +#include "gerror.h" + #include #include diff --git a/src/server_socket.h b/src/server_socket.h index 7caa4bbf2..f7e9aa4cf 100644 --- a/src/server_socket.h +++ b/src/server_socket.h @@ -20,9 +20,10 @@ #ifndef MPD_SERVER_SOCKET_H #define MPD_SERVER_SOCKET_H -#include +#include "gerror.h" -#include +#include +#include struct sockaddr; diff --git a/src/socket_util.c b/src/socket_util.c index a06a0cbd5..ee8bf7e1a 100644 --- a/src/socket_util.c +++ b/src/socket_util.c @@ -21,6 +21,8 @@ #include "socket_util.h" #include "fd_util.h" +#include + #include #include diff --git a/src/socket_util.h b/src/socket_util.h index 93bd27362..4cf845d8e 100644 --- a/src/socket_util.h +++ b/src/socket_util.h @@ -26,7 +26,9 @@ #ifndef SOCKET_UTIL_H #define SOCKET_UTIL_H -#include +#include "gerror.h" + +#include struct sockaddr; diff --git a/src/sticker.h b/src/sticker.h index 5545206a5..66f12294b 100644 --- a/src/sticker.h +++ b/src/sticker.h @@ -42,7 +42,7 @@ #ifndef STICKER_H #define STICKER_H -#include +#include "gerror.h" #include @@ -127,8 +127,8 @@ sticker_get_value(const struct sticker *sticker, const char *name); void sticker_foreach(const struct sticker *sticker, void (*func)(const char *name, const char *value, - gpointer user_data), - gpointer user_data); + void *user_data), + void *user_data); /** * Loads the sticker for the specified resource. @@ -153,7 +153,7 @@ sticker_load(const char *type, const char *uri); bool sticker_find(const char *type, const char *base_uri, const char *name, void (*func)(const char *uri, const char *value, - gpointer user_data), - gpointer user_data); + void *user_data), + void *user_data); #endif diff --git a/src/sticker_print.c b/src/sticker_print.c index 65e79513c..b19dcdc9c 100644 --- a/src/sticker_print.c +++ b/src/sticker_print.c @@ -30,7 +30,7 @@ sticker_print_value(struct client *client, } static void -print_sticker_cb(const char *name, const char *value, gpointer data) +print_sticker_cb(const char *name, const char *value, void *data) { struct client *client = data; diff --git a/src/tag_id3.h b/src/tag_id3.h index 049c53ad9..055d0a3d1 100644 --- a/src/tag_id3.h +++ b/src/tag_id3.h @@ -21,6 +21,7 @@ #define MPD_TAG_ID3_H #include "check.h" +#include "gerror.h" #include diff --git a/src/tokenizer.c b/src/tokenizer.c index bbb34e100..4a98e882f 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -21,6 +21,8 @@ #include "tokenizer.h" #include "string_util.h" +#include + #include #include #include diff --git a/src/tokenizer.h b/src/tokenizer.h index d55eb3ca6..2026e5ad6 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -20,7 +20,7 @@ #ifndef MPD_TOKENIZER_H #define MPD_TOKENIZER_H -#include +#include "gerror.h" /** * Reads the next word from the input string. This function modifies diff --git a/src/utils.h b/src/utils.h index f8d6657f2..ba7307ded 100644 --- a/src/utils.h +++ b/src/utils.h @@ -20,7 +20,8 @@ #ifndef MPD_UTILS_H #define MPD_UTILS_H -#include +#include "gerror.h" + #include #ifndef assert_static diff --git a/test/run_inotify.c b/test/run_inotify.c index 3e7c70dba..4ceb60229 100644 --- a/test/run_inotify.c +++ b/test/run_inotify.c @@ -20,6 +20,8 @@ #include "config.h" #include "inotify_source.h" +#include + #include #include #include -- cgit v1.2.3