summaryrefslogtreecommitdiff
path: root/src/xcbint.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-07-01 00:16:07 -0700
committerKeith Packard <keithp@neko.keithp.com>2006-07-01 00:16:07 -0700
commitdb2504130bc450bd328830060cb3a243dd06b52f (patch)
tree7c92afa9d1d6e21c6aa851bac7dda718fc5c6969 /src/xcbint.h
parent75fead5b868a0dfdc9e6fd5ef0dd37eb71761312 (diff)
Switch sequence comparisons to handle 32-bit sequence number wrap.
Create a macro, XCB_SEQUENCE_COMPARE, that accepts two sequence numbers and a comparison operator and correctly handles 32-bit wrap around. Rewrite all ordered sequence number comparisons to use this macro. Also, caught one error where a sequence was stored in a signed int variable. Push out a GetInputFocus request when the sequence number does wrap at 32 bits so that applications cannot see sequence 0 (as that is an error indicator).
Diffstat (limited to 'src/xcbint.h')
-rw-r--r--src/xcbint.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xcbint.h b/src/xcbint.h
index a6d92aa..9048e9d 100644
--- a/src/xcbint.h
+++ b/src/xcbint.h
@@ -43,6 +43,8 @@ enum workarounds {
#define XCB_PAD(i) (-(i) & 3)
+#define XCB_SEQUENCE_COMPARE(a,op,b) ((int) ((a) - (b)) op 0)
+
/* xcb_list.c */
typedef void (*XCBListFreeFunc)(void *);