summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 15:18:26 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-03 11:02:11 -0800
commit6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c (patch)
tree45171678d6b1fbfe936bb2586933d3e03c93500a /utils.c
parent299c9762b1dbe53f3297c54e5526aeae767d1a10 (diff)
Mark more pointers as const
Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c20
1 files changed, 10 insertions, 10 deletions
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;