From 6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 11 Dec 2022 15:18:26 -0800 Subject: Mark more pointers as const Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith --- utils.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 6dd7e78..deb96ea 100644 --- a/utils.c +++ b/utils.c @@ -64,7 +64,7 @@ int uDebugIndentLevel = 0; static const int uDebugIndentSize = 4; Boolean -uSetDebugFile(char *name) +uSetDebugFile(const char *name) { if ((uDebugFile != NULL) && (uDebugFile != stderr)) { @@ -84,7 +84,7 @@ uSetDebugFile(char *name) } void -uDebug(char *s, ...) +uDebug(const char *s, ...) { va_list args; @@ -103,12 +103,12 @@ uDebug(char *s, ...) static FILE *errorFile = NULL; static int outCount = 0; -static char *preMsg = NULL; -static char *postMsg = NULL; -static char *prefix = NULL; +static const char *preMsg = NULL; +static const char *postMsg = NULL; +static const char *prefix = NULL; Boolean -uSetErrorFile(char *name) +uSetErrorFile(const char *name) { if ((errorFile != NULL) && (errorFile != stderr)) { @@ -234,7 +234,7 @@ uInternalError(const char *s, ...) } void -uSetPreErrorMessage(char *msg) +uSetPreErrorMessage(const char *msg) { outCount = 0; preMsg = msg; @@ -242,14 +242,14 @@ uSetPreErrorMessage(char *msg) } void -uSetPostErrorMessage(char *msg) +uSetPostErrorMessage(const char *msg) { postMsg = msg; return; } void -uSetErrorPrefix(char *pre) +uSetErrorPrefix(const char *pre) { prefix = pre; return; @@ -309,7 +309,7 @@ uStrCaseCmp(const char *str1, const char *str2) } int -uStrCasePrefix(const char *my_prefix, char *str) +uStrCasePrefix(const char *my_prefix, const char *str) { char c1; char c2; -- cgit v1.2.1