mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 11:50:06 +01:00
sync: compress two if statements
No functional changes, just merges a > and == condition into a >= condition.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 5c7cfd4c69)
This commit is contained in:
parent
0c809f459c
commit
0033e969f4
1 changed files with 19 additions and 32 deletions
51
Xext/sync.c
51
Xext/sync.c
|
|
@ -1031,42 +1031,29 @@ SyncComputeBracketValues(SyncCounter * pCounter)
|
|||
}
|
||||
else if (pTrigger->test_type == XSyncNegativeTransition &&
|
||||
ct != XSyncCounterNeverIncreases) {
|
||||
if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
|
||||
XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
|
||||
{
|
||||
psci->bracket_less = pTrigger->test_value;
|
||||
pnewltval = &psci->bracket_less;
|
||||
}
|
||||
else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
|
||||
XSyncValueGreaterThan(pTrigger->test_value,
|
||||
psci->bracket_less)) {
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
psci->bracket_less = pTrigger->test_value;
|
||||
pnewltval = &psci->bracket_less;
|
||||
if (XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value) &&
|
||||
XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less)) {
|
||||
/*
|
||||
* If 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.
|
||||
*/
|
||||
psci->bracket_less = pTrigger->test_value;
|
||||
pnewltval = &psci->bracket_less;
|
||||
}
|
||||
}
|
||||
else if (pTrigger->test_type == XSyncPositiveTransition &&
|
||||
ct != XSyncCounterNeverDecreases) {
|
||||
if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
|
||||
XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
|
||||
{
|
||||
psci->bracket_greater = pTrigger->test_value;
|
||||
pnewgtval = &psci->bracket_greater;
|
||||
}
|
||||
else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
|
||||
XSyncValueLessThan(pTrigger->test_value,
|
||||
psci->bracket_greater)) {
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
psci->bracket_greater = pTrigger->test_value;
|
||||
pnewgtval = &psci->bracket_greater;
|
||||
if (XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value) &&
|
||||
XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater)) {
|
||||
/*
|
||||
* If 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.
|
||||
*/
|
||||
psci->bracket_greater = pTrigger->test_value;
|
||||
pnewgtval = &psci->bracket_greater;
|
||||
}
|
||||
}
|
||||
} /* end for each trigger */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue