[PATCH 3/9] Xext: localise pIdleTimeValueLess/Greater
Peter Hutterer
peter.hutterer at who-t.net
Tue Mar 13 22:47:20 PDT 2012
Cleanup for future features, no functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Xext/sync.c | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/Xext/sync.c b/Xext/sync.c
index e97b124..f07f6dd 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -2745,19 +2745,20 @@ static void
IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
{
SyncCounter *counter = IdleTimeCounter;
+ XSyncValue *less = pIdleTimeValueLess,
+ *greater = pIdleTimeValueGreater;
XSyncValue idle, old_idle;
SyncTriggerList *list = counter->sync.pTriglist;
SyncTrigger *trig;
- if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+ if (!less && !greater)
return;
old_idle = counter->value;
IdleTimeQueryValue (NULL, &idle);
counter->value = idle; /* push, so CheckTrigger works */
- if (pIdleTimeValueLess &&
- XSyncValueLessOrEqual (idle, *pIdleTimeValueLess))
+ if (less && XSyncValueLessOrEqual (idle, *less))
{
/*
* We've been idle for less than the threshold value, and someone
@@ -2780,10 +2781,10 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
* idle time greater than this. Schedule a wakeup for the next
* millisecond so we won't miss a transition.
*/
- if (XSyncValueEqual (idle, *pIdleTimeValueLess))
+ if (XSyncValueEqual (idle, *less))
AdjustWaitForDelay(wt, 1);
}
- else if (pIdleTimeValueGreater)
+ else if (greater)
{
/*
* There's a threshold in the positive direction. If we've been
@@ -2793,11 +2794,11 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
*/
unsigned long timeout = -1;
- if (XSyncValueLessThan (idle, *pIdleTimeValueGreater)) {
+ if (XSyncValueLessThan (idle, *greater)) {
XSyncValue value;
Bool overflow;
- XSyncValueSubtract (&value, *pIdleTimeValueGreater,
+ XSyncValueSubtract (&value, *greater,
idle, &overflow);
timeout = min(timeout, XSyncValueLow32 (value));
} else {
@@ -2821,16 +2822,16 @@ IdleTimeWakeupHandler (pointer env, int rc, pointer LastSelectMask)
{
SyncCounter *counter = IdleTimeCounter;
XSyncValue idle;
+ XSyncValue *less = pIdleTimeValueLess,
+ *greater = pIdleTimeValueGreater;
- if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+ if (!less && !greater)
return;
IdleTimeQueryValue (NULL, &idle);
- if ((pIdleTimeValueGreater &&
- XSyncValueGreaterOrEqual (idle, *pIdleTimeValueGreater)) ||
- (pIdleTimeValueLess &&
- XSyncValueLessOrEqual (idle, *pIdleTimeValueLess)))
+ if ((greater && XSyncValueGreaterOrEqual (idle, *greater)) ||
+ (less && XSyncValueLessOrEqual (idle, *less)))
{
SyncChangeCounter (counter, idle);
}
@@ -2840,7 +2841,9 @@ static void
IdleTimeBracketValues (pointer pCounter, CARD64 *pbracket_less,
CARD64 *pbracket_greater)
{
- Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater);
+ XSyncValue *less = pIdleTimeValueLess,
+ *greater = pIdleTimeValueGreater;
+ Bool registered = (less || greater);
if (registered && !pbracket_less && !pbracket_greater)
{
--
1.7.7.6
More information about the xorg-devel
mailing list