From 48f79bdb49775909ed78e1068c42fee3a678daf3 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 16 Feb 2018 15:14:57 -0500 Subject: [PATCH] core/file: Make name and subdir strings const for cache files Signed-off-by: Anna Schumaker --- core/file.c | 2 +- include/core/file.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/file.c b/core/file.c index 19c5dd2e..ec9c02e1 100644 --- a/core/file.c +++ b/core/file.c @@ -104,7 +104,7 @@ void file_init(struct file *file, const gchar *name, unsigned int min) file->f_name = name; } -void cache_file_init(struct cache_file *file, gchar *subdir, gchar *name) +void cache_file_init(struct cache_file *file, const gchar *subdir, const gchar *name) { file->cf_file = NULL; file->cf_name = name; diff --git a/include/core/file.h b/include/core/file.h index 5c3c50eb..bb78b405 100644 --- a/include/core/file.h +++ b/include/core/file.h @@ -55,14 +55,14 @@ struct file { struct cache_file { - FILE *cf_file; /* The cache file's IO stream. */ - gchar *cf_name; /* The cache file's basename. */ - gchar *cf_subdir; /* The cache file's subdirectory. */ + FILE *cf_file; /* The cache file's IO stream. */ + const gchar *cf_name; /* The cache file's basename. */ + const gchar *cf_subdir; /* The cache file's subdirectory. */ }; /* Initialize a new file object. */ void file_init(struct file *, const gchar *, unsigned int); -void cache_file_init(struct cache_file *, gchar *, gchar *); +void cache_file_init(struct cache_file *, const gchar *, const gchar *); /* * Returns the full path of the file or an empty string if filename is not set.