summaryrefslogtreecommitdiffstats
path: root/compat/strstr.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-25 12:11:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-25 12:11:56 (GMT)
commit97d82cb4b15f18701d239609308aa41c3b89d75c (patch)
treee97d68a75b314720abdf5b68b7a885daa38097b8 /compat/strstr.c
parent56d2c7e23c1acd887d31a182324a9861cb6e68dd (diff)
downloadtcl-97d82cb4b15f18701d239609308aa41c3b89d75c.zip
tcl-97d82cb4b15f18701d239609308aa41c3b89d75c.tar.gz
tcl-97d82cb4b15f18701d239609308aa41c3b89d75c.tar.bz2
Clean-up compat functions, not using "register" any more, and fix some signatures (constify) matching nowadays standards. All backported from core-8-branch with modifications.
Diffstat (limited to 'compat/strstr.c')
-rw-r--r--compat/strstr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/compat/strstr.c b/compat/strstr.c
index 6698c9f..35386d0 100644
--- a/compat/strstr.c
+++ b/compat/strstr.c
@@ -1,4 +1,4 @@
-/*
+/*
* strstr.c --
*
* Source code for the "strstr" library routine.
@@ -36,10 +36,10 @@
char *
strstr(
- register char *string, /* String to search. */
- char *substring) /* Substring to try to find in string. */
+ const char *string, /* String to search. */
+ const char *substring) /* Substring to try to find in string. */
{
- register char *a, *b;
+ const char *a, *b;
/*
* First scan quickly through the two strings looking for a
@@ -49,7 +49,7 @@ strstr(
b = substring;
if (*b == 0) {
- return string;
+ return (char *)string;
}
for ( ; *string != 0; string += 1) {
if (*string != *b) {
@@ -58,7 +58,7 @@ strstr(
a = string;
while (1) {
if (*b == 0) {
- return string;
+ return (char *)string;
}
if (*a++ != *b++) {
break;