diff options
Diffstat (limited to 'Xext/sync.c')
-rw-r--r-- | Xext/sync.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Xext/sync.c b/Xext/sync.c index 37c59c2be..c9162ee27 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -466,7 +466,7 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait, if (client->clientGone) return; - pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent)); + pev = pEvents = calloc(num_events, sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); @@ -1033,15 +1033,15 @@ SyncComputeBracketValues(SyncCounter * pCounter) pnewltval = &psci->bracket_less; } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, - psci->bracket_greater)) { + XSyncValueGreaterThan(pTrigger->test_value, + psci->bracket_less)) { /* * The value is exactly equal to our threshold. We want one - * more event in the positive direction to ensure we pick up - * when the value *exceeds* this threshold. + * more event in the negative direction to ensure we pick up + * when the value is less than this threshold. */ - psci->bracket_greater = pTrigger->test_value; - pnewgtval = &psci->bracket_greater; + psci->bracket_less = pTrigger->test_value; + pnewltval = &psci->bracket_less; } } else if (pTrigger->test_type == XSyncPositiveTransition && @@ -1053,15 +1053,15 @@ SyncComputeBracketValues(SyncCounter * pCounter) pnewgtval = &psci->bracket_greater; } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, - psci->bracket_less)) { + XSyncValueLessThan(pTrigger->test_value, + psci->bracket_greater)) { /* * The value is exactly equal to our threshold. We want one - * more event in the negative direction to ensure we pick up - * when the value is less than this threshold. + * more event in the positive direction to ensure we pick up + * when the value *exceeds* this threshold. */ - psci->bracket_less = pTrigger->test_value; - pnewltval = &psci->bracket_less; + psci->bracket_greater = pTrigger->test_value; + pnewgtval = &psci->bracket_greater; } } } /* end for each trigger */ |