tCompare function pointers against 0 rather than nil. - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit a87638642c99d88a3543e0cd5864c9e54133fbee
parent eac9e0183f550f950bfcf5cdad959976cbe041ba
Author: wkj 
Date:   Fri,  9 Jul 2004 01:54:06 +0000

Compare function pointers against 0 rather than nil.

Diffstat:
  M src/cmd/9660/dump9660.c             |       2 +-
  M src/cmd/acme/fsys.c                 |       2 +-
  M src/cmd/draw/stats.c                |       4 ++--
  M src/cmd/jpg/toico.c                 |       2 +-
  M src/cmd/plumb/fsys.c                |       2 +-
  M src/libdraw/ml-lsetrefresh.c        |       4 ++--
  M src/libdraw/ml-unload.c             |       2 +-
  M src/libmach/crack.c                 |       2 +-
  M src/libmach/crackelf.c              |       2 +-
  M src/libmach/map.c                   |       2 +-
  M src/libmach/stabs.c                 |       2 +-
  M src/libmach/sym.c                   |       2 +-
  M src/libthread/note.c                |       2 +-

13 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/src/cmd/9660/dump9660.c b/src/cmd/9660/dump9660.c
t@@ -146,7 +146,7 @@ main(int argc, char **argv)
         /*
          * Read new files into memory
          */
-        if(rdproto(proto, src, addprotofile, nil, &iroot) < 0)
+        if(rdproto(proto, src, addprotofile, 0, &iroot) < 0)
                 sysfatal("rdproto: %r");
 
         if(mk9660){
diff --git a/src/cmd/acme/fsys.c b/src/cmd/acme/fsys.c
t@@ -156,7 +156,7 @@ fsysproc(void *v)
                         error("convert error in convM2S");
                 if(DEBUG)
                         fprint(2, "%F\n", &x->fcall);
-                if(fcall[x->fcall.type] == nil)
+                if(fcall[x->fcall.type] == 0)
                         x = respond(x, &t, "bad fcall type");
                 else{
                         if(x->fcall.type==Tversion || x->fcall.type==Tauth)
diff --git a/src/cmd/draw/stats.c b/src/cmd/draw/stats.c
t@@ -101,7 +101,7 @@ struct Machine
 char        *menu2str[Nvalue+1];
 char xmenu2str[Nvalue+1][40];
 
-Menu        menu2 = {menu2str, nil};
+Menu        menu2 = {menu2str, 0};
 int                present[Nvalue];
 Image        *cols[Ncolor][3];
 Graph        *graph;
t@@ -792,7 +792,7 @@ threadmain(int argc, char *argv[])
                 for(j=0; j
diff --git a/src/cmd/jpg/toico.c b/src/cmd/jpg/toico.c
t@@ -75,7 +75,7 @@ main(int argc, char **argv)
         }ARGEND;
 
         /* read in all the images */
-        initdraw(nil, nil, nil);
+        initdraw(0, nil, nil);
         if(argc < 1){
                 readicon("/fd/0");
         } else {
diff --git a/src/cmd/plumb/fsys.c b/src/cmd/plumb/fsys.c
t@@ -233,7 +233,7 @@ fsysproc(void *v)
                         error("convert error in convM2S");
                 if(debug)
                         fprint(2, "<= %F\n", t);
-                if(fcall[t->type] == nil)
+                if(fcall[t->type] == 0)
                         fsysrespond(t, buf, Ebadfcall);
                 else{
                         if(t->type==Tversion || t->type==Tauth)
diff --git a/src/libdraw/ml-lsetrefresh.c b/src/libdraw/ml-lsetrefresh.c
t@@ -10,13 +10,13 @@ memlsetrefresh(Memimage *i, Refreshfn fn, void *ptr)
         Memlayer *l;
 
         l = i->layer;
-        if(l->refreshfn!=nil && fn!=nil){        /* just change functions */
+        if(l->refreshfn!=0 && fn!=0){        /* just change functions */
                 l->refreshfn = fn;
                 l->refreshptr = ptr;
                 return 1;
         }
 
-        if(l->refreshfn == nil){        /* is using backup image; just free it */
+        if(l->refreshfn == 0){        /* is using backup image; just free it */
                 freememimage(l->save);
                 l->save = nil;
                 l->refreshfn = fn;
diff --git a/src/libdraw/ml-unload.c b/src/libdraw/ml-unload.c
t@@ -35,7 +35,7 @@ memunload(Memimage *src, Rectangle r, uchar *data, int n)
          * src is an obscured layer or data is unaligned
          */
         if(dl->save && dx==0){
-                if(dl->refreshfn != nil)
+                if(dl->refreshfn != 0)
                         return -1;        /* can't unload window if it's not Refbackup */
                 if(n > 0)
                         memlhide(src, r);
diff --git a/src/libmach/crack.c b/src/libmach/crack.c
t@@ -66,7 +66,7 @@ mapfile(Fhdr *fp, ulong base, Map *map, Regs **regs)
                 werrstr("no map");
                 return -1;
         }
-        if(fp->map == nil){
+        if(fp->map == 0){
                 werrstr("cannot load map for this file type");
                 return -1;
         }
diff --git a/src/libmach/crackelf.c b/src/libmach/crackelf.c
t@@ -287,7 +287,7 @@ mapcoreregs(Fhdr *fp, Map *map, Regs **rp)
         UregRegs *r;
 
         elf = fp->elf;
-        if(elf->coreregs == nil){
+        if(elf->coreregs == 0){
                 werrstr("cannot parse %s %s cores", fp->mname, fp->aname);
                 return -1;
         }
diff --git a/src/libmach/map.c b/src/libmach/map.c
t@@ -40,7 +40,7 @@ addseg(Map *map, Seg seg)
         if(ss == nil)
                 return -1;
         map->seg = ss;
-        if(seg.rw == nil){
+        if(seg.rw == 0){
                 if(seg.name && strcmp(seg.name, "zero") == 0)
                         seg.rw = zerorw;
                 else if(seg.p)
diff --git a/src/libmach/stabs.c b/src/libmach/stabs.c
t@@ -17,7 +17,7 @@ stabsym(Stab *stabs, int i, StabSym *sym)
                 werrstr("no stabs");
                 return -1;
         }
-        if(stabs->e2==nil || stabs->e4==nil){
+        if(stabs->e2==0 || stabs->e4==0){
                 werrstr("no data extractors");
                 return -1;
         }
diff --git a/src/libmach/sym.c b/src/libmach/sym.c
t@@ -427,7 +427,7 @@ syminit(Fhdr *hdr)
         int i;
         Symbol *r, *w, *es;
 
-        if(hdr->syminit == nil){
+        if(hdr->syminit == 0){
                 werrstr("no debugging symbols");
                 return -1;
         }
diff --git a/src/libthread/note.c b/src/libthread/note.c
t@@ -58,7 +58,7 @@ delayednotes(Proc *p, void *v)
         for(n=notes; nproc == p){
                         for(i=0; ipid || (fn = onnote[i])==nil)
+                                if(onnotepid[i]!=p->pid || (fn = onnote[i])==0)
                                         continue;
                                 if((*fn)(v, n->s))
                                         break;