diff options
author | Max Kellermann <max@duempel.org> | 2013-07-28 20:31:27 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-07-29 07:39:36 +0200 |
commit | 96b763067e82d4b3a1b08b3a3c0ccca2114c35f3 (patch) | |
tree | 68eb90ec47a20256fbb243f9fb6650e790fffd38 /src/ape.c | |
parent | dd5ba062cc03d0de7fa2b46f16817f8c7c2b112e (diff) | |
download | mpd-96b763067e82d4b3a1b08b3a3c0ccca2114c35f3.tar.gz mpd-96b763067e82d4b3a1b08b3a3c0ccca2114c35f3.tar.xz mpd-96b763067e82d4b3a1b08b3a3c0ccca2114c35f3.zip |
ape: convert to C++
Diffstat (limited to '')
-rw-r--r-- | src/ApeLoader.cxx (renamed from src/ape.c) | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ape.c b/src/ApeLoader.cxx index 6257fe6b3..dfbdb4ef3 100644 --- a/src/ape.c +++ b/src/ApeLoader.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ */ #include "config.h" -#include "ape.h" +#include "ApeLoader.hxx" #include <glib.h> @@ -37,7 +37,7 @@ struct ape_footer { }; static bool -ape_scan_internal(FILE *fp, tag_ape_callback_t callback, void *ctx) +ape_scan_internal(FILE *fp, ApeTagCallback callback) { /* determine if file has an apeV2 tag */ struct ape_footer footer; @@ -59,7 +59,7 @@ ape_scan_internal(FILE *fp, tag_ape_callback_t callback, void *ctx) remaining -= sizeof(footer); assert(remaining > 10); - char *buffer = g_malloc(remaining); + char *buffer = (char *)g_malloc(remaining); if (fread(buffer, 1, remaining, fp) != remaining) { g_free(buffer); return false; @@ -89,7 +89,7 @@ ape_scan_internal(FILE *fp, tag_ape_callback_t callback, void *ctx) if (remaining < size) break; - if (!callback(flags, key, p, size, ctx)) + if (!callback(flags, key, p, size)) break; p += size; @@ -101,15 +101,15 @@ ape_scan_internal(FILE *fp, tag_ape_callback_t callback, void *ctx) } bool -tag_ape_scan(const char *path_fs, tag_ape_callback_t callback, void *ctx) +tag_ape_scan(const char *path_fs, ApeTagCallback callback) { FILE *fp; fp = fopen(path_fs, "rb"); - if (fp == NULL) + if (fp == nullptr) return false; - bool success = ape_scan_internal(fp, callback, ctx); + bool success = ape_scan_internal(fp, callback); fclose(fp); return success; } |