ref: 52d407f86f35b4a9f2be36c6d61032e2ecb9f754
parent: 5af0a7ce737f9f42d5fb153a84aa986850c97d62
author: cinap_lenrek <[email protected]>
date: Mon Aug 15 04:40:04 EDT 2016
libframe: consistent use of nil vs. 0
--- a/sys/src/libframe/frdraw.c
+++ b/sys/src/libframe/frdraw.c
@@ -145,7 +145,7 @@
{
Rectangle r;
- if(f->ticked==ticked || f->tick==0 || !ptinrect(pt, f->r))
+ if(f->ticked==ticked || f->tick==nil || !ptinrect(pt, f->r))
return;
pt.x--; /* looks best just left of where requested */
r = Rect(pt.x, pt.y, pt.x+FRTICKW, pt.y+f->font->height);
--- a/sys/src/libframe/frinit.c
+++ b/sys/src/libframe/frinit.c
@@ -17,12 +17,12 @@
f->nlines = 0;
f->p0 = 0;
f->p1 = 0;
- f->box = 0;
+ f->box = nil;
f->lastlinefull = 0;
- if(cols != 0)
+ if(cols != nil)
memmove(f->cols, cols, sizeof f->cols);
frsetrects(f, r, b);
- if(f->tick==nil && f->cols[BACK]!=0)
+ if(f->tick==nil && f->cols[BACK]!=nil)
frinittick(f);
}
@@ -34,7 +34,7 @@
b = f->display->screenimage;
ft = f->font;
- if(f->tick)
+ if(f->tick != nil)
freeimage(f->tick);
f->tick = allocimage(f->display, Rect(0, 0, FRTICKW, ft->height), b->chan, 0, DWhite);
if(f->tick == nil)
@@ -42,9 +42,9 @@
if(f->tickback)
freeimage(f->tickback);
f->tickback = allocimage(f->display, f->tick->r, b->chan, 0, DWhite);
- if(f->tickback == 0){
+ if(f->tickback == nil){
freeimage(f->tick);
- f->tick = 0;
+ f->tick = nil;
return;
}
/* background color */
@@ -71,14 +71,14 @@
{
if(f->nbox)
_frdelbox(f, 0, f->nbox-1);
- if(f->box)
+ if(f->box != nil)
free(f->box);
if(freeall){
freeimage(f->tick);
freeimage(f->tickback);
- f->tick = 0;
- f->tickback = 0;
+ f->tick = nil;
+ f->tickback = nil;
}
- f->box = 0;
+ f->box = nil;
f->ticked = 0;
}