Compare function pointers against 0 rather than nil.
This commit is contained in:
parent
eac9e0183f
commit
a87638642c
13 changed files with 15 additions and 15 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue