emacs-diffs
[Top][All Lists]
Advanced

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

master e536fb0851 2/2: Use `ash` instead of `lsh`


From: Mattias Engdegård
Subject: master e536fb0851 2/2: Use `ash` instead of `lsh`
Date: Tue, 19 Jul 2022 09:38:50 -0400 (EDT)

branch: master
commit e536fb08515c1566b93e1d4a01a9980577ef8187
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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.
---
 lisp/files.el          | 2 +-
 lisp/image/exif.el     | 4 ++--
 lisp/term/haiku-win.el | 2 +-
 lisp/x-dnd.el          | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 25b5842364..bc74dfa738 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 fd4673dc1b..b25968af53 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 abcef77318..ec1e2f384a 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 62a5bbdfc3..a06563946c 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))



reply via email to

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