optimized a bit
This commit is contained in:
parent
e2b59f6517
commit
3de1e669b2
|
@ -7,7 +7,7 @@
|
|||
#include <string.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <string.h>
|
||||
|
||||
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 */ ;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <string.h>
|
||||
|
||||
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 */ ;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <string.h>
|
||||
|
||||
size_t
|
||||
strlen(register const char *s)
|
||||
strlen(const char *org)
|
||||
{
|
||||
const char *org = s;
|
||||
register const char *s = org;
|
||||
|
||||
while (*s++)
|
||||
/* EMPTY */ ;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <string.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <string.h>
|
||||
|
||||
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--;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include <string.h>
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue