summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-07-31 11:38:41 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-07-31 11:52:48 +1000
commit9d776b6a0f770cbe045a56141844d0ba393da611 (patch)
tree8d959b549514e8935b30b84edb75fde8cdace708 /util.c
parentaead36f0be638a572ec97eb5313e45086874a5e6 (diff)
Constify a few string arguments
Cuts down on compiler warning by at least 64%, what a bargain! Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util.c b/util.c
index 72ca9b9..81c0489 100644
--- a/util.c
+++ b/util.c
@@ -69,7 +69,7 @@ extern void unsetenv(const char *name);
#endif
char*
-sprintf_alloc(char *f, ...)
+sprintf_alloc(const char *f, ...)
{
char *s;
va_list args;
@@ -81,7 +81,7 @@ sprintf_alloc(char *f, ...)
#if HAVE_VASPRINTF
char*
-vsprintf_alloc(char *f, va_list args)
+vsprintf_alloc(const char *f, va_list args)
{
char *r;
int rc;
@@ -93,7 +93,7 @@ vsprintf_alloc(char *f, va_list args)
}
#else
char*
-vsprintf_alloc(char *f, va_list args)
+vsprintf_alloc(const char *f, va_list args)
{
int n, size = 12;
char *string;
@@ -127,7 +127,7 @@ vsprintf_alloc(char *f, va_list args)
/* Build a UTF-16 string from a Latin-1 string.
Result is not NUL-terminated. */
char *
-makeUTF16(char *string)
+makeUTF16(const char *string)
{
int i;
int n = strlen(string);
@@ -142,7 +142,7 @@ makeUTF16(char *string)
}
unsigned
-makeName(char *s)
+makeName(const char *s)
{
return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
}