From 38fb8a01c1721ab9aefe8a38e8e8d220cf6cf447 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 2 Jan 2009 17:22:56 +0100 Subject: update: use GLib instead of utils.h --- src/update.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/update.c b/src/update.c index 79db6ee43..ae407f157 100644 --- a/src/update.c +++ b/src/update.c @@ -25,7 +25,6 @@ #include "mapper.h" #include "path.h" #include "playlist.h" -#include "utils.h" #include "event_pipe.h" #include "condition.h" #include "update.h" @@ -40,6 +39,8 @@ #include #include #include +#include +#include #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "update" @@ -559,7 +560,7 @@ static struct directory * addParentPathToDB(const char *utf8path) { struct directory *directory = db_get_root(); - char *duplicated = xstrdup(utf8path); + char *duplicated = g_strdup(utf8path); char *slash = duplicated; while ((slash = strchr(slash, '/')) != NULL) { @@ -641,13 +642,13 @@ directory_update_init(char *path) if (progress != UPDATE_PROGRESS_IDLE) { unsigned next_task_id; - if (update_paths_nr == ARRAY_SIZE(update_paths)) { + if (update_paths_nr == G_N_ELEMENTS(update_paths)) { if (path) free(path); return 0; } - assert(update_paths_nr < ARRAY_SIZE(update_paths)); + assert(update_paths_nr < G_N_ELEMENTS(update_paths)); update_paths[update_paths_nr++] = path; next_task_id = update_task_id + update_paths_nr; -- cgit v1.2.3