* Patch: Remove old-style backquotes in all files
@ 2007-09-06 19:14 Tassilo Horn
2007-09-06 22:48 ` Katsumi Yamaoka
0 siblings, 1 reply; 2+ messages in thread
From: Tassilo Horn @ 2007-09-06 19:14 UTC (permalink / raw)
To: ding
Hi all,
this patch deletes all old-style backquotes which produce ugly warning
messages when compiling gnus with a current CVS emacs.
--8<---------------cut here---------------start------------->8---
Index: lisp/sha1.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/sha1.el,v
retrieving revision 7.8
diff -u -r7.8 sha1.el
--- lisp/sha1.el 24 Jan 2007 07:15:37 -0000 7.8
+++ lisp/sha1.el 6 Sep 2007 19:12:52 -0000
@@ -129,9 +129,9 @@
;;; (logand (lognot (, B)) (, D)))))
;;; a little optimization from GnuPG/cipher/sha1.c.
(defmacro sha1-F0 (B C D)
- (` (logxor (, D) (logand (, B) (logxor (, C) (, D))))))
+ `(logxor ,D (logand ,B (logxor ,C ,D))))
(defmacro sha1-F1 (B C D)
- (` (logxor (, B) (, C) (, D))))
+ `(logxor ,B ,C ,D))
;;; original definition of sha1-F2.
;;; (defmacro sha1-F2 (B C D)
;;; (` (logior (logand (, B) (, C))
@@ -139,77 +139,77 @@
;;; (logand (, C) (, D)))))
;;; a little optimization from GnuPG/cipher/sha1.c.
(defmacro sha1-F2 (B C D)
- (` (logior (logand (, B) (, C))
- (logand (, D) (logior (, B) (, C))))))
+ `(logior (logand ,B ,C)
+ (logand ,D (logior ,B ,C))))
(defmacro sha1-F3 (B C D)
- (` (logxor (, B) (, C) (, D))))
+ `(logxor ,B ,C ,D))
(defmacro sha1-S1 (W-high W-low)
- (` (let ((W-high (, W-high))
- (W-low (, W-low)))
- (setq S1W-high (+ (% (* W-high 2) 65536)
- (/ W-low (, (/ 65536 2)))))
- (setq S1W-low (+ (/ W-high (, (/ 65536 2)))
- (% (* W-low 2) 65536))))))
+ `(let ((W-high ,W-high)
+ (W-low ,W-low))
+ (setq S1W-high (+ (% (* W-high 2) 65536)
+ (/ W-low ,(/ 65536 2))))
+ (setq S1W-low (+ (/ W-high ,(/ 65536 2))
+ (% (* W-low 2) 65536)))))
(defmacro sha1-S5 (A-high A-low)
- (` (progn
- (setq S5A-high (+ (% (* (, A-high) 32) 65536)
- (/ (, A-low) (, (/ 65536 32)))))
- (setq S5A-low (+ (/ (, A-high) (, (/ 65536 32)))
- (% (* (, A-low) 32) 65536))))))
+ `(progn
+ (setq S5A-high (+ (% (* ,A-high 32) 65536)
+ (/ ,A-low ,(/ 65536 32))))
+ (setq S5A-low (+ (/ ,A-high ,(/ 65536 32))
+ (% (* ,A-low 32) 65536)))))
(defmacro sha1-S30 (B-high B-low)
- (` (progn
- (setq S30B-high (+ (/ (, B-high) 4)
- (* (% (, B-low) 4) (, (/ 65536 4)))))
- (setq S30B-low (+ (/ (, B-low) 4)
- (* (% (, B-high) 4) (, (/ 65536 4))))))))
+ `(progn
+ (setq S30B-high (+ (/ ,B-high 4)
+ (* (% ,B-low 4) ,(/ 65536 4))))
+ (setq S30B-low (+ (/ ,B-low 4)
+ (* (% ,B-high 4) ,(/ 65536 4))))))
(defmacro sha1-OP (round)
- (` (progn
- (sha1-S5 sha1-A-high sha1-A-low)
- (sha1-S30 sha1-B-high sha1-B-low)
- (setq sha1-A-low (+ ((, (intern (format "sha1-F%d" round)))
- sha1-B-low sha1-C-low sha1-D-low)
- sha1-E-low
- (, (symbol-value
- (intern (format "sha1-K%d-low" round))))
- (aref block-low idx)
- (progn
- (setq sha1-E-low sha1-D-low)
- (setq sha1-D-low sha1-C-low)
- (setq sha1-C-low S30B-low)
- (setq sha1-B-low sha1-A-low)
- S5A-low)))
- (setq carry (/ sha1-A-low 65536))
- (setq sha1-A-low (% sha1-A-low 65536))
- (setq sha1-A-high (% (+ ((, (intern (format "sha1-F%d" round)))
- sha1-B-high sha1-C-high sha1-D-high)
- sha1-E-high
- (, (symbol-value
- (intern (format "sha1-K%d-high" round))))
- (aref block-high idx)
- (progn
- (setq sha1-E-high sha1-D-high)
- (setq sha1-D-high sha1-C-high)
- (setq sha1-C-high S30B-high)
- (setq sha1-B-high sha1-A-high)
- S5A-high)
- carry)
- 65536)))))
+ `(progn
+ (sha1-S5 sha1-A-high sha1-A-low)
+ (sha1-S30 sha1-B-high sha1-B-low)
+ (setq sha1-A-low (+ (,(intern (format "sha1-F%d" round))
+ sha1-B-low sha1-C-low sha1-D-low)
+ sha1-E-low
+ ,(symbol-value
+ (intern (format "sha1-K%d-low" round)))
+ (aref block-low idx)
+ (progn
+ (setq sha1-E-low sha1-D-low)
+ (setq sha1-D-low sha1-C-low)
+ (setq sha1-C-low S30B-low)
+ (setq sha1-B-low sha1-A-low)
+ S5A-low)))
+ (setq carry (/ sha1-A-low 65536))
+ (setq sha1-A-low (% sha1-A-low 65536))
+ (setq sha1-A-high (% (+ (,(intern (format "sha1-F%d" round))
+ sha1-B-high sha1-C-high sha1-D-high)
+ sha1-E-high
+ ,(symbol-value
+ (intern (format "sha1-K%d-high" round)))
+ (aref block-high idx)
+ (progn
+ (setq sha1-E-high sha1-D-high)
+ (setq sha1-D-high sha1-C-high)
+ (setq sha1-C-high S30B-high)
+ (setq sha1-B-high sha1-A-high)
+ S5A-high)
+ carry)
+ 65536))))
(defmacro sha1-add-to-H (H X)
- (` (progn
- (setq (, (intern (format "sha1-%s-low" H)))
- (+ (, (intern (format "sha1-%s-low" H)))
- (, (intern (format "sha1-%s-low" X)))))
- (setq carry (/ (, (intern (format "sha1-%s-low" H))) 65536))
- (setq (, (intern (format "sha1-%s-low" H)))
- (% (, (intern (format "sha1-%s-low" H))) 65536))
- (setq (, (intern (format "sha1-%s-high" H)))
- (% (+ (, (intern (format "sha1-%s-high" H)))
- (, (intern (format "sha1-%s-high" X)))
- carry)
- 65536)))))
+ `(progn
+ (setq ,(intern (format "sha1-%s-low" H))
+ (+ ,(intern (format "sha1-%s-low" H))
+ ,(intern (format "sha1-%s-low" X))))
+ (setq carry (/ ,(intern (format "sha1-%s-low" H)) 65536))
+ (setq ,(intern (format "sha1-%s-low" H))
+ (% ,(intern (format "sha1-%s-low" H)) 65536))
+ (setq ,(intern (format "sha1-%s-high" H))
+ (% (+ ,(intern (format "sha1-%s-high" H))
+ ,(intern (format "sha1-%s-high" X))
+ carry)
+ 65536))))
)
;;; buffers (H0 H1 H2 H3 H4).
Index: lisp/md4.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/md4.el,v
retrieving revision 7.5
diff -u -r7.5 md4.el
--- lisp/md4.el 6 Jul 2005 06:42:01 -0000 7.5
+++ lisp/md4.el 6 Sep 2007 19:12:52 -0000
@@ -88,11 +88,10 @@
(defsubst md4-H (x y z) (logxor x y z))
(defmacro md4-make-step (name func)
- (`
- (defun (, name) (a b c d xk s ac)
+ `(defun ,name (a b c d xk s ac)
(let*
- ((h1 (+ (car a) ((, func) (car b) (car c) (car d)) (car xk) (car ac)))
- (l1 (+ (cdr a) ((, func) (cdr b) (cdr c) (cdr d)) (cdr xk) (cdr ac)))
+ ((h1 (+ (car a) (,func (car b) (car c) (car d)) (car xk) (car ac)))
+ (l1 (+ (cdr a) (,func (cdr b) (cdr c) (cdr d)) (cdr xk) (cdr ac)))
(h2 (logand 65535 (+ h1 (lsh l1 -16))))
(l2 (logand 65535 l1))
;; cyclic shift of 32 bits integer
@@ -102,7 +101,7 @@
(l3 (logand 65535 (if (> s 15)
(+ (lsh l2 (- s 32)) (lsh h2 (- s 16)))
(+ (lsh l2 s) (lsh h2 (- s 16)))))))
- (cons h3 l3)))))
+ (cons h3 l3))))
(md4-make-step md4-round1 md4-F)
(md4-make-step md4-round2 md4-G)
Index: lisp/hmac-def.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/hmac-def.el,v
retrieving revision 7.3
diff -u -r7.3 hmac-def.el
--- lisp/hmac-def.el 6 Jul 2005 06:42:01 -0000 7.3
+++ lisp/hmac-def.el 6 Sep 2007 19:12:52 -0000
@@ -39,46 +39,46 @@
B is a byte-length of a block size of H. (B=64 for both SHA1 and MD5.)
L is a byte-length of hash outputs. (L=16 for MD5, L=20 for SHA1.)
If BIT is non-nil, truncate output to specified bits."
- (` (defun (, name) (text key)
- (, (concat "Compute "
- (upcase (symbol-name name))
- " over TEXT with KEY."))
- (let ((key-xor-ipad (make-string (, B) ?\x36))
- (key-xor-opad (make-string (, B) ?\x5C))
- (len (length key))
- (pos 0))
- (unwind-protect
- (progn
- ;; if `key' is longer than the block size, apply hash function
- ;; to `key' and use the result as a real `key'.
- (if (> len (, B))
- (setq key ((, H) key)
- len (, L)))
- (while (< pos len)
- (aset key-xor-ipad pos (logxor (aref key pos) ?\x36))
- (aset key-xor-opad pos (logxor (aref key pos) ?\x5C))
- (setq pos (1+ pos)))
- (setq key-xor-ipad (unwind-protect
- (concat key-xor-ipad text)
- (fillarray key-xor-ipad 0))
- key-xor-ipad (unwind-protect
- ((, H) key-xor-ipad)
- (fillarray key-xor-ipad 0))
- key-xor-opad (unwind-protect
- (concat key-xor-opad key-xor-ipad)
- (fillarray key-xor-opad 0))
- key-xor-opad (unwind-protect
- ((, H) key-xor-opad)
- (fillarray key-xor-opad 0)))
- ;; now `key-xor-opad' contains
- ;; H(KEY XOR opad, H(KEY XOR ipad, TEXT)).
- (, (if (and bit (< (/ bit 8) L))
- (` (substring key-xor-opad 0 (, (/ bit 8))))
- ;; return a copy of `key-xor-opad'.
- (` (concat key-xor-opad)))))
- ;; cleanup.
- (fillarray key-xor-ipad 0)
- (fillarray key-xor-opad 0))))))
+ `(defun ,name (text key)
+ ,(concat "Compute "
+ (upcase (symbol-name name))
+ " over TEXT with KEY.")
+ (let ((key-xor-ipad (make-string ,B ?\x36))
+ (key-xor-opad (make-string ,B ?\x5C))
+ (len (length key))
+ (pos 0))
+ (unwind-protect
+ (progn
+ ;; if `key' is longer than the block size, apply hash function
+ ;; to `key' and use the result as a real `key'.
+ (if (> len ,B)
+ (setq key (,H key)
+ len ,L))
+ (while (< pos len)
+ (aset key-xor-ipad pos (logxor (aref key pos) ?\x36))
+ (aset key-xor-opad pos (logxor (aref key pos) ?\x5C))
+ (setq pos (1+ pos)))
+ (setq key-xor-ipad (unwind-protect
+ (concat key-xor-ipad text)
+ (fillarray key-xor-ipad 0))
+ key-xor-ipad (unwind-protect
+ (,H key-xor-ipad)
+ (fillarray key-xor-ipad 0))
+ key-xor-opad (unwind-protect
+ (concat key-xor-opad key-xor-ipad)
+ (fillarray key-xor-opad 0))
+ key-xor-opad (unwind-protect
+ (,H key-xor-opad)
+ (fillarray key-xor-opad 0)))
+ ;; now `key-xor-opad' contains
+ ;; H(KEY XOR opad, H(KEY XOR ipad, TEXT)).
+ ,(if (and bit (< (/ bit 8) L))
+ `(substring key-xor-opad 0 ,(/ bit 8))
+ ;; return a copy of `key-xor-opad'.
+ `(concat key-xor-opad)))
+ ;; cleanup.
+ (fillarray key-xor-ipad 0)
+ (fillarray key-xor-opad 0)))))
(provide 'hmac-def)
Index: lisp/hex-util.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/hex-util.el,v
retrieving revision 7.6
diff -u -r7.6 hex-util.el
--- lisp/hex-util.el 24 Jan 2007 07:15:37 -0000 7.6
+++ lisp/hex-util.el 6 Sep 2007 19:12:52 -0000
@@ -29,14 +29,14 @@
(eval-when-compile
(defmacro hex-char-to-num (chr)
- (` (let ((chr (, chr)))
- (cond
- ((and (<= ?a chr)(<= chr ?f)) (+ (- chr ?a) 10))
- ((and (<= ?A chr)(<= chr ?F)) (+ (- chr ?A) 10))
- ((and (<= ?0 chr)(<= chr ?9)) (- chr ?0))
- (t (error "Invalid hexadecimal digit `%c'" chr))))))
+ `(let ((chr ,chr))
+ (cond
+ ((and (<= ?a chr)(<= chr ?f)) (+ (- chr ?a) 10))
+ ((and (<= ?A chr)(<= chr ?F)) (+ (- chr ?A) 10))
+ ((and (<= ?0 chr)(<= chr ?9)) (- chr ?0))
+ (t (error "Invalid hexadecimal digit `%c'" chr)))))
(defmacro num-to-hex-char (num)
- (` (aref "0123456789abcdef" (, num)))))
+ `(aref "0123456789abcdef" ,num)))
(defun decode-hex-string (string)
"Decode hexadecimal STRING to octet string."
Index: lisp/gnus-salt.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-salt.el,v
retrieving revision 7.12
diff -u -r7.12 gnus-salt.el
--- lisp/gnus-salt.el 24 Jan 2007 07:15:37 -0000 7.12
+++ lisp/gnus-salt.el 6 Sep 2007 19:12:54 -0000
@@ -138,7 +138,7 @@
(set-buffer gnus-summary-buffer)
gnus-pick-mode))
(message-add-action
- '(gnus-configure-windows ,gnus-current-window-configuration t)
+ `(gnus-configure-windows ,gnus-current-window-configuration t)
'send 'exit 'postpone 'kill)))
(defvar gnus-pick-line-number 1)
Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 7.1609
diff -u -r7.1609 ChangeLog
--- lisp/ChangeLog 5 Sep 2007 09:52:39 -0000 7.1609
+++ lisp/ChangeLog 6 Sep 2007 19:13:12 -0000
@@ -1,3 +1,15 @@
+2007-09-06 Tassilo Horn <tassilo@member.fsf.org>
+
+ * gnus-salt.el: Switch from old-style to new-style backquotes.
+
+ * hmac-def.el: likewise.
+
+ * md4.el: likewise.
+
+ * sha1.el: likewise.
+
+ * hex-util.el: likewise.
+
2007-09-05 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-cus.el (gnus-score-extra): New widget.
--8<---------------cut here---------------end--------------->8---
Bye,
Tassilo
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Patch: Remove old-style backquotes in all files
2007-09-06 19:14 Patch: Remove old-style backquotes in all files Tassilo Horn
@ 2007-09-06 22:48 ` Katsumi Yamaoka
0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2007-09-06 22:48 UTC (permalink / raw)
To: ding
>>>>> Tassilo Horn wrote:
> this patch deletes all old-style backquotes which produce ugly warning
> messages when compiling gnus with a current CVS emacs.
For sha1.el and hex-util.el this has already been done in Emacs
CVS and the v5-10 branch:
2007-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
* sha1.el: Fix up comment style.
(sha1-F0, sha1-F1, sha1-F2, sha1-F3, sha1-S1, sha1-S5, sha1-S30)
(sha1-OP, sha1-add-to-H): Use new-style backquotes.
* hex-util.el: Fix up comment style.
(hex-char-to-num, num-to-hex-char): Use new-style backquotes.
* gnus-salt.el: Use with-current-buffer.
(gnus-pick-setup-message): Fix long-standing typo.
So, I planned to do it for md4.el and hmac-def.el after those
changes and the others[1] are merged to the Gnus trunk. Miles?
[1] http://news.gmane.org/group/gmane.emacs.gnus.general/thread=65117
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-06 22:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-06 19:14 Patch: Remove old-style backquotes in all files Tassilo Horn
2007-09-06 22:48 ` Katsumi Yamaoka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).