Commit 38fb8a01 authored by Max Kellermann's avatar Max Kellermann

update: use GLib instead of utils.h

parent 4b6d17a6
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "mapper.h" #include "mapper.h"
#include "path.h" #include "path.h"
#include "playlist.h" #include "playlist.h"
#include "utils.h"
#include "event_pipe.h" #include "event_pipe.h"
#include "condition.h" #include "condition.h"
#include "update.h" #include "update.h"
...@@ -40,6 +39,8 @@ ...@@ -40,6 +39,8 @@
#include <unistd.h> #include <unistd.h>
#include <dirent.h> #include <dirent.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include <errno.h>
#undef G_LOG_DOMAIN #undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "update" #define G_LOG_DOMAIN "update"
...@@ -559,7 +560,7 @@ static struct directory * ...@@ -559,7 +560,7 @@ static struct directory *
addParentPathToDB(const char *utf8path) addParentPathToDB(const char *utf8path)
{ {
struct directory *directory = db_get_root(); struct directory *directory = db_get_root();
char *duplicated = xstrdup(utf8path); char *duplicated = g_strdup(utf8path);
char *slash = duplicated; char *slash = duplicated;
while ((slash = strchr(slash, '/')) != NULL) { while ((slash = strchr(slash, '/')) != NULL) {
...@@ -641,13 +642,13 @@ directory_update_init(char *path) ...@@ -641,13 +642,13 @@ directory_update_init(char *path)
if (progress != UPDATE_PROGRESS_IDLE) { if (progress != UPDATE_PROGRESS_IDLE) {
unsigned next_task_id; unsigned next_task_id;
if (update_paths_nr == ARRAY_SIZE(update_paths)) { if (update_paths_nr == G_N_ELEMENTS(update_paths)) {
if (path) if (path)
free(path); free(path);
return 0; 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; update_paths[update_paths_nr++] = path;
next_task_id = update_task_id + update_paths_nr; next_task_id = update_task_id + update_paths_nr;
......
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