]> pd.if.org Git - pdclib/commitdiff
Moving branches closer together.
authorMartin Baute <solar@rootdirectory.de>
Fri, 8 Apr 2016 12:04:03 +0000 (14:04 +0200)
committerMartin Baute <solar@rootdirectory.de>
Fri, 8 Apr 2016 12:04:03 +0000 (14:04 +0200)
functions/_PDCLIB/Readme.txt
functions/_PDCLIB/_PDCLIB_atomax.c [moved from functions/_PDCLIB/atomax.c with 100% similarity]
functions/_PDCLIB/_PDCLIB_closeall.c [moved from functions/_PDCLIB/closeall.c with 100% similarity]
functions/_PDCLIB/_PDCLIB_digits.c [moved from functions/_PDCLIB/digits.c with 100% similarity]
functions/_PDCLIB/_PDCLIB_seed.c [moved from functions/_PDCLIB/seed.c with 100% similarity]
functions/_PDCLIB/_PDCLIB_strtox_main.c [moved from functions/_PDCLIB/strtox_main.c with 100% similarity]
functions/_PDCLIB/_PDCLIB_strtox_prelim.c [moved from functions/_PDCLIB/strtox_prelim.c with 100% similarity]
functions/string/strcoll.c
functions/string/strxfrm.c

index 5010942297d752bf48ef37da964ffb5a08d1360a..13ad05cf185a4d69dc602102c37d5b8e8dc149f9 100644 (file)
@@ -3,8 +3,8 @@ This directory holds various "internals" of PDCLib:
 - definitions of helper functions not specified by the standard (hidden in the
   _PDCLIB_* namespace);
 
 - definitions of helper functions not specified by the standard (hidden in the
   _PDCLIB_* namespace);
 
-- definitions of data objects, both internal (like digits.c) and specified by
-  the standard (errno.c);
+- definitions of data objects, both internal (like _PDCLIB_digits) and specified by
+  the standard (_PDCLIB_errno);
 
 - test drivers for functionality that does not have its own implementation
 
 - test drivers for functionality that does not have its own implementation
-  file to put the test driver in.
+  file to put the test driver in (stdarg).
index 6b012b7a29a451a5542032d16979ecb652d79baf..a139adb4728171c50fecc6d0941d3820d1eaa173 100644 (file)
 
 int strcoll( const char * s1, const char * s2 )
 {
 
 int strcoll( const char * s1, const char * s2 )
 {
-    while ( ( *s1 ) && ( _PDCLIB_lconv.ctype[(unsigned char)*s1].collation == _PDCLIB_lconv.ctype[(unsigned char)*s2].collation ) )
+    const _PDCLIB_ctype_t * ctype = _PDCLIB_lconv.ctype;
+
+    while ( ( *s1 ) && ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation ) )
     {
         ++s1;
         ++s2;
     }
     {
         ++s1;
         ++s2;
     }
-    return ( _PDCLIB_lconv.ctype[(unsigned char)*s1].collation == _PDCLIB_lconv.ctype[(unsigned char)*s2].collation );
+    return ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation );
 }
 
 #endif
 }
 
 #endif
index c16f1e0d0f3c839e03f9ecc5b618da974b6806be..c17d867f6381c4dc235d4670047fbf38eeaf8977 100644 (file)
 
 size_t strxfrm( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2, size_t n )
 {
 
 size_t strxfrm( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2, size_t n )
 {
+    const _PDCLIB_ctype_t * ctype = _PDCLIB_lconv.ctype;
     size_t len = strlen( s2 );
     if ( len < n )
     {
         /* Cannot use strncpy() here as the filling of s1 with '\0' is not part
            of the spec.
         */
     size_t len = strlen( s2 );
     if ( len < n )
     {
         /* Cannot use strncpy() here as the filling of s1 with '\0' is not part
            of the spec.
         */
-        while ( n-- && ( *s1++ = _PDCLIB_lconv.ctype[(unsigned char)*s2++].collation ) );
+        while ( n-- && ( *s1++ = ctype[(unsigned char)*s2++].collation ) );
     }
     return len;
 }
     }
     return len;
 }