From 3de1e669b2a367b1c13bbce0741dcfddb7f52eda Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 31 May 1990 18:33:38 +0000 Subject: [PATCH] optimized a bit --- lang/cem/libcc.ansi/string/memcpy.c | 2 +- lang/cem/libcc.ansi/string/strcat.c | 4 ++-- lang/cem/libcc.ansi/string/strcpy.c | 4 ++-- lang/cem/libcc.ansi/string/strlen.c | 4 ++-- lang/cem/libcc.ansi/string/strncat.c | 4 ++-- lang/cem/libcc.ansi/string/strncpy.c | 4 ++-- lang/cem/libcc.ansi/string/strxfrm.c | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lang/cem/libcc.ansi/string/memcpy.c b/lang/cem/libcc.ansi/string/memcpy.c index 11b27b0c7..cb632daaf 100644 --- a/lang/cem/libcc.ansi/string/memcpy.c +++ b/lang/cem/libcc.ansi/string/memcpy.c @@ -7,7 +7,7 @@ #include void * -memcpy(register void *s1, register const void *s2, register size_t n) +memcpy(void *s1, const void *s2, register size_t n) { register char *p1 = s1; register const char *p2 = s2; diff --git a/lang/cem/libcc.ansi/string/strcat.c b/lang/cem/libcc.ansi/string/strcat.c index 30ae22463..133bd3189 100644 --- a/lang/cem/libcc.ansi/string/strcat.c +++ b/lang/cem/libcc.ansi/string/strcat.c @@ -7,9 +7,9 @@ #include char * -strcat(register char *s1, register const char *s2) +strcat(char *ret, register const char *s2) { - char *ret = s1; + register char *s1 = ret; while (*s1++ != '\0') /* EMPTY */ ; diff --git a/lang/cem/libcc.ansi/string/strcpy.c b/lang/cem/libcc.ansi/string/strcpy.c index 1f0607367..914ceaf6d 100644 --- a/lang/cem/libcc.ansi/string/strcpy.c +++ b/lang/cem/libcc.ansi/string/strcpy.c @@ -7,9 +7,9 @@ #include char * -strcpy(register char *s1, register const char *s2) +strcpy(char *ret, register const char *s2) { - char *ret = s1; + register char *s1 = ret; while (*s1++ = *s2++) /* EMPTY */ ; diff --git a/lang/cem/libcc.ansi/string/strlen.c b/lang/cem/libcc.ansi/string/strlen.c index ca8f7d838..78be8c1a5 100644 --- a/lang/cem/libcc.ansi/string/strlen.c +++ b/lang/cem/libcc.ansi/string/strlen.c @@ -7,9 +7,9 @@ #include size_t -strlen(register const char *s) +strlen(const char *org) { - const char *org = s; + register const char *s = org; while (*s++) /* EMPTY */ ; diff --git a/lang/cem/libcc.ansi/string/strncat.c b/lang/cem/libcc.ansi/string/strncat.c index 250282628..706b8d419 100644 --- a/lang/cem/libcc.ansi/string/strncat.c +++ b/lang/cem/libcc.ansi/string/strncat.c @@ -7,9 +7,9 @@ #include char * -strncat(register char *s1, register const char *s2, size_t n) +strncat(char *ret, register const char *s2, size_t n) { - char *ret = s1; + register char *s1 = ret; if (n <= 0) return s1; diff --git a/lang/cem/libcc.ansi/string/strncpy.c b/lang/cem/libcc.ansi/string/strncpy.c index 18a7e0897..907da62e5 100644 --- a/lang/cem/libcc.ansi/string/strncpy.c +++ b/lang/cem/libcc.ansi/string/strncpy.c @@ -7,9 +7,9 @@ #include char * -strncpy(register char *s1, register const char *s2, size_t n) +strncpy(char *ret, register const char *s2, size_t n) { - char *ret = s1; + register char *s1 = ret; while (*s2 && n > 0) { n--; diff --git a/lang/cem/libcc.ansi/string/strxfrm.c b/lang/cem/libcc.ansi/string/strxfrm.c index 92e0c76c0..6b3daf5c6 100644 --- a/lang/cem/libcc.ansi/string/strxfrm.c +++ b/lang/cem/libcc.ansi/string/strxfrm.c @@ -7,9 +7,9 @@ #include size_t -strxfrm(register char *s1, register const char *s2, register size_t n) +strxfrm(register char *s1, register const char *save, register size_t n) { - const char *save = s2; + register const char *s2 = save; while (*s2) { if (n > 1) {