coccinelle cleanups for pkg
Pedro Giffuni
pfg at FreeBSD.org
Wed Apr 20 22:04:38 UTC 2016
Hello;
Playing a bit with coccinelle, it found some minor cosmetic issues in
pkg. Just some extra semicolons and one place where NULLs should be
used instead of zero.
Regards,
Pedro.
-------------- next part --------------
--- libpkg/diff.c.orig 2015-08-02 22:10:48 UTC
+++ libpkg/diff.c
@@ -348,7 +348,7 @@ static void appendTriple(DContext *p, in
}
if( p->nEdit+3>p->nEditAlloc ){
expandEdit(p, p->nEdit*2 + 15);
- if( p->aEdit==0 ) return;
+ if( p->aEdit==NULL ) return;
}
p->aEdit[p->nEdit++] = nCopy;
p->aEdit[p->nEdit++] = nDel;
@@ -473,7 +473,7 @@ text_diff(
c.same_fn = same_dline;
c.aFrom = break_into_lines(pA, &c.nFrom);
c.aTo = break_into_lines(pB, &c.nTo);
- if( c.aFrom==0 || c.aTo==0 ){
+ if( c.aFrom==NULL || c.aTo==NULL ){
free(c.aFrom);
free(c.aTo);
return 0;
--- libpkg/merge3.c.orig 2015-09-02 22:24:39 UTC
+++ libpkg/merge3.c
@@ -168,7 +168,7 @@ sbuf_merge(char *pPivot, char *pV1, char
*/
aC1 = text_diff(pPivot, pV1);
aC2 = text_diff(pPivot, pV2);
- if( aC1==0 || aC2==0 ){
+ if( aC1==NULL || aC2==NULL ){
free(aC1);
free(aC2);
return -1;
More information about the freebsd-pkg
mailing list