Commit 5ed9f02c authored by Max Kellermann's avatar Max Kellermann

TagPool, ...: include cleanup

parent 378ebad1
......@@ -32,8 +32,6 @@
#include <string>
#include <list>
#include <glib.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "client"
......@@ -130,16 +128,6 @@ extern size_t client_max_command_list_size;
extern size_t client_max_output_buffer_size;
enum command_return
client_read(Client *client);
enum command_return
client_process_line(Client *client, char *line);
void
client_write_output(Client *client);
gboolean
client_in_event(GIOChannel *source, GIOCondition condition,
gpointer data);
#endif
......@@ -22,8 +22,7 @@
#include "command.h"
#include "playlist_error.h"
#include <glib.h>
#include "gerror.h"
class Client;
......
......@@ -21,11 +21,9 @@
#define MPD_DATABASE_SIMPLE_HXX
#include "gcc.h"
#include <glib.h>
#include "gerror.h"
#include <sys/time.h>
#include <stdbool.h>
struct config_param;
struct Directory;
......
......@@ -25,8 +25,8 @@
#include "gcc.h"
#include "DatabaseVisitor.hxx"
#include "PlaylistVector.hxx"
#include "gerror.h"
#include <glib.h>
#include <stdbool.h>
#include <sys/types.h>
......
......@@ -20,7 +20,7 @@
#ifndef MPD_DIRECTORY_SAVE_HXX
#define MPD_DIRECTORY_SAVE_HXX
#include <glib.h>
#include "gerror.h"
#include <stdio.h>
......
......@@ -24,8 +24,6 @@
#include "gerror.h"
#include "gcc.h"
#include <glib.h>
typedef void (*mpd_inotify_callback_t)(int wd, unsigned mask,
const char *name, void *ctx);
......
......@@ -22,8 +22,6 @@
#include "replay_gain_info.h"
#include <glib.h>
#include <stddef.h>
struct audio_output;
......@@ -32,12 +30,6 @@ struct config_param;
struct music_pipe;
struct player_control;
static inline GQuark
audio_output_quark(void)
{
return g_quark_from_static_string("audio_output");
}
void
audio_output_set_replay_gain_mode(struct audio_output *ao,
enum replay_gain_mode mode);
......
......@@ -20,6 +20,7 @@
#include "config.h"
#include "OutputControl.hxx"
#include "OutputList.hxx"
#include "OutputError.hxx"
#include "FilterConfig.hxx"
#include "output_api.h"
#include "AudioParser.hxx"
......@@ -65,7 +66,7 @@ audio_output_detect(GError **error)
return plugin;
}
g_set_error(error, audio_output_quark(), 0,
g_set_error(error, output_quark(), 0,
"Unable to detect an audio device");
return NULL;
}
......@@ -148,7 +149,7 @@ ao_base_init(struct audio_output *ao,
ao->name = config_get_block_string(param, AUDIO_OUTPUT_NAME,
NULL);
if (ao->name == NULL) {
g_set_error(error_r, audio_output_quark(), 0,
g_set_error(error_r, output_quark(), 0,
"Missing \"name\" configuration");
return false;
}
......@@ -274,7 +275,7 @@ audio_output_setup(struct audio_output *ao, const struct config_param *param,
g_warning("No such mixer for output '%s'", ao->name);
} else if (strcmp(replay_gain_handler, "software") != 0 &&
ao->replay_gain_filter != NULL) {
g_set_error(error_r, audio_output_quark(), 0,
g_set_error(error_r, output_quark(), 0,
"Invalid \"replay_gain_handler\" value");
return false;
}
......@@ -301,14 +302,14 @@ audio_output_new(const struct config_param *param,
p = config_get_block_string(param, AUDIO_OUTPUT_TYPE, NULL);
if (p == NULL) {
g_set_error(error_r, audio_output_quark(), 0,
g_set_error(error_r, output_quark(), 0,
"Missing \"type\" configuration");
return nullptr;
}
plugin = audio_output_plugin_get(p);
if (plugin == NULL) {
g_set_error(error_r, audio_output_quark(), 0,
g_set_error(error_r, output_quark(), 0,
"No such audio output plugin: %s", p);
return nullptr;
}
......
......@@ -21,9 +21,9 @@
#define MPD_PLAYLIST_DATABASE_HXX
#include "check.h"
#include "gerror.h"
#include <stdio.h>
#include <glib.h>
#define PLAYLIST_META_BEGIN "playlist_begin: "
......
......@@ -20,12 +20,11 @@
#ifndef MPD_PLAYLIST_FILE_HXX
#define MPD_PLAYLIST_FILE_HXX
#include "gerror.h"
#include <vector>
#include <string>
#include <glib.h>
#include <time.h>
struct song;
struct PlaylistInfo;
class PlaylistVector;
......
......@@ -20,7 +20,8 @@
#ifndef MPD_PLAYLIST_PRINT_HXX
#define MPD_PLAYLIST_PRINT_HXX
#include <glib.h>
#include "gerror.h"
#include <stdint.h>
struct playlist;
......
......@@ -23,10 +23,6 @@
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include <glib.h>
#include <stdbool.h>
struct playlist_provider;
struct input_stream;
......
......@@ -25,7 +25,6 @@
#ifndef MPD_PLAYLIST_STATE_HXX
#define MPD_PLAYLIST_STATE_HXX
#include <glib.h>
#include <stdio.h>
struct playlist;
......
......@@ -25,7 +25,6 @@
#ifndef MPD_QUEUE_SAVE_HXX
#define MPD_QUEUE_SAVE_HXX
#include <glib.h>
#include <stdio.h>
struct queue;
......
......@@ -30,6 +30,8 @@ extern "C" {
#include "uri.h"
}
#include <glib.h>
void
song_print_uri(Client *client, struct song *song)
{
......
......@@ -20,7 +20,7 @@
#ifndef MPD_SONG_SAVE_HXX
#define MPD_SONG_SAVE_HXX
#include <glib.h>
#include "gerror.h"
#include <stdio.h>
......
......@@ -114,12 +114,12 @@ struct sticker_song_find_data {
size_t base_uri_length;
void (*func)(struct song *song, const char *value,
gpointer user_data);
gpointer user_data;
void *user_data);
void *user_data;
};
static void
sticker_song_find_cb(const char *uri, const char *value, gpointer user_data)
sticker_song_find_cb(const char *uri, const char *value, void *user_data)
{
struct sticker_song_find_data *data =
(struct sticker_song_find_data *)user_data;
......@@ -136,8 +136,8 @@ sticker_song_find_cb(const char *uri, const char *value, gpointer user_data)
bool
sticker_song_find(Directory *directory, const char *name,
void (*func)(struct song *song, const char *value,
gpointer user_data),
gpointer user_data)
void *user_data),
void *user_data)
{
struct sticker_song_find_data data;
data.directory = directory;
......
......@@ -20,7 +20,7 @@
#ifndef MPD_SONG_STICKER_HXX
#define MPD_SONG_STICKER_HXX
#include <glib.h>
#include "gerror.h"
struct song;
struct Directory;
......@@ -77,7 +77,7 @@ sticker_song_get(const struct song *song);
bool
sticker_song_find(Directory *directory, const char *name,
void (*func)(struct song *song, const char *value,
gpointer user_data),
gpointer user_data);
void *user_data),
void *user_data);
#endif
......@@ -20,6 +20,8 @@
#include "config.h"
#include "TagPool.hxx"
#include <glib.h>
#include <assert.h>
Mutex tag_pool_lock;
......
......@@ -23,8 +23,6 @@
#include "tag.h"
#include "thread/Mutex.hxx"
#include <glib.h>
extern Mutex tag_pool_lock;
struct tag_item;
......
......@@ -37,8 +37,6 @@ update_archive_file(Directory *directory,
#else
#include <glib.h>
static inline bool
update_archive_file(gcc_unused Directory *directory,
gcc_unused const char *name,
......
......@@ -23,8 +23,6 @@
#include "event/BufferedSocket.hxx"
#include "gcc.h"
#include <glib.h>
#include <list>
#include <stddef.h>
......
......@@ -30,8 +30,6 @@
#include "thread/Mutex.hxx"
#include "event/ServerSocket.hxx"
#include <glib.h>
#include <forward_list>
struct config_param;
......
......@@ -20,7 +20,7 @@
#ifndef MPD_PCM_UTILS_H
#define MPD_PCM_UTILS_H
#include <glib.h>
#include "gcc.h"
#include <stdint.h>
......@@ -42,9 +42,9 @@ pcm_end_pointer(const void *p, size_t size)
static inline int32_t
pcm_range(int32_t sample, unsigned bits)
{
if (G_UNLIKELY(sample < (-1 << (bits - 1))))
if (gcc_unlikely(sample < (-1 << (bits - 1))))
return -1 << (bits - 1);
if (G_UNLIKELY(sample >= (1 << (bits - 1))))
if (gcc_unlikely(sample >= (1 << (bits - 1))))
return (1 << (bits - 1)) - 1;
return sample;
}
......@@ -56,37 +56,37 @@ pcm_range(int32_t sample, unsigned bits)
static inline int64_t
pcm_range_64(int64_t sample, unsigned bits)
{
if (G_UNLIKELY(sample < ((int64_t)-1 << (bits - 1))))
if (gcc_unlikely(sample < ((int64_t)-1 << (bits - 1))))
return (int64_t)-1 << (bits - 1);
if (G_UNLIKELY(sample >= ((int64_t)1 << (bits - 1))))
if (gcc_unlikely(sample >= ((int64_t)1 << (bits - 1))))
return ((int64_t)1 << (bits - 1)) - 1;
return sample;
}
G_GNUC_CONST
gcc_const
static inline int16_t
pcm_clamp_16(int x)
{
static const int32_t MIN_VALUE = G_MININT16;
static const int32_t MAX_VALUE = G_MAXINT16;
static const int32_t MIN_VALUE = -(1 << 15);
static const int32_t MAX_VALUE = (1 << 15) - 1;
if (G_UNLIKELY(x < MIN_VALUE))
if (gcc_unlikely(x < MIN_VALUE))
return MIN_VALUE;
if (G_UNLIKELY(x > MAX_VALUE))
if (gcc_unlikely(x > MAX_VALUE))
return MAX_VALUE;
return x;
}
G_GNUC_CONST
gcc_const
static inline int32_t
pcm_clamp_24(int x)
{
static const int32_t MIN_VALUE = -(1 << 23);
static const int32_t MAX_VALUE = (1 << 23) - 1;
if (G_UNLIKELY(x < MIN_VALUE))
if (gcc_unlikely(x < MIN_VALUE))
return MIN_VALUE;
if (G_UNLIKELY(x > MAX_VALUE))
if (gcc_unlikely(x > MAX_VALUE))
return MAX_VALUE;
return x;
}
......
......@@ -21,6 +21,7 @@
#define MPD_TAG_TABLE_H
#include "tag.h"
#include "gcc.h"
#include <glib.h>
......@@ -35,7 +36,7 @@ struct tag_table {
* Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found
* in the table.
*/
G_GNUC_PURE
gcc_pure
static inline enum tag_type
tag_table_lookup(const struct tag_table *table, const char *name)
{
......@@ -51,7 +52,7 @@ tag_table_lookup(const struct tag_table *table, const char *name)
* Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found
* in the table.
*/
G_GNUC_PURE
gcc_pure
static inline enum tag_type
tag_table_lookup_i(const struct tag_table *table, const char *name)
{
......
......@@ -3,6 +3,8 @@
#include "song.h"
#include "Directory.hxx"
#include <glib.h>
Directory detached_root;
Directory::Directory() {}
......@@ -15,11 +17,11 @@ song_dup_detached(const struct song *src)
}
void
song_free(G_GNUC_UNUSED struct song *song)
song_free(gcc_unused struct song *song)
{
}
G_GNUC_UNUSED
gcc_unused
static void
dump_order(const struct queue *queue)
{
......@@ -46,7 +48,7 @@ check_descending_priority(const struct queue *queue,
}
int
main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
main(gcc_unused int argc, gcc_unused char **argv)
{
static struct song songs[16];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment