Use NULL instead of 0 for pointers.

MFC after:	2 weeks
This commit is contained in:
Marcelo Araujo 2016-05-16 01:11:02 +00:00
parent f8358c11a5
commit 26d0a72296
3 changed files with 6 additions and 6 deletions

View File

@ -132,7 +132,7 @@ getsymtab(FILE *nfile, const char *filename)
errx( 1 , "%s: no symbols" , filename );
askfor = nname + 1;
nl = (nltype *) calloc( askfor , sizeof(nltype) );
if (nl == 0)
if (nl == NULL)
errx( 1 , "no room for %zu bytes of symbol table" ,
askfor * sizeof(nltype) );
@ -173,7 +173,7 @@ gettextspace(FILE *nfile)
{
textspace = (u_char *) malloc( xbuf.a_text );
if ( textspace == 0 ) {
if ( textspace == NULL ) {
warnx("no room for %u bytes of text space: can't do -c" ,
xbuf.a_text );
return;

View File

@ -376,7 +376,7 @@ cyclelink(void)
* i.e. it is origin 1, not origin 0.
*/
cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) );
if ( cyclenl == 0 )
if ( cyclenl == NULL )
errx( 1 , "no room for %zu bytes of cycle headers" ,
( ncycle + 1 ) * sizeof( nltype ) );
/*
@ -479,7 +479,7 @@ cycleanalyze(void)
continue;
done = FALSE;
cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) );
if ( cyclestack == 0 )
if ( cyclestack == NULL )
errx( 1, "no room for %zu bytes of cycle stack" ,
( size + 1 ) * sizeof( arctype * ) );
# ifdef DEBUG
@ -592,7 +592,7 @@ addcycle(arctype **stkstart, arctype **stkend)
}
clp = (cltype *)
calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
if ( clp == 0 ) {
if ( clp == NULL ) {
warnx( "no room for %zu bytes of subcycle storage" ,
sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) );
return( FALSE );

View File

@ -407,7 +407,7 @@ readsamples(FILE *pfile)
if (samples == 0) {
samples = (double *) calloc(nsamples, sizeof(double));
if (samples == 0)
if (samples == NULL)
errx(0, "no room for %d sample pc's", nsamples);
}
for (i = 0; i < nsamples; i++) {