From 2189796b96f94e93423a4f9931c7199d7da6dfa7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Jan 2009 14:51:34 +0100 Subject: null, fifo: use GLib instead of utils.h --- src/output/fifo_plugin.c | 12 +++++++----- src/output/null_plugin.c | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/output/fifo_plugin.c b/src/output/fifo_plugin.c index b15f5288e..efadc8ff6 100644 --- a/src/output/fifo_plugin.c +++ b/src/output/fifo_plugin.c @@ -25,6 +25,9 @@ #include #include #include +#include +#include +#include #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "fifo" @@ -43,26 +46,25 @@ static FifoData *newFifoData(void) { FifoData *ret; - ret = xmalloc(sizeof(FifoData)); + ret = g_new(FifoData, 1); ret->path = NULL; ret->input = -1; ret->output = -1; ret->created = 0; ret->timer = NULL; - + return ret; } static void freeFifoData(FifoData *fd) { - if (fd->path) - free(fd->path); + g_free(fd->path); if (fd->timer) timer_free(fd->timer); - free(fd); + g_free(fd); } static void removeFifo(FifoData *fd) diff --git a/src/output/null_plugin.c b/src/output/null_plugin.c index dd85e6389..d821d6aee 100644 --- a/src/output/null_plugin.c +++ b/src/output/null_plugin.c @@ -18,7 +18,6 @@ #include "../output_api.h" #include "../timer.h" -#include "../utils.h" #include @@ -31,7 +30,7 @@ null_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput, G_GNUC_UNUSED const struct audio_format *audio_format, G_GNUC_UNUSED ConfigParam *param) { - struct null_data *nd = xmalloc(sizeof(*nd)); + struct null_data *nd = g_new(struct null_data, 1); nd->timer = NULL; return nd; } -- cgit v1.2.3