From: Paul Eggert Date: Fri, 1 Jul 2011 04:36:40 +0000 (-0700) Subject: * type-break.el (type-break-time-sum): Rewrite using time-add. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2f81380d8da399d5c2af874f553570702b91b448;p=emacs.git * type-break.el (type-break-time-sum): Rewrite using time-add. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be24c21cc58..4b067b043ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2011-07-01 Paul Eggert + * type-break.el (type-break-time-sum): Rewrite using time-add. + * play/hanoi.el (hanoi-current-time-float): Remove. All uses replaced by float-time. 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 ;; the result is passed to `current-time-string' it will toss some of the ;; "low" bits and format the time incorrectly. (defun type-break-time-sum (&rest tmlist) - (let ((high 0) - (low 0) - (micro 0) - tem) + (let ((sum '(0 0 0))) (while tmlist (setq tem (car tmlist)) (setq tmlist (cdr tmlist)) - (cond - ((numberp tem) - (setq low (+ low tem))) - (t - (setq high (+ high (or (car tem) 0))) - (setq low (+ low (or (car (cdr tem)) 0))) - (setq micro (+ micro (or (car (cdr (cdr tem))) 0)))))) - - (and (>= micro 1000000) - (progn - (setq tem (/ micro 1000000)) - (setq low (+ low tem)) - (setq micro (- micro (* tem 1000000))))) - - (setq tem (lsh low -16)) - (and (> tem 0) - (progn - (setq low (logand low 65535)) - (setq high (+ high tem)))) - - (list high low micro))) + (setq sum (time-add sum (if (integerp tem) + (list (floor tem 65536) (mod tem 65536)) + tem)))) + sum)) (defun type-break-time-stamp (&optional when) (if (fboundp 'format-time-string)