aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-30 21:36:40 -0700
committerPaul Eggert2011-06-30 21:36:40 -0700
commit2f81380d8da399d5c2af874f553570702b91b448 (patch)
tree6c76eec7b106234ff21492bc0f75ed2d94834ea5
parent845b5c3e2ac139e8697861c6bf6fbd281dacf914 (diff)
downloademacs-2f81380d8da399d5c2af874f553570702b91b448.tar.gz
emacs-2f81380d8da399d5c2af874f553570702b91b448.zip
* type-break.el (type-break-time-sum): Rewrite using time-add.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/type-break.el30
2 files changed, 7 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index be24c21cc58..4b067b043ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12011-07-01 Paul Eggert <eggert@cs.ucla.edu> 12011-07-01 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * type-break.el (type-break-time-sum): Rewrite using time-add.
4
3 * play/hanoi.el (hanoi-current-time-float): Remove. 5 * play/hanoi.el (hanoi-current-time-float): Remove.
4 All uses replaced by float-time. 6 All uses replaced by float-time.
5 7
diff --git a/lisp/type-break.el b/lisp/type-break.el
index 58022ef8813..a41fb1d423f 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -1008,34 +1008,14 @@ FRAC should be the inverse of the fractional value; for example, a value of
1008;; the result is passed to `current-time-string' it will toss some of the 1008;; the result is passed to `current-time-string' it will toss some of the
1009;; "low" bits and format the time incorrectly. 1009;; "low" bits and format the time incorrectly.
1010(defun type-break-time-sum (&rest tmlist) 1010(defun type-break-time-sum (&rest tmlist)
1011 (let ((high 0) 1011 (let ((sum '(0 0 0)))
1012 (low 0)
1013 (micro 0)
1014 tem)
1015 (while tmlist 1012 (while tmlist
1016 (setq tem (car tmlist)) 1013 (setq tem (car tmlist))
1017 (setq tmlist (cdr tmlist)) 1014 (setq tmlist (cdr tmlist))
1018 (cond 1015 (setq sum (time-add sum (if (integerp tem)
1019 ((numberp tem) 1016 (list (floor tem 65536) (mod tem 65536))
1020 (setq low (+ low tem))) 1017 tem))))
1021 (t 1018 sum))
1022 (setq high (+ high (or (car tem) 0)))
1023 (setq low (+ low (or (car (cdr tem)) 0)))
1024 (setq micro (+ micro (or (car (cdr (cdr tem))) 0))))))
1025
1026 (and (>= micro 1000000)
1027 (progn
1028 (setq tem (/ micro 1000000))
1029 (setq low (+ low tem))
1030 (setq micro (- micro (* tem 1000000)))))
1031
1032 (setq tem (lsh low -16))
1033 (and (> tem 0)
1034 (progn
1035 (setq low (logand low 65535))
1036 (setq high (+ high tem))))
1037
1038 (list high low micro)))
1039 1019
1040(defun type-break-time-stamp (&optional when) 1020(defun type-break-time-stamp (&optional when)
1041 (if (fboundp 'format-time-string) 1021 (if (fboundp 'format-time-string)