aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 19:22:15 +0100
committerMax Kellermann <max@duempel.org>2013-01-02 19:22:15 +0100
commita654f146d1b39a363cb10853a7670ef099570e54 (patch)
tree2c171646333f0b529655b57bee2c1eb6a3dd7c1c
parent67b46a151da4ca6f81fa63d30e2c629da352ec45 (diff)
downloadmpd-a654f146d1b39a363cb10853a7670ef099570e54.tar.gz
mpd-a654f146d1b39a363cb10853a7670ef099570e54.tar.xz
mpd-a654f146d1b39a363cb10853a7670ef099570e54.zip
update: convert to C++
-rw-r--r--Makefile.am38
-rw-r--r--src/InotifyQueue.cxx (renamed from src/inotify_queue.c)10
-rw-r--r--src/InotifyQueue.hxx (renamed from src/inotify_queue.h)6
-rw-r--r--src/InotifySource.cxx (renamed from src/inotify_source.c)15
-rw-r--r--src/InotifySource.hxx (renamed from src/inotify_source.h)6
-rw-r--r--src/InotifyUpdate.cxx (renamed from src/inotify_update.c)18
-rw-r--r--src/InotifyUpdate.hxx (renamed from src/inotify_update.h)6
-rw-r--r--src/Main.cxx10
-rw-r--r--src/OtherCommands.cxx2
-rw-r--r--src/PlayerCommands.cxx2
-rw-r--r--src/UpdateArchive.cxx (renamed from src/update_archive.c)9
-rw-r--r--src/UpdateArchive.hxx (renamed from src/update_archive.h)6
-rw-r--r--src/UpdateContainer.cxx (renamed from src/update_container.c)13
-rw-r--r--src/UpdateContainer.hxx (renamed from src/update_container.h)7
-rw-r--r--src/UpdateDatabase.cxx (renamed from src/update_db.c)9
-rw-r--r--src/UpdateDatabase.hxx (renamed from src/update_db.h)8
-rw-r--r--src/UpdateGlue.cxx (renamed from src/update.c)16
-rw-r--r--src/UpdateGlue.hxx (renamed from src/update.h)8
-rw-r--r--src/UpdateIO.cxx (renamed from src/update_io.c)7
-rw-r--r--src/UpdateIO.hxx (renamed from src/update_io.h)7
-rw-r--r--src/UpdateInternal.hxx (renamed from src/update_internal.h)0
-rw-r--r--src/UpdateQueue.cxx (renamed from src/update_queue.c)4
-rw-r--r--src/UpdateQueue.hxx (renamed from src/update_queue.h)8
-rw-r--r--src/UpdateRemove.cxx (renamed from src/update_remove.c)10
-rw-r--r--src/UpdateRemove.hxx (renamed from src/update_remove.h)6
-rw-r--r--src/UpdateSong.cxx (renamed from src/update_song.c)17
-rw-r--r--src/UpdateSong.hxx (renamed from src/update_song.h)7
-rw-r--r--src/UpdateWalk.cxx (renamed from src/update_walk.c)19
-rw-r--r--src/UpdateWalk.hxx (renamed from src/update_walk.h)6
-rw-r--r--test/RunInotify.cxx (renamed from test/run_inotify.c)2
30 files changed, 152 insertions, 130 deletions
diff --git a/Makefile.am b/Makefile.am
index 4f6b82388..5bfabe752 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -91,10 +91,6 @@ mpd_headers = \
src/fd_util.h \
src/gerror.h \
src/glib_compat.h \
- src/update.h \
- src/inotify_source.h \
- src/inotify_queue.h \
- src/inotify_update.h \
src/gcc.h \
src/decoder_list.h \
src/decoder_print.h \
@@ -263,15 +259,15 @@ src_mpd_SOURCES = \
src/filter_config.c \
src/filter_plugin.c \
src/filter_registry.c \
- src/update.c \
- src/update_queue.c src/update_queue.h \
- src/update_io.c src/update_io.h \
- src/update_db.c src/update_db.h \
- src/update_walk.c src/update_walk.h \
- src/update_song.c src/update_song.h \
- src/update_container.c src/update_container.h \
- src/update_internal.h \
- src/update_remove.c src/update_remove.h \
+ src/UpdateGlue.cxx src/UpdateGlue.hxx \
+ src/UpdateQueue.cxx src/UpdateQueue.hxx \
+ src/UpdateIO.cxx src/UpdateIO.hxx \
+ src/UpdateDatabase.cxx src/UpdateDatabase.hxx \
+ src/UpdateWalk.cxx src/UpdateWalk.hxx \
+ src/UpdateSong.cxx src/UpdateSong.hxx \
+ src/UpdateContainer.cxx src/UpdateContainer.hxx \
+ src/UpdateInternal.hxx \
+ src/UpdateRemove.cxx src/UpdateRemove.hxx \
src/client.c \
src/client_event.c \
src/client_expire.c \
@@ -374,9 +370,9 @@ endif
if ENABLE_INOTIFY
src_mpd_SOURCES += \
- src/inotify_source.c \
- src/inotify_queue.c \
- src/inotify_update.c
+ src/InotifySource.cxx src/InotifySource.hxx \
+ src/InotifyQueue.cxx src/InotifyQueue.hxx \
+ src/InotifyUpdate.cxx src/InotifyUpdate.hxx
endif
if ENABLE_SQLITE
@@ -449,7 +445,7 @@ if ENABLE_ARCHIVE
noinst_LIBRARIES += libarchive.a
src_mpd_SOURCES += \
- src/update_archive.c src/update_archive.h
+ src/UpdateArchive.cxx src/UpdateArchive.hxx
libarchive_a_SOURCES = \
src/archive_api.c \
@@ -1351,12 +1347,12 @@ TESTS += test/test_archive_iso9660.sh
endif
if ENABLE_INOTIFY
-noinst_PROGRAMS += test/run_inotify
-test_run_inotify_SOURCES = test/run_inotify.c \
+noinst_PROGRAMS += test/RunInotify
+test_RunInotify_SOURCES = test/RunInotify.c \
src/fd_util.c \
src/fifo_buffer.c \
- src/inotify_source.c
-test_run_inotify_LDADD = $(GLIB_LIBS)
+ src/InotifySource.cxx
+test_RunInotify_LDADD = $(GLIB_LIBS)
endif
test_test_byte_reverse_SOURCES = \
diff --git a/src/inotify_queue.c b/src/InotifyQueue.cxx
index d5e2228c3..572e53fc3 100644
--- a/src/inotify_queue.c
+++ b/src/InotifyQueue.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,8 +18,8 @@
*/
#include "config.h"
-#include "inotify_queue.h"
-#include "update.h"
+#include "InotifyQueue.hxx"
+#include "UpdateGlue.hxx"
#include <glib.h>
@@ -67,7 +67,7 @@ mpd_inotify_run_update(G_GNUC_UNUSED gpointer data)
unsigned id;
while (inotify_queue != NULL) {
- char *uri_utf8 = inotify_queue->data;
+ char *uri_utf8 = (char *)inotify_queue->data;
id = update_enqueue(uri_utf8, false);
if (id == 0)
@@ -108,7 +108,7 @@ mpd_inotify_enqueue(char *uri_utf8)
inotify_queue = NULL;
while (old_queue != NULL) {
- char *current_uri = old_queue->data;
+ char *current_uri = (char *)old_queue->data;
if (path_in(uri_utf8, current_uri)) {
/* already enqueued */
diff --git a/src/inotify_queue.h b/src/InotifyQueue.hxx
index cfc28ebfe..0c4863ab5 100644
--- a/src/inotify_queue.h
+++ b/src/InotifyQueue.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_INOTIFY_QUEUE_H
-#define MPD_INOTIFY_QUEUE_H
+#ifndef MPD_INOTIFY_QUEUE_HXX
+#define MPD_INOTIFY_QUEUE_HXX
void
mpd_inotify_queue_init(void);
diff --git a/src/inotify_source.c b/src/InotifySource.cxx
index 2fbfdff7e..689468102 100644
--- a/src/inotify_source.c
+++ b/src/InotifySource.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,8 +18,12 @@
*/
#include "config.h"
-#include "inotify_source.h"
+#include "InotifySource.hxx"
+
+extern "C" {
#include "fifo_buffer.h"
+}
+
#include "fd_util.h"
#include "mpd_error.h"
@@ -63,11 +67,10 @@ mpd_inotify_in_event(G_GNUC_UNUSED GIOChannel *_source,
G_GNUC_UNUSED GIOCondition condition,
gpointer data)
{
- struct mpd_inotify_source *source = data;
+ struct mpd_inotify_source *source = (struct mpd_inotify_source *)data;
void *dest;
size_t length;
ssize_t nbytes;
- const struct inotify_event *event;
dest = fifo_buffer_write(source->buffer, &length);
if (dest == NULL)
@@ -85,7 +88,9 @@ mpd_inotify_in_event(G_GNUC_UNUSED GIOChannel *_source,
while (true) {
const char *name;
- event = fifo_buffer_read(source->buffer, &length);
+ const struct inotify_event *event =
+ (const struct inotify_event *)
+ fifo_buffer_read(source->buffer, &length);
if (event == NULL || length < sizeof(*event) ||
length < sizeof(*event) + event->len)
break;
diff --git a/src/inotify_source.h b/src/InotifySource.hxx
index 7aec18b3d..cde2bc269 100644
--- a/src/inotify_source.h
+++ b/src/InotifySource.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_INOTIFY_SOURCE_H
-#define MPD_INOTIFY_SOURCE_H
+#ifndef MPD_INOTIFY_SOURCE_HXX
+#define MPD_INOTIFY_SOURCE_HXX
#include "gerror.h"
diff --git a/src/inotify_update.c b/src/InotifyUpdate.cxx
index 3f4a8c0c4..e9350591b 100644
--- a/src/inotify_update.c
+++ b/src/InotifyUpdate.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,12 +18,15 @@
*/
#include "config.h" /* must be first for large file support */
-#include "inotify_update.h"
-#include "inotify_source.h"
-#include "inotify_queue.h"
+#include "InotifyUpdate.hxx"
+#include "InotifySource.hxx"
+#include "InotifyQueue.hxx"
#include "database.h"
+
+extern "C" {
#include "mapper.h"
#include "path.h"
+}
#include <assert.h>
#include <sys/inotify.h>
@@ -90,7 +93,8 @@ tree_remove_watch_directory(struct watch_directory *directory)
static struct watch_directory *
tree_find_watch_directory(int wd)
{
- return g_tree_lookup(inotify_directories, GINT_TO_POINTER(wd));
+ return (struct watch_directory *)
+ g_tree_lookup(inotify_directories, GINT_TO_POINTER(wd));
}
static void
@@ -109,7 +113,7 @@ remove_watch_directory(struct watch_directory *directory)
tree_remove_watch_directory(directory);
while (directory->children != NULL)
- remove_watch_directory(directory->children->data);
+ remove_watch_directory((struct watch_directory *)directory->children->data);
directory->parent->children =
g_list_remove(directory->parent->children, directory);
@@ -349,7 +353,7 @@ static gboolean
free_watch_directory(G_GNUC_UNUSED gpointer key, gpointer value,
G_GNUC_UNUSED gpointer data)
{
- struct watch_directory *directory = value;
+ struct watch_directory *directory = (struct watch_directory *)value;
g_free(directory->name);
g_list_free(directory->children);
diff --git a/src/inotify_update.h b/src/InotifyUpdate.hxx
index ca75c0f45..ceb421553 100644
--- a/src/inotify_update.h
+++ b/src/InotifyUpdate.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_INOTIFY_UPDATE_H
-#define MPD_INOTIFY_UPDATE_H
+#ifndef MPD_INOTIFY_UPDATE_HXX
+#define MPD_INOTIFY_UPDATE_HXX
#include "check.h"
diff --git a/src/Main.cxx b/src/Main.cxx
index 057551391..44042d8ca 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -20,6 +20,7 @@
#include "config.h"
#include "Main.hxx"
#include "PlaylistFile.hxx"
+#include "UpdateGlue.hxx"
#include "chunk.h"
extern "C" {
@@ -31,7 +32,6 @@ extern "C" {
#include "AllCommands.h"
#include "playlist.h"
#include "database.h"
-#include "update.h"
#include "player_thread.h"
#include "listen.h"
#include "cmdline.h"
@@ -59,12 +59,12 @@ extern "C" {
#include "mpd_error.h"
-extern "C" {
-
#ifdef ENABLE_INOTIFY
-#include "inotify_update.h"
+#include "InotifyUpdate.hxx"
#endif
+extern "C" {
+
#ifdef ENABLE_SQLITE
#include "sticker.h"
#endif
diff --git a/src/OtherCommands.cxx b/src/OtherCommands.cxx
index a703a2ffe..8518f437f 100644
--- a/src/OtherCommands.cxx
+++ b/src/OtherCommands.cxx
@@ -21,6 +21,7 @@
#include "OtherCommands.hxx"
#include "DatabaseCommands.hxx"
#include "CommandError.hxx"
+#include "UpdateGlue.hxx"
#include "directory.h"
#include "song.h"
@@ -31,7 +32,6 @@ extern "C" {
#include "ls.h"
#include "uri.h"
#include "decoder_print.h"
-#include "update.h"
#include "volume.h"
#include "stats.h"
#include "permission.h"
diff --git a/src/PlayerCommands.cxx b/src/PlayerCommands.cxx
index 015ac9a15..3aa3f7e63 100644
--- a/src/PlayerCommands.cxx
+++ b/src/PlayerCommands.cxx
@@ -21,13 +21,13 @@
#include "PlayerCommands.hxx"
#include "CommandError.hxx"
#include "PlaylistPrint.hxx"
+#include "UpdateGlue.hxx"
extern "C" {
#include "protocol/argparser.h"
#include "protocol/result.h"
#include "player_control.h"
#include "playlist.h"
-#include "update.h"
#include "volume.h"
#include "client.h"
#include "client_internal.h"
diff --git a/src/update_archive.c b/src/UpdateArchive.cxx
index 3fb2bc18c..c57534ea4 100644
--- a/src/update_archive.c
+++ b/src/UpdateArchive.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,14 +18,17 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_archive.h"
-#include "update_internal.h"
+#include "UpdateArchive.hxx"
+#include "UpdateInternal.hxx"
#include "db_lock.h"
#include "directory.h"
#include "song.h"
+
+extern "C" {
#include "mapper.h"
#include "archive_list.h"
#include "archive_plugin.h"
+}
#include <glib.h>
diff --git a/src/update_archive.h b/src/UpdateArchive.hxx
index a9139b0e0..533f8ffd0 100644
--- a/src/update_archive.h
+++ b/src/UpdateArchive.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_ARCHIVE_H
-#define MPD_UPDATE_ARCHIVE_H
+#ifndef MPD_UPDATE_ARCHIVE_HXX
+#define MPD_UPDATE_ARCHIVE_HXX
#include "check.h"
#include "gcc.h"
diff --git a/src/update_container.c b/src/UpdateContainer.cxx
index bda95dabe..68f8c3b98 100644
--- a/src/update_container.c
+++ b/src/UpdateContainer.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,16 +18,19 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_container.h"
-#include "update_internal.h"
-#include "update_db.h"
+#include "UpdateContainer.hxx"
+#include "UpdateInternal.hxx"
+#include "UpdateDatabase.hxx"
#include "db_lock.h"
#include "directory.h"
#include "song.h"
-#include "mapper.h"
#include "decoder_plugin.h"
+
+extern "C" {
+#include "mapper.h"
#include "tag.h"
#include "tag_handler.h"
+}
#include <glib.h>
diff --git a/src/update_container.h b/src/UpdateContainer.hxx
index 7f42c80ca..81f081a59 100644
--- a/src/update_container.h
+++ b/src/UpdateContainer.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_CONTAINER_H
-#define MPD_UPDATE_CONTAINER_H
+#ifndef MPD_UPDATE_CONTAINER_HXX
+#define MPD_UPDATE_CONTAINER_HXX
#include "check.h"
-#include <stdbool.h>
#include <sys/stat.h>
struct directory;
diff --git a/src/update_db.c b/src/UpdateDatabase.cxx
index 8982a53e2..fa3408d66 100644
--- a/src/update_db.c
+++ b/src/UpdateDatabase.cxx
@@ -18,13 +18,16 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_db.h"
-#include "update_remove.h"
+#include "UpdateDatabase.hxx"
+#include "UpdateRemove.hxx"
#include "directory.h"
#include "song.h"
-#include "playlist_vector.h"
#include "db_lock.h"
+extern "C" {
+#include "playlist_vector.h"
+}
+
#include <glib.h>
#include <assert.h>
diff --git a/src/update_db.h b/src/UpdateDatabase.hxx
index 0a9e46b05..511f75690 100644
--- a/src/update_db.h
+++ b/src/UpdateDatabase.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,13 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_DB_H
-#define MPD_UPDATE_DB_H
+#ifndef MPD_UPDATE_DATABASE_HXX
+#define MPD_UPDATE_DATABASE_HXX
#include "check.h"
-#include <stdbool.h>
-
struct directory;
struct song;
diff --git a/src/update.c b/src/UpdateGlue.cxx
index e47db8f09..203f16b76 100644
--- a/src/update.c
+++ b/src/UpdateGlue.cxx
@@ -18,18 +18,20 @@
*/
#include "config.h"
-#include "update.h"
-#include "update_queue.h"
-#include "update_walk.h"
-#include "update_remove.h"
-#include "update.h"
+#include "UpdateGlue.hxx"
+#include "UpdateQueue.hxx"
+#include "UpdateWalk.hxx"
+#include "UpdateRemove.hxx"
+
+extern "C" {
#include "database.h"
#include "mapper.h"
#include "playlist.h"
#include "event_pipe.h"
-#include "update.h"
#include "idle.h"
#include "stats.h"
+}
+
#include "Main.hxx"
#include "mpd_error.h"
@@ -65,7 +67,7 @@ isUpdatingDB(void)
static void * update_task(void *_path)
{
- const char *path = _path;
+ const char *path = (const char *)_path;
if (path != NULL && *path != 0)
g_debug("starting: %s", path);
diff --git a/src/update.h b/src/UpdateGlue.hxx
index 3d586b694..9d546a2a3 100644
--- a/src/update.h
+++ b/src/UpdateGlue.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,10 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_H
-#define MPD_UPDATE_H
-
-#include <stdbool.h>
+#ifndef MPD_UPDATE_GLUE_HXX
+#define MPD_UPDATE_GLUE_HXX
void update_global_init(void);
diff --git a/src/update_io.c b/src/UpdateIO.cxx
index c6a540a0f..fefbc4d11 100644
--- a/src/update_io.c
+++ b/src/UpdateIO.cxx
@@ -18,11 +18,14 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_io.h"
-#include "mapper.h"
+#include "UpdateIO.hxx"
#include "directory.h"
#include "glib_compat.h"
+extern "C" {
+#include "mapper.h"
+}
+
#include <glib.h>
#include <errno.h>
diff --git a/src/update_io.h b/src/UpdateIO.hxx
index 6ff1ccebd..7b6175fdf 100644
--- a/src/update_io.h
+++ b/src/UpdateIO.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_IO_H
-#define MPD_UPDATE_IO_H
+#ifndef MPD_UPDATE_IO_HXX
+#define MPD_UPDATE_IO_HXX
#include "check.h"
-#include <stdbool.h>
#include <sys/stat.h>
struct directory;
diff --git a/src/update_internal.h b/src/UpdateInternal.hxx
index 76ab7bed3..76ab7bed3 100644
--- a/src/update_internal.h
+++ b/src/UpdateInternal.hxx
diff --git a/src/update_queue.c b/src/UpdateQueue.cxx
index 2150fa4e4..85eb22358 100644
--- a/src/update_queue.c
+++ b/src/UpdateQueue.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "update_queue.h"
+#include "UpdateQueue.hxx"
#include <glib.h>
diff --git a/src/update_queue.h b/src/UpdateQueue.hxx
index 84ba474b0..7de06964f 100644
--- a/src/update_queue.h
+++ b/src/UpdateQueue.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,13 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_QUEUE_H
-#define MPD_UPDATE_QUEUE_H
+#ifndef MPD_UPDATE_QUEUE_HXX
+#define MPD_UPDATE_QUEUE_HXX
#include "check.h"
-#include <stdbool.h>
-
unsigned
update_queue_push(const char *path, bool discard, unsigned base);
diff --git a/src/update_remove.c b/src/UpdateRemove.cxx
index c2e353c63..71852ea96 100644
--- a/src/update_remove.c
+++ b/src/UpdateRemove.cxx
@@ -18,15 +18,21 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_remove.h"
+#include "UpdateRemove.hxx"
+
+extern "C" {
#include "event_pipe.h"
-#include "song.h"
#include "playlist.h"
+}
+
+#include "song.h"
#include "Main.hxx"
#ifdef ENABLE_SQLITE
+extern "C" {
#include "sticker.h"
#include "song_sticker.h"
+}
#endif
#include <glib.h>
diff --git a/src/update_remove.h b/src/UpdateRemove.hxx
index 479ef83ff..dc15622fc 100644
--- a/src/update_remove.h
+++ b/src/UpdateRemove.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_REMOVE_H
-#define MPD_UPDATE_REMOVE_H
+#ifndef MPD_UPDATE_REMOVE_HXX
+#define MPD_UPDATE_REMOVE_HXX
#include "check.h"
diff --git a/src/update_song.c b/src/UpdateSong.cxx
index 1126ad115..8241d46f2 100644
--- a/src/update_song.c
+++ b/src/UpdateSong.cxx
@@ -18,17 +18,20 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_song.h"
-#include "update_internal.h"
-#include "update_io.h"
-#include "update_db.h"
-#include "update_container.h"
+#include "UpdateSong.hxx"
+#include "UpdateInternal.hxx"
+#include "UpdateIO.hxx"
+#include "UpdateDatabase.hxx"
+#include "UpdateContainer.hxx"
#include "db_lock.h"
#include "directory.h"
#include "song.h"
-#include "decoder_list.h"
#include "decoder_plugin.h"
+extern "C" {
+#include "decoder_list.h"
+}
+
#include <glib.h>
#include <unistd.h>
@@ -104,7 +107,7 @@ update_song_file(struct directory *directory,
const struct stat *st)
{
const struct decoder_plugin *plugin =
- decoder_plugin_from_suffix(suffix, false);
+ decoder_plugin_from_suffix(suffix, nullptr);
if (plugin == NULL)
return false;
diff --git a/src/update_song.h b/src/UpdateSong.hxx
index cff63f576..abf25aae9 100644
--- a/src/update_song.h
+++ b/src/UpdateSong.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_SONG_H
-#define MPD_UPDATE_SONG_H
+#ifndef MPD_UPDATE_SONG_HXX
+#define MPD_UPDATE_SONG_HXX
#include "check.h"
-#include <stdbool.h>
#include <sys/stat.h>
struct directory;
diff --git a/src/update_walk.c b/src/UpdateWalk.cxx
index 8554e8f3c..a8ca1e4ed 100644
--- a/src/update_walk.c
+++ b/src/UpdateWalk.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,22 +18,25 @@
*/
#include "config.h" /* must be first for large file support */
-#include "update_walk.h"
-#include "update_io.h"
-#include "update_db.h"
-#include "update_song.h"
-#include "update_archive.h"
-#include "database.h"
+#include "UpdateWalk.hxx"
+#include "UpdateIO.hxx"
+#include "UpdateDatabase.hxx"
+#include "UpdateSong.hxx"
+#include "UpdateArchive.hxx"
#include "db_lock.h"
-#include "exclude.h"
#include "directory.h"
#include "song.h"
+
+extern "C" {
+#include "exclude.h"
+#include "database.h"
#include "playlist_vector.h"
#include "uri.h"
#include "mapper.h"
#include "path.h"
#include "playlist_list.h"
#include "conf.h"
+}
#include <glib.h>
diff --git a/src/update_walk.h b/src/UpdateWalk.hxx
index ab1e41fb9..7fa3083fc 100644
--- a/src/update_walk.h
+++ b/src/UpdateWalk.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2012 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_UPDATE_WALK_H
-#define MPD_UPDATE_WALK_H
+#ifndef MPD_UPDATE_WALK_HXX
+#define MPD_UPDATE_WALK_HXX
#include "check.h"
diff --git a/test/run_inotify.c b/test/RunInotify.cxx
index 4ceb60229..491cddb78 100644
--- a/test/run_inotify.c
+++ b/test/RunInotify.cxx
@@ -18,7 +18,7 @@
*/
#include "config.h"
-#include "inotify_source.h"
+#include "InotifySource.hxx"
#include <glib.h>