From a2854ef31e281c35f32b775038460f71d0e07055 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 16 Feb 2018 09:56:53 -0500 Subject: [PATCH] core/file: Remove the CACHE_FILE_INIT macro It was only used by the testing code, so it's not seeing any use in the real world. Signed-off-by: Anna Schumaker --- include/core/file.h | 7 ------- tests/core/file.c | 6 ++++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/core/file.h b/include/core/file.h index 2aa61051..5c3c50eb 100644 --- a/include/core/file.h +++ b/include/core/file.h @@ -60,13 +60,6 @@ struct cache_file { gchar *cf_subdir; /* The cache file's subdirectory. */ }; -#define CACHE_FILE_INIT(cfsubdir, cfname) \ - { \ - .cf_file = NULL, \ - .cf_subdir = cfsubdir, \ - .cf_name = cfname, \ - } - /* Initialize a new file object. */ void file_init(struct file *, const gchar *, unsigned int); void cache_file_init(struct cache_file *, gchar *, gchar *); diff --git a/tests/core/file.c b/tests/core/file.c index 7f653096..e9b13080 100644 --- a/tests/core/file.c +++ b/tests/core/file.c @@ -171,9 +171,11 @@ static void test_versioning_new() static void test_cache() { - struct cache_file file = CACHE_FILE_INIT("dir", "file.txt"); - struct cache_file copy = CACHE_FILE_INIT("dir", "copy.txt"); gchar *basepath, *filepath, *writepath; + struct cache_file file, copy; + + cache_file_init(&file, "dir", "file.txt"); + cache_file_init(©, "dir", "copy.txt"); basepath = g_strjoin("/", g_get_user_cache_dir(), OCARINA_NAME, NULL); filepath = g_strjoin("/", basepath, "dir", "file.txt", NULL);