Skip to content

Commit 0d96ba2

Browse files
committed
Merge fix for 32-bit emacs.
Fix is from the ELPA repository, commit 42e566c946db8fc8b170a13c3bdff60cbf2807b0, by Paul Eggert. Original commit message: Port websocket to bleeding-edge 32-bit Emacs Problem reported by Stefan Monnier (Bug#31118). * packages/websocket/websocket.el (websocket-to-bytes): Do not assume that #xffffffff is a valid fixnum.
1 parent de26889 commit 0d96ba2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

websocket.el

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,9 @@ approximately 537M long."
234234
val nbytes))
235235
(if (= nbytes 8)
236236
(progn
237-
(let ((hi-32bits (lsh val -32))
238-
;; Test for systems that don't have > 32 bits, and
239-
;; for those systems just return the value.
240-
(low-32bits (if (= 0 (expt 2 32))
241-
val
242-
(logand #xffffffff val))))
237+
(let* ((hi-32bits (lsh val -32))
238+
;; This is just VAL on systems that don't have >= 32 bits.
239+
(low-32bits (- val (lsh hi-32bits 32))))
243240
(when (or (> hi-32bits 0) (> (lsh low-32bits -29) 0))
244241
(signal 'websocket-frame-too-large val))
245242
(bindat-pack `((:val vec 2 u32))

0 commit comments

Comments
 (0)