]> pd.if.org Git - pdclib.old/blobdiff - functions/stdlib/bsearch.c
Removed the $Name$ tags (not supported by SVN). Added $Id$ to Makefile / text files.
[pdclib.old] / functions / stdlib / bsearch.c
index 7764d4763dd80217a060772211349362257c4939..e8e4f3125f53ef61677defaf38787103269c50b4 100644 (file)
@@ -1,13 +1,9 @@
 /* $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).
    Permission is granted to use, modify, and / or redistribute at will.
-
-   Code taken from Paul Edward's PDPCLIB.
 */
 
 #include <stdlib.h>
@@ -44,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 );