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 <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2018-02-16 09:56:53 -05:00
parent d96e8ca1ca
commit a2854ef31e
2 changed files with 4 additions and 9 deletions

View File

@ -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 *);

View File

@ -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(&copy, "dir", "copy.txt");
basepath = g_strjoin("/", g_get_user_cache_dir(), OCARINA_NAME, NULL);
filepath = g_strjoin("/", basepath, "dir", "file.txt", NULL);