Skip to content

Commit

Permalink
nx-X11/programs/Xserver/hw/nxagent/Screen.c: let intersect() accept N…
Browse files Browse the repository at this point in the history
…ULL pointers in case we're only interested in the boolean return value.
  • Loading branch information
Ionic committed Mar 19, 2018
1 parent 39d5228 commit 90d94d0
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions nx-X11/programs/Xserver/hw/nxagent/Screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -3670,13 +3670,25 @@ static Bool intersect(int ax1, int ay1, unsigned int aw, unsigned int ah,

return FALSE;
}
*x = ix;
*y = iy;
*w = iw;
*h = ih;

if (x) {
*x = ix;
}

if (y) {
*y = iy;
}

if (w) {
*w = iw;
}

if (h) {
*h = ih;
}

#ifdef DEBUG
fprintf(stderr, "intersect: intersection is: ([%d],[%d]) [ %d x %d ]\n", *x, *y, *w, *h);
fprintf(stderr, "intersect: intersection is: ([%d],[%d]) [ %d x %d ]\n", (x) ? *(x) : (-1), (y) ? (*y) : (-1), (w) ? (*w) : (-1), (h) ? (*h) : (-1));
#endif

return TRUE;
Expand Down

0 comments on commit 90d94d0

Please sign in to comment.