Commit 906ca3e2 authored by Max Kellermann's avatar Max Kellermann

dbUtils: use GLib instead of utils.h

parent 6ce06a48
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "directory.h" #include "directory.h"
#include "database.h" #include "database.h"
#include "client.h" #include "client.h"
#include "utils.h"
#include "playlist.h" #include "playlist.h"
#include "song.h" #include "song.h"
#include "song_print.h" #include "song_print.h"
...@@ -32,6 +31,8 @@ ...@@ -32,6 +31,8 @@
#include <glib.h> #include <glib.h>
#include <stdlib.h>
typedef struct _ListCommandItem { typedef struct _ListCommandItem {
int8_t tagType; int8_t tagType;
int numConditionals; int numConditionals;
...@@ -100,7 +101,7 @@ int searchForSongsIn(struct client *client, const char *name, ...@@ -100,7 +101,7 @@ int searchForSongsIn(struct client *client, const char *name,
int ret; int ret;
int i; int i;
char **originalNeedles = xmalloc(numItems * sizeof(char *)); char **originalNeedles = g_new(char *, numItems);
struct search_data data; struct search_data data;
for (i = 0; i < numItems; i++) { for (i = 0; i < numItems; i++) {
...@@ -275,7 +276,7 @@ unsigned long sumSongTimesIn(const char *name) ...@@ -275,7 +276,7 @@ unsigned long sumSongTimesIn(const char *name)
static ListCommandItem *newListCommandItem(int tagType, int numConditionals, static ListCommandItem *newListCommandItem(int tagType, int numConditionals,
LocateTagItem * conditionals) LocateTagItem * conditionals)
{ {
ListCommandItem *item = xmalloc(sizeof(ListCommandItem)); ListCommandItem *item = g_new(ListCommandItem, 1);
item->tagType = tagType; item->tagType = tagType;
item->numConditionals = numConditionals; item->numConditionals = numConditionals;
......
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