Author: araujo Date: Mon May 16 01:11:02 2016 New Revision: 299877 URL: https://svnweb.freebsd.org/changeset/base/299877
Log: Use NULL instead of 0 for pointers. MFC after: 2 weeks Modified: head/usr.bin/gprof/aout.c head/usr.bin/gprof/arcs.c head/usr.bin/gprof/gprof.c Modified: head/usr.bin/gprof/aout.c ============================================================================== --- head/usr.bin/gprof/aout.c Mon May 16 00:36:12 2016 (r299876) +++ head/usr.bin/gprof/aout.c Mon May 16 01:11:02 2016 (r299877) @@ -132,7 +132,7 @@ getsymtab(FILE *nfile, const char *filen 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; Modified: head/usr.bin/gprof/arcs.c ============================================================================== --- head/usr.bin/gprof/arcs.c Mon May 16 00:36:12 2016 (r299876) +++ head/usr.bin/gprof/arcs.c Mon May 16 01:11:02 2016 (r299877) @@ -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 **s } 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 ); Modified: head/usr.bin/gprof/gprof.c ============================================================================== --- head/usr.bin/gprof/gprof.c Mon May 16 00:36:12 2016 (r299876) +++ head/usr.bin/gprof/gprof.c Mon May 16 01:11:02 2016 (r299877) @@ -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++) { _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"