]> pd.if.org Git - pdclib/blobdiff - functions/stdlib/calloc.c
Removed the $Name$ tags (not supported by SVN). Added $Id$ to Makefile / text files.
[pdclib] / functions / stdlib / calloc.c
index 1e568b4303551e4467ef721d35820082612d5981..a2dc21ffdccfdf31336d911607cdea0411f31316 100644 (file)
@@ -1,7 +1,5 @@
 /* $Id$ */
 
-/* Release $Name$ */
-
 /* void * calloc( size_t, size_t )
 
    This file is part of the Public Domain C Library (PDCLib).
 
 void * calloc( size_t nmemb, size_t size )
 {
+    /* assign memory for nmemb elements of given size */
     void * rc = malloc( nmemb * size );
     if ( rc != NULL )
     {
+        /* zero-initialize the memory */
         memset( rc, 0, nmemb * size );
     }
     return rc;
@@ -28,10 +28,9 @@ void * calloc( size_t nmemb, size_t size )
 #ifdef TEST
 #include <_PDCLIB_test.h>
 
-int main()
+int main( void )
 {
     char * s;
-    BEGIN_TESTS;
     TESTCASE( ( s = calloc( 3, 2 ) ) != NULL );
     TESTCASE( s[0] == '\0' );
     TESTCASE( s[5] == '\0' );