misc/string.c, sprinkle some const'ness

This commit is contained in:
rlar 2015-12-22 15:31:54 +01:00
parent 9473ec575f
commit d37f18d777
3 changed files with 10 additions and 10 deletions

View File

@ -846,7 +846,7 @@ fileInit(runDesc *run)
static int
guess_type(char *name)
guess_type(const char *name)
{
int type;

View File

@ -12,14 +12,14 @@
#include <stdarg.h>
int prefix(register char *p, register char *s);
int prefix(const char *p, const char *s);
char * copy(const char *str);
char * copy_substring(const char *str, const char *end);
int substring(register char *sub, register char *str);
int substring(const char *sub, const char *str);
void appendc(char *s, char c);
int scannum(char *str);
int cieq(register char *p, register char *s);
int ciprefix(register char *p, register char *s);
int cieq(const char *p, const char *s);
int ciprefix(const char *p, const char *s);
void strtolower(char *str);
void strtoupper(char *str);
char * stripWhiteSpacesInsideParens(char *str);

View File

@ -14,7 +14,7 @@ Copyright 1990 Regents of the University of California. All rights reserved.
int
prefix(register char *p, register char *s)
prefix(const char *p, const char *s)
{
while (*p && (*p == *s))
p++, s++;
@ -106,9 +106,9 @@ tprintf(const char *fmt, ...)
/* Like strstr( ) XXX */
int
substring(register char *sub, register char *str)
substring(const char *sub, const char *str)
{
char *s, *t;
const char *s, *t;
while (*str) {
if (*str == *sub) {
@ -157,7 +157,7 @@ scannum(char *str)
/* Like strcasecmp( ) XXX */
int
cieq(register char *p, register char *s)
cieq(const char *p, const char *s)
{
while (*p) {
if ((isupper(*p) ? tolower(*p) : *p) !=
@ -172,7 +172,7 @@ cieq(register char *p, register char *s)
/* Case insensitive prefix. */
int
ciprefix(register char *p, register char *s)
ciprefix(const char *p, const char *s)
{
while (*p) {
if ((isupper(*p) ? tolower(*p) : *p) !=