From: Mattias EngdegÄrd Date: Tue, 19 Jul 2022 11:57:47 +0000 (+0200) Subject: Use `ash` instead of `lsh` X-Git-Tag: emacs-29.0.90~1447^2~851^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e536fb08515c1566b93e1d4a01a9980577ef8187;p=emacs.git Use `ash` instead of `lsh` * lisp/files.el (file-modes-number-to-symbolic): * lisp/image/exif.el (exif--direct-ascii-value): * lisp/term/haiku-win.el (defun): * lisp/x-dnd.el (x-dnd-handle-xdnd, x-dnd-handle-motif): `lsh` is slower and has confusing semantics; avoid. --- diff --git a/lisp/files.el b/lisp/files.el index 25b58423649..bc74dfa7381 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -8337,7 +8337,7 @@ such as `?d' for a directory, or `?l' for a symbolic link and will override the leading `-' char." (string (or filetype - (pcase (lsh mode -12) + (pcase (ash mode -12) ;; POSIX specifies that the file type is included in st_mode ;; and provides names for the file types but values only for ;; the permissions (e.g., S_IWOTH=2). diff --git a/lisp/image/exif.el b/lisp/image/exif.el index fd4673dc1b6..b25968af536 100644 --- a/lisp/image/exif.el +++ b/lisp/image/exif.el @@ -261,9 +261,9 @@ VALUE is an integer representing BYTES characters." (set-buffer-multibyte nil) (if le (dotimes (i bytes) - (insert (logand (lsh value (* i -8)) 255))) + (insert (logand (ash value (* i -8)) 255))) (dotimes (i bytes) - (insert (logand (lsh value (* (- (1- bytes) i) -8)) 255)))) + (insert (logand (ash value (* (- (1- bytes) i) -8)) 255)))) (insert 0) (buffer-string))) diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el index abcef773180..ec1e2f384a9 100644 --- a/lisp/term/haiku-win.el +++ b/lisp/term/haiku-win.el @@ -188,7 +188,7 @@ VALUE as a unibyte string, or nil if VALUE was not a string." (error "Out of range octet: %d" octet)) (setq value (logior value - (lsh octet + (ash octet (- (* (1- (length string)) 8) offset)))) (setq offset (+ offset 8)))) diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 62a5bbdfc3d..a06563946c6 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -825,8 +825,8 @@ MESSAGE is the type of the ClientMessage that was sent." (when (windowp (posn-window (event-start event))) (let ((flags (aref data 1)) (version (aref state 6))) - (when (not (zerop (logand (lsh flags -10) 1))) - (let* ((button (+ 4 (logand (lsh flags -8) #x3))) + (when (not (zerop (logand (ash flags -10) 1))) + (let* ((button (+ 4 (logand (ash flags -8) #x3))) (count (or (and (>= version 1) (x-dnd-note-click button (aref data 3))) @@ -1086,7 +1086,7 @@ Return a vector of atoms containing the selection targets." (defun x-dnd-handle-motif (event frame window _message-atom _format data) (let* ((message-type (cdr (assoc (logand (aref data 0) #x3f) x-dnd-motif-message-types))) - (initiator-p (eq (lsh (aref data 0) -7) 0)) + (initiator-p (eq (ash (aref data 0) -7) 0)) (source-byteorder (aref data 1)) (my-byteorder (byteorder)) (source-flags (x-dnd-get-motif-value data 2 2 source-byteorder))