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 /dix | |
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 'dix')
-rw-r--r-- | dix/privates.c | 15 | ||||
-rw-r--r-- | dix/region.c | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/dix/privates.c b/dix/privates.c index 9ca80f0b6..83dfabc47 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -476,7 +476,8 @@ _dixAllocateObjectWithPrivates(unsigned baseSize, unsigned clear, PrivatePtr privates; PrivatePtr *devPrivates; - assert(type > PRIVATE_SCREEN && type < PRIVATE_LAST); + assert(type > PRIVATE_SCREEN); + assert(type < PRIVATE_LAST); assert(!screen_specific_private[type]); /* round up so that void * is aligned */ @@ -505,7 +506,8 @@ dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type) unsigned size; PrivatePtr p; - assert(type > PRIVATE_XSELINUX && type < PRIVATE_LAST); + assert(type > PRIVATE_XSELINUX); + assert(type < PRIVATE_LAST); assert(!screen_specific_private[type]); size = global_keys[type].offset; @@ -554,7 +556,8 @@ dixFreePrivates(PrivatePtr privates, DevPrivateType type) extern _X_EXPORT int dixPrivatesSize(DevPrivateType type) { - assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST); + assert(type >= PRIVATE_SCREEN); + assert(type < PRIVATE_LAST); assert (!screen_specific_private[type]); return global_keys[type].offset; @@ -696,7 +699,8 @@ _dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, PrivatePtr *devPrivates; int privates_size; - assert(type > PRIVATE_SCREEN && type < PRIVATE_LAST); + assert(type > PRIVATE_SCREEN); + assert(type < PRIVATE_LAST); assert (screen_specific_private[type]); if (pScreen) @@ -722,7 +726,8 @@ _dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, int dixScreenSpecificPrivatesSize(ScreenPtr pScreen, DevPrivateType type) { - assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST); + assert(type >= PRIVATE_SCREEN); + assert(type < PRIVATE_LAST); if (screen_specific_private[type]) return pScreen->screenSpecificPrivates[type].offset; diff --git a/dix/region.c b/dix/region.c index fd7313990..e269e695c 100644 --- a/dix/region.c +++ b/dix/region.c @@ -901,7 +901,8 @@ RegionUnionO(RegionPtr pReg, int x2; assert(y1 < y2); - assert(r1 != r1End && r2 != r2End); + assert(r1 != r1End); + assert(r2 != r2End); pNextRect = RegionTop(pReg); |