emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/xelb 1916894 07/42: Fix integer overflow on 32-bit plat


From: Chris Feng
Subject: [elpa] externals/xelb 1916894 07/42: Fix integer overflow on 32-bit platform
Date: Thu, 17 Sep 2015 23:16:39 +0000

branch: externals/xelb
commit 1916894afcebe2c48c53ceaac9c611b1e89fbba6
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Fix integer overflow on 32-bit platform
---
 xcb-types.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xcb-types.el b/xcb-types.el
index af31817..e1a5206 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -131,7 +131,7 @@
         (vector (logand (lsh value -24) #xFF) (logand (lsh value -16) #xFF)
                 (logand (lsh value -8) #xFF) (logand value #xFF))
       (let* ((msw (truncate value #x10000))
-             (lsw (truncate (- value (lsh msw 16)))))
+             (lsw (truncate (- value (* msw 65536.0)))))
         (vector (logand (lsh msw -8) #xFF) (logand msw #xFF)
                 (logand (lsh lsw -8) #xFF) (logand lsw #xFF)))))
   (defsubst xcb:-pack-u4-lsb (value)
@@ -140,7 +140,7 @@
         (vector (logand value #xFF) (logand (lsh value -8) #xFF)
                 (logand (lsh value -16) #xFF) (logand (lsh value -24) #xFF))
       (let* ((msw (truncate value #x10000))
-             (lsw (truncate (- value (* msw #x10000)))))
+             (lsw (truncate (- value (* msw 65536.0)))))
         (vector (logand lsw #xFF) (logand (lsh lsw -8) #xFF)
                 (logand msw #xFF) (logand (lsh msw -8) #xFF))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]