From bdaff7ee88189505e6b66699571034aed015a3bd Mon Sep 17 00:00:00 2001 From: solar Date: Tue, 11 Jan 2005 07:15:12 +0000 Subject: [PATCH] Test-compile fixes. --- _PDCLIB_int.h | 7 +++---- functions/string/strlen.c | 2 +- functions/string/strrchr.c | 6 +++--- functions/string/strtok.c | 2 +- string.h | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/_PDCLIB_int.h b/_PDCLIB_int.h index bd0a479..24accb0 100644 --- a/_PDCLIB_int.h +++ b/_PDCLIB_int.h @@ -224,17 +224,17 @@ typedef unsigned _PDCLIB_fast64 _PDCLIB_uint_fast64_t; /* Various typedefs and limits */ /* -------------------------------------------------------------------------- */ -typedef _PDCLIB_ptrdiff _PDCLIB_ptrdiff_t +typedef _PDCLIB_ptrdiff _PDCLIB_ptrdiff_t; #define _PDCLIB_PTRDIFF_MIN concat( concat( _PDCLIB_, _PDCLIB_PTRDIFF ), _MIN ) #define _PDCLIB_PTRDIFF_MAX concat( concat( _PDCLIB_, _PDCLIB_PTRDIFF ), _MAX ) #define _PDCLIB_SIG_ATOMIC_MIN concat( concat( _PDCLIB_, _PDCLIB_SIG_ATOMIC ), _MIN ) #define _PDCLIB_SIG_ATOMIC_MAX concat( concat( _PDCLIB_, _PDCLIB_SIG_ATOMIC ), _MAX ) -typedef _PDCLIB_size _PDCLIB_size_t +typedef _PDCLIB_size _PDCLIB_size_t; #define _PDCLIB_SIZE_MAX concat( concat( _PDCLIB_, _PDCLIB_SIZE ), _MAX ) -typedef _PDCLIB_wchar _PDCLIB_wchar_t +typedef _PDCLIB_wchar _PDCLIB_wchar_t; #define _PDCLIB_WCHAR_MIN concat( concat( _PDCLIB_, _PDCLIB_WCHAR ), _MIN ) #define _PDCLIB_WCHAR_MAX concat( concat( _PDCLIB_, _PDCLIB_WCHAR ), _MAX ) @@ -251,4 +251,3 @@ typedef unsigned _PDCLIB_intmax _PDCLIB_uintmax_t; #define _PDCLIB_UINTMAX_MAX concat( concat( _PDCLIB_U, _PDCLIB_INTMAX ), _MAX ) #define _PDCLIB_INTMAX_C( value ) concat( value, _PDCLIB_INTMAX_LITERAL ) #define _PDCLIB_UINTMAX_C( value ) concat( value, concat( u, _PDCLIB_INTMAX_LITERAL ) ) - diff --git a/functions/string/strlen.c b/functions/string/strlen.c index 24101b6..c862805 100644 --- a/functions/string/strlen.c +++ b/functions/string/strlen.c @@ -13,7 +13,7 @@ size_t strlen( const char * s ) { size_t rc = 0; - while ( src[rc] ) + while ( s[rc] ) { ++rc; } diff --git a/functions/string/strrchr.c b/functions/string/strrchr.c index b29d0a6..77b633f 100644 --- a/functions/string/strrchr.c +++ b/functions/string/strrchr.c @@ -13,12 +13,12 @@ char * strrchr( const char * s, int c ) { size_t i = 0; - while ( p[i++] ); + while ( s[i++] ); do { - if ( p[--i] == (char) c ) + if ( s[--i] == (char) c ) { - return (char *) p + i; + return (char *) s + i; } } while ( i ); return NULL; diff --git a/functions/string/strtok.c b/functions/string/strtok.c index 0a21a67..4d371af 100644 --- a/functions/string/strtok.c +++ b/functions/string/strtok.c @@ -25,7 +25,7 @@ char * strtok( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2 ) { /* old string continued */ if ( tmp == NULL ) - } + { /* No old string, no new string, nothing to do */ return NULL; } diff --git a/string.h b/string.h index 5aca818..08fcb96 100755 --- a/string.h +++ b/string.h @@ -153,13 +153,13 @@ char * strrchr( const char * s, int c ); consists only of characters from the character array s2. Returns the length of that substring. */ -size_t strspn( const char * s1, const char s2 ); +size_t strspn( const char * s1, const char * s2 ); /* Search the character array s1 for the substring in character array s2. Returns a pointer to that sbstring, or NULL. If s2 is of length zero, returns s1. */ -char * strstr( const char * s1, const char s2 ); +char * strstr( const char * s1, const char * s2 ); /* In a series of subsequent calls, parse a C string into tokens. On the first call to strtok(), the first argument is a pointer to the to-be- -- 2.40.0