X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fbsearch.c;h=e8e4f3125f53ef61677defaf38787103269c50b4;hb=d9dcf16664c81809258992e1653ecb68c8079974;hp=881c99af99e5414bd58def477d76abcd7afe2d85;hpb=a9f7cc5029b6f1becc079d216a5cde5894e68017;p=pdclib.old diff --git a/functions/stdlib/bsearch.c b/functions/stdlib/bsearch.c index 881c99a..e8e4f31 100644 --- a/functions/stdlib/bsearch.c +++ b/functions/stdlib/bsearch.c @@ -1,7 +1,5 @@ /* $Id$ */ -/* Release $Name$ */ - /* bsearch( const void *, const void *, size_t, size_t, int(*)( const void *, const void * ) ) This file is part of the Public Domain C Library (PDCLib). @@ -42,14 +40,13 @@ void * bsearch( const void * key, const void * base, size_t nmemb, size_t size, #ifdef TEST #include <_PDCLIB_test.h> -int compare( const void * left, const void * right ) +static int compare( const void * left, const void * right ) { return *( (unsigned char *)left ) - *( (unsigned char *)right ); } -int main() +int main( void ) { - BEGIN_TESTS; TESTCASE( bsearch( "e", abcde, 4, 1, compare ) == NULL ); TESTCASE( bsearch( "e", abcde, 5, 1, compare ) == &abcde[4] ); TESTCASE( bsearch( "a", abcde + 1, 4, 1, compare ) == NULL );