X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fwchar%2Fwmemcpy.c;h=2f3bdac3355a3ab5e7a199c017f350bac2d5b524;hp=b0b9c200d4667daa827934c63cb390453284c443;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/functions/wchar/wmemcpy.c b/functions/wchar/wmemcpy.c index b0b9c20..2f3bdac 100644 --- a/functions/wchar/wmemcpy.c +++ b/functions/wchar/wmemcpy.c @@ -1,39 +1,39 @@ -/* wmemcpy( wchar_t *, const wchar_t *, size_t ) - - This file is part of the Public Domain C Library (PDCLib). - Permission is granted to use, modify, and / or redistribute at will. -*/ - -#include - -#ifndef REGTEST - -wchar_t * wmemcpy( wchar_t * _PDCLIB_restrict dest, - const wchar_t * _PDCLIB_restrict src, - size_t n ) -{ - wchar_t* rv = dest; - while ( n-- ) - { - *dest++ = *src++; - } - return rv; -} - -#endif - -#ifdef TEST -#include "_PDCLIB_test.h" - -int main( void ) -{ - wchar_t s[] = L"xxxxxxxxxxx"; - TESTCASE( wmemcpy( s, wabcde, 6 ) == s ); - TESTCASE( s[4] == L'e' ); - TESTCASE( s[5] == L'\0' ); - TESTCASE( wmemcpy( s + 5, wabcde, 5 ) == s + 5 ); - TESTCASE( s[9] == L'e' ); - TESTCASE( s[10] == L'x' ); - return TEST_RESULTS; -} -#endif +/* wmemcpy( wchar_t *, const wchar_t *, size_t ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include + +#ifndef REGTEST + +wchar_t * wmemcpy( wchar_t * _PDCLIB_restrict dest, + const wchar_t * _PDCLIB_restrict src, + size_t n ) +{ + wchar_t* rv = dest; + while ( n-- ) + { + *dest++ = *src++; + } + return rv; +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + wchar_t s[] = L"xxxxxxxxxxx"; + TESTCASE( wmemcpy( s, wabcde, 6 ) == s ); + TESTCASE( s[4] == L'e' ); + TESTCASE( s[5] == L'\0' ); + TESTCASE( wmemcpy( s + 5, wabcde, 5 ) == s + 5 ); + TESTCASE( s[9] == L'e' ); + TESTCASE( s[10] == L'x' ); + return TEST_RESULTS; +} +#endif