stored_playlist, playlist_save: use C++ compiler

This commit is contained in:
Max Kellermann 2012-09-27 22:55:57 +02:00
parent acec9c4fd7
commit 7298b6c846
13 changed files with 52 additions and 38 deletions

View File

@ -152,11 +152,9 @@ mpd_headers = \
src/playlist.h \ src/playlist.h \
src/playlist_error.h \ src/playlist_error.h \
src/playlist_internal.h \ src/playlist_internal.h \
src/playlist_save.h \
src/playlist_state.h \ src/playlist_state.h \
src/playlist_plugin.h \ src/playlist_plugin.h \
src/playlist_list.h \ src/playlist_list.h \
src/playlist_mapper.h \
src/playlist_any.h \ src/playlist_any.h \
src/playlist_song.h \ src/playlist_song.h \
src/playlist_queue.h \ src/playlist_queue.h \
@ -208,7 +206,6 @@ mpd_headers = \
src/string_util.h \ src/string_util.h \
src/volume.h \ src/volume.h \
src/zeroconf.h src/zeroconf-internal.h \ src/zeroconf.h src/zeroconf-internal.h \
src/stored_playlist.h \
src/timer.h \ src/timer.h \
src/archive_api.h \ src/archive_api.h \
src/archive_internal.h \ src/archive_internal.h \
@ -322,8 +319,8 @@ src_mpd_SOURCES = \
src/playlist_control.c \ src/playlist_control.c \
src/playlist_edit.c \ src/playlist_edit.c \
src/PlaylistPrint.cxx src/PlaylistPrint.hxx \ src/PlaylistPrint.cxx src/PlaylistPrint.hxx \
src/playlist_save.c \ src/PlaylistSave.cxx src/PlaylistSave.hxx \
src/playlist_mapper.c \ src/PlaylistMapper.cxx src/PlaylistMapper.h \
src/playlist_any.c \ src/playlist_any.c \
src/playlist_song.c \ src/playlist_song.c \
src/playlist_state.c \ src/playlist_state.c \
@ -359,7 +356,7 @@ src_mpd_SOURCES = \
src/string_util.c \ src/string_util.c \
src/volume.c \ src/volume.c \
src/SongFilter.cxx src/SongFilter.hxx \ src/SongFilter.cxx src/SongFilter.hxx \
src/stored_playlist.c \ src/PlaylistFile.cxx src/PlaylistFile.h \
src/timer.c src/timer.c
# #

View File

@ -20,11 +20,7 @@
#include "config.h" #include "config.h"
#include "DatabasePlaylist.hxx" #include "DatabasePlaylist.hxx"
#include "DatabaseSelection.hxx" #include "DatabaseSelection.hxx"
#include "PlaylistFile.h"
extern "C" {
#include "stored_playlist.h"
}
#include "DatabaseGlue.hxx" #include "DatabaseGlue.hxx"
#include "DatabasePlugin.hxx" #include "DatabasePlugin.hxx"

View File

@ -35,7 +35,11 @@ extern "C" {
#include "volume.h" #include "volume.h"
#include "stats.h" #include "stats.h"
#include "permission.h" #include "permission.h"
#include "stored_playlist.h" }
#include "PlaylistFile.h"
extern "C" {
#include "client.h" #include "client.h"
#include "client_idle.h" #include "client_idle.h"
#include "client_file.h" #include "client_file.h"

View File

@ -22,17 +22,17 @@
#include "DatabasePlaylist.hxx" #include "DatabasePlaylist.hxx"
#include "CommandError.hxx" #include "CommandError.hxx"
#include "PlaylistPrint.hxx" #include "PlaylistPrint.hxx"
#include "PlaylistSave.hxx"
#include "PlaylistFile.h"
extern "C" { extern "C" {
#include "protocol/argparser.h" #include "protocol/argparser.h"
#include "protocol/result.h" #include "protocol/result.h"
#include "playlist.h" #include "playlist.h"
#include "playlist_save.h"
#include "playlist_queue.h" #include "playlist_queue.h"
#include "time_print.h" #include "time_print.h"
#include "ls.h" #include "ls.h"
#include "uri.h" #include "uri.h"
#include "stored_playlist.h"
#include "client_internal.h" #include "client_internal.h"
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -18,16 +18,20 @@
*/ */
#include "config.h" #include "config.h"
#include "stored_playlist.h" #include "PlaylistFile.h"
#include "playlist_save.h" #include "PlaylistSave.hxx"
#include "text_file.h"
#include "song.h" #include "song.h"
extern "C" {
#include "text_file.h"
#include "mapper.h" #include "mapper.h"
#include "path.h" #include "path.h"
#include "uri.h" #include "uri.h"
#include "database.h" #include "database.h"
#include "idle.h" #include "idle.h"
#include "conf.h" #include "conf.h"
}
#include "glib_compat.h" #include "glib_compat.h"
#include <assert.h> #include <assert.h>
@ -171,7 +175,6 @@ GPtrArray *
spl_list(GError **error_r) spl_list(GError **error_r)
{ {
const char *parent_path_fs = spl_map(error_r); const char *parent_path_fs = spl_map(error_r);
if (parent_path_fs == NULL) if (parent_path_fs == NULL)
return NULL; return NULL;
@ -201,6 +204,7 @@ spl_list_free(GPtrArray *list)
{ {
for (unsigned i = 0; i < list->len; ++i) { for (unsigned i = 0; i < list->len; ++i) {
struct stored_playlist_info *playlist = struct stored_playlist_info *playlist =
(struct stored_playlist_info *)
g_ptr_array_index(list, i); g_ptr_array_index(list, i);
g_free(playlist->name); g_free(playlist->name);
g_free(playlist); g_free(playlist);
@ -229,7 +233,7 @@ spl_save(GPtrArray *list, const char *utf8path, GError **error_r)
} }
for (unsigned i = 0; i < list->len; ++i) { for (unsigned i = 0; i < list->len; ++i) {
const char *uri = g_ptr_array_index(list, i); const char *uri = (const char *)g_ptr_array_index(list, i);
playlist_print_uri(file, uri); playlist_print_uri(file, uri);
} }
@ -287,7 +291,7 @@ void
spl_free(GPtrArray *list) spl_free(GPtrArray *list)
{ {
for (unsigned i = 0; i < list->len; ++i) { for (unsigned i = 0; i < list->len; ++i) {
char *uri = g_ptr_array_index(list, i); char *uri = (char *)g_ptr_array_index(list, i);
g_free(uri); g_free(uri);
} }
@ -299,7 +303,7 @@ spl_remove_index_internal(GPtrArray *list, unsigned idx)
{ {
assert(idx < list->len); assert(idx < list->len);
char *uri = g_ptr_array_remove_index(list, idx); char *uri = (char *)g_ptr_array_remove_index(list, idx);
assert(uri != NULL); assert(uri != NULL);
return uri; return uri;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -34,6 +34,8 @@ struct stored_playlist_info {
extern bool playlist_saveAbsolutePaths; extern bool playlist_saveAbsolutePaths;
G_BEGIN_DECLS
/** /**
* Perform some global initialization, e.g. load configuration values. * Perform some global initialization, e.g. load configuration values.
*/ */
@ -85,4 +87,6 @@ spl_append_uri(const char *file, const char *utf8file, GError **error_r);
bool bool
spl_rename(const char *utf8from, const char *utf8to, GError **error_r); spl_rename(const char *utf8from, const char *utf8to, GError **error_r);
G_END_DECLS
#endif #endif

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -18,11 +18,14 @@
*/ */
#include "config.h" #include "config.h"
#include "playlist_mapper.h" #include "PlaylistMapper.h"
#include "PlaylistFile.h"
extern "C" {
#include "playlist_list.h" #include "playlist_list.h"
#include "stored_playlist.h"
#include "mapper.h" #include "mapper.h"
#include "uri.h" #include "uri.h"
}
#include <assert.h> #include <assert.h>

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -24,6 +24,8 @@
struct input_stream; struct input_stream;
G_BEGIN_DECLS
/** /**
* Opens a playlist from an URI relative to the playlist or music * Opens a playlist from an URI relative to the playlist or music
* directory. * directory.
@ -36,4 +38,6 @@ struct playlist_provider *
playlist_mapper_open(const char *uri, GMutex *mutex, GCond *cond, playlist_mapper_open(const char *uri, GMutex *mutex, GCond *cond,
struct input_stream **is_r); struct input_stream **is_r);
G_END_DECLS
#endif #endif

View File

@ -19,6 +19,7 @@
#include "config.h" #include "config.h"
#include "PlaylistPrint.hxx" #include "PlaylistPrint.hxx"
#include "PlaylistFile.h"
#include "QueuePrint.hxx" #include "QueuePrint.hxx"
extern "C" { extern "C" {
@ -27,7 +28,6 @@ extern "C" {
#include "playlist_any.h" #include "playlist_any.h"
#include "playlist_song.h" #include "playlist_song.h"
#include "playlist.h" #include "playlist.h"
#include "stored_playlist.h"
#include "song_print.h" #include "song_print.h"
#include "song.h" #include "song.h"
#include "database.h" #include "database.h"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -18,16 +18,18 @@
*/ */
#include "config.h" #include "config.h"
#include "playlist_save.h" #include "PlaylistSave.hxx"
#include "playlist.h" #include "PlaylistFile.h"
#include "stored_playlist.h"
#include "queue.h"
#include "song.h" #include "song.h"
extern "C" {
#include "playlist.h"
#include "mapper.h" #include "mapper.h"
#include "path.h" #include "path.h"
#include "uri.h" #include "uri.h"
#include "database.h"
#include "idle.h" #include "idle.h"
}
#include "glib_compat.h" #include "glib_compat.h"
#include <glib.h> #include <glib.h>
@ -127,7 +129,7 @@ playlist_load_spl(struct playlist *playlist, struct player_control *pc,
end_index = list->len; end_index = list->len;
for (unsigned i = start_index; i < end_index; ++i) { for (unsigned i = start_index; i < end_index; ++i) {
const char *temp = g_ptr_array_index(list, i); const char *temp = (const char *)g_ptr_array_index(list, i);
if ((playlist_append_uri(playlist, pc, temp, NULL)) != PLAYLIST_RESULT_SUCCESS) { if ((playlist_append_uri(playlist, pc, temp, NULL)) != PLAYLIST_RESULT_SUCCESS) {
/* for windows compatibility, convert slashes */ /* for windows compatibility, convert slashes */
char *temp2 = g_strdup(temp); char *temp2 = g_strdup(temp);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2003-2011 The Music Player Daemon Project * Copyright (C) 2003-2012 The Music Player Daemon Project
* http://www.musicpd.org * http://www.musicpd.org
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -26,7 +26,7 @@
#include "idle.h" #include "idle.h"
#include "AllCommands.h" #include "AllCommands.h"
#include "playlist.h" #include "playlist.h"
#include "stored_playlist.h" #include "PlaylistFile.h"
#include "database.h" #include "database.h"
#include "update.h" #include "update.h"
#include "player_thread.h" #include "player_thread.h"

View File

@ -20,7 +20,7 @@
#include "config.h" #include "config.h"
#include "playlist_any.h" #include "playlist_any.h"
#include "playlist_list.h" #include "playlist_list.h"
#include "playlist_mapper.h" #include "PlaylistMapper.h"
#include "uri.h" #include "uri.h"
#include "input_stream.h" #include "input_stream.h"