Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Apr 2016 17:04:35 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        pkg@FreeBSD.org
Subject:   coccinelle cleanups for pkg
Message-ID:  <6fc474bd-0a2b-a689-644c-a544d0968828@FreeBSD.org>

index | next in thread | raw e-mail

[-- Attachment #1 --]
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.

[-- Attachment #2 --]
--- 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;
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6fc474bd-0a2b-a689-644c-a544d0968828>