diff options
author | Adam Richter <adamrichter4@gmail.com> | 2019-05-02 15:02:36 -0700 |
---|---|---|
committer | Adam Richter <adamrichter4@gmail.com> | 2019-05-02 15:02:36 -0700 |
commit | 9d25408a59d6273f1c4c994de9cc53f488a8ec3c (patch) | |
tree | a7a90ea8746628b897863283cf8abb424a45c274 /composite | |
parent | dd1aebccf2e1722ac10fb73ed438251785283b8d (diff) |
assert(a && b) --> assert(a); assert(b)
Separate each statement of the form "assert(a && b);" into "assert(a);"
and "assert(b);" for more precise diagnostics, except for this clever
use in drmmode_display.c where it was used to pass a hint to developers:
assert(num_infos <= 32 && "update return type");
Diffstat (limited to 'composite')
-rw-r--r-- | composite/compalloc.c | 3 | ||||
-rw-r--r-- | composite/compwindow.c | 15 |
2 files changed, 13 insertions, 5 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c index 3e2f14fb0..23320c406 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -669,7 +669,8 @@ compReallocPixmap(WindowPtr pWin, int draw_x, int draw_y, int pix_x, pix_y; int pix_w, pix_h; - assert(cw && pWin->redirectDraw != RedirectDrawNone); + assert(cw); + assert(pWin->redirectDraw != RedirectDrawNone); cw->oldx = pOld->screen_x; cw->oldy = pOld->screen_y; pix_x = draw_x - bw; diff --git a/composite/compwindow.c b/composite/compwindow.c index 54b4e6ac4..ea59b5a1a 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -72,10 +72,17 @@ compCheckWindow(WindowPtr pWin, void *data) else { assert(pWinPixmap == pParentPixmap); } - assert(0 < pWinPixmap->refcnt && pWinPixmap->refcnt < 3); - assert(0 < pScreenPixmap->refcnt && pScreenPixmap->refcnt < 3); - if (pParentPixmap) - assert(0 <= pParentPixmap->refcnt && pParentPixmap->refcnt < 3); + + assert(0 < pWinPixmap->refcnt) + assert(pWinPixmap->refcnt < 3); + + assert(0 < pScreenPixmap->refcnt); + assert(pScreenPixmap->refcnt < 3); + + if (pParentPixmap) { + assert(0 <= pParentPixmap->refcnt); + assert(pParentPixmap->refcnt < 3); + } return WT_WALKCHILDREN; } |