emacs-diffs
[Top][All Lists]
Advanced

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

master 234cf74: Remove some compat code from uudecode.el and binhex.el


From: Stefan Kangas
Subject: master 234cf74: Remove some compat code from uudecode.el and binhex.el
Date: Wed, 21 Oct 2020 09:41:58 -0400 (EDT)

branch: master
commit 234cf7491872155dbd9716dc4652febefbe3759f
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Remove some compat code from uudecode.el and binhex.el
    
    * lisp/mail/uudecode.el (uudecode-char-int): Make obsolete.
    (uudecode-decode-region-internal): Adjust callers.
    * lisp/mail/binhex.el (binhex-char-int): Make obsolete.
    (binhex-string-big-endian, binhex-string-little-endian)
    (binhex-header): Adjust callers.
---
 lisp/mail/binhex.el   | 16 ++++++----------
 lisp/mail/uudecode.el | 11 ++++-------
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 2c77f88..431c681 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -29,12 +29,6 @@
 
 ;;; Code:
 
-(eval-and-compile
-  (defalias 'binhex-char-int
-    (if (fboundp 'char-int)
-       'char-int
-      'identity)))
-
 (defgroup binhex nil
   "Decoding of BinHex (binary-to-hexadecimal) data."
   :group 'mail
@@ -150,14 +144,14 @@ input and write the converted data to its standard 
output."
 (defun binhex-string-big-endian (string)
   (let ((ret 0) (i 0) (len (length string)))
     (while (< i len)
-      (setq ret (+ (ash ret 8) (binhex-char-int (aref string i)))
+      (setq ret (+ (ash ret 8) (aref string i))
            i (1+ i)))
     ret))
 
 (defun binhex-string-little-endian (string)
   (let ((ret 0) (i 0) (shift 0) (len (length string)))
     (while (< i len)
-      (setq ret (+ ret (ash (binhex-char-int (aref string i)) shift))
+      (setq ret (+ ret (ash (aref string i) shift))
            i (1+ i)
            shift (+ shift 8)))
     ret))
@@ -167,11 +161,11 @@ input and write the converted data to its standard 
output."
     (let ((pos (point-min)) len)
       (vector
        (prog1
-          (setq len (binhex-char-int (char-after pos)))
+           (setq len (char-after pos))
         (setq pos (1+ pos)))
        (buffer-substring pos (setq pos (+ pos len)))
        (prog1
-          (setq len (binhex-char-int (char-after pos)))
+           (setq len (char-after pos))
         (setq pos (1+ pos)))
        (buffer-substring pos (setq pos (+ pos 4)))
        (buffer-substring pos (setq pos (+ pos 4)))
@@ -323,6 +317,8 @@ If HEADER-ONLY is non-nil only decode header and return 
filename."
       (binhex-decode-region-external start end)
     (binhex-decode-region-internal start end)))
 
+(define-obsolete-function-alias 'binhex-char-int #'identity)
+
 (provide 'binhex)
 
 ;;; binhex.el ends here
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 945bff3..bcbd571 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -24,11 +24,6 @@
 
 ;;; Code:
 
-(defalias 'uudecode-char-int
-  (if (fboundp 'char-int)
-      'char-int
-    'identity))
-
 (defgroup uudecode nil
   "Decoding of uuencoded data."
   :group 'mail
@@ -140,7 +135,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
           ((> (skip-chars-forward uudecode-alphabet end) 0)
            (setq lim (point))
            (setq remain
-                 (logand (- (uudecode-char-int (char-after inputpos)) 32)
+                  (logand (- (char-after inputpos) 32)
                          63))
            (setq inputpos (1+ inputpos))
            (if (= remain 0) (setq done t))
@@ -148,7 +143,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
              (setq bits (+ bits
                            (logand
                             (-
-                             (uudecode-char-int (char-after inputpos)) 32)
+                              (char-after inputpos) 32)
                             63)))
              (if (/= counter 0) (setq remain (1- remain)))
              (setq counter (1+ counter)
@@ -201,6 +196,8 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
       (uudecode-decode-region-external start end file-name)
     (uudecode-decode-region-internal start end file-name)))
 
+(define-obsolete-function-alias 'uudecode-char-int #'identity "28.1")
+
 (provide 'uudecode)
 
 ;;; uudecode.el ends here



reply via email to

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