From 638f67c2341c5d7716db6bd17565863fe9786f10 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 27 Feb 2024 20:35:38 +0100 Subject: [PATCH] added "const" to some file function parameters --- src/libgame/misc.c | 6 +++--- src/libgame/misc.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libgame/misc.c b/src/libgame/misc.c index bd0f562b..6c9790b3 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -3098,7 +3098,7 @@ static void dumpList(ListNode *node_first) #define MAX_BUFFER_SIZE 4096 -File *openFile(char *filename, char *mode) +File *openFile(const char *filename, const char *mode) { File *file = checked_calloc(sizeof(File)); @@ -3254,7 +3254,7 @@ char *getStringFromFile(File *file, char *line, int size) return fgets(line, size, file->file); } -int copyFile(char *filename_from, char *filename_to) +int copyFile(const char *filename_from, const char *filename_to) { File *file_from, *file_to; @@ -3284,7 +3284,7 @@ int copyFile(char *filename_from, char *filename_to) return 0; } -boolean touchFile(char *filename) +boolean touchFile(const char *filename) { FILE *file; diff --git a/src/libgame/misc.h b/src/libgame/misc.h index ca983a0a..8082ee36 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -278,7 +278,7 @@ void deleteNodeFromList(ListNode **, char *, void (*function)(void *)); ListNode *getNodeFromKey(ListNode *, char *); int getNumNodes(ListNode *); -File *openFile(char *, char *); +File *openFile(const char *, const char *); int closeFile(File *); int checkEndOfFile(File *); size_t readFile(File *, void *, size_t, size_t); @@ -286,8 +286,8 @@ size_t writeFile(File *, void *, size_t, size_t); int seekFile(File *, long, int); int getByteFromFile(File *); char *getStringFromFile(File *, char *, int); -int copyFile(char *, char *); -boolean touchFile(char *); +int copyFile(const char *, const char *); +boolean touchFile(const char *); Directory *openDirectory(char *); int closeDirectory(Directory *); -- 2.34.1