branch: externals/xelb commit 3d8a7fe1c3ab9004bd7c13be678512d78fd4f380 Author: Chris Feng <chris.w.f...@gmail.com> Commit: Chris Feng <chris.w.f...@gmail.com>
Minor fix for the sequence number comparison function * xcb.el (xcb:-sequence-cmp16): Return the difference of sequence numbers instead. --- xcb.el | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xcb.el b/xcb.el index a20253e..04d34b2 100644 --- a/xcb.el +++ b/xcb.el @@ -102,14 +102,14 @@ (defsubst xcb:-sequence-cmp16 (sequence1 sequence2) "Compare 16-bit sequence numbers SEQUENCE1 and SEQUENCE2. -Return 1 if SEQUENCE1 is larger than SEQUENCE2, 0 if they are equal, -1 -otherwise." +Return a positive value if SEQUENCE1 is larger than SEQUENCE2, 0 if they are +equal. Otherwise a negative value would be returned." (if (= sequence1 sequence2) 0 - (if (< #x7FFF (abs (- sequence1 sequence2))) - ;; Overflowed - (if (< sequence1 sequence2) 1 -1) - (if (> sequence1 sequence2) 1 -1)))) + (let ((diff (- sequence1 sequence2))) + (if (< #x7FFF (abs diff)) + (- diff) ;overflowed + diff)))) (defclass xcb:auth-info () ((name :initarg :name :initform "" :type string)