From: ueno Date: Wed, 25 Oct 2006 03:24:18 +0000 (+0000) Subject: (mixi-time-less-p): Normalize encoded time. X-Git-Tag: cache-file-branchpoint~35 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d6687b990d7f728ea728682e3a1c9b75b5909f2f;p=elisp%2Fmixi.git (mixi-time-less-p): Normalize encoded time. (mixi-time-add): Ditto. --- diff --git a/ChangeLog b/ChangeLog index ee440e0..dc1ebf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-25 Daiki Ueno + + * mixi.el (mixi-time-less-p): Normalize encoded time. + (mixi-time-add): Ditto. + 2006-10-24 OHASHI Akira * mixi.el (mixi-object-timestamp): New accessor method. diff --git a/mixi.el b/mixi.el index bcfcef8..922adf5 100644 --- a/mixi.el +++ b/mixi.el @@ -378,12 +378,20 @@ Increase this value when unexpected error frequently occurs." ;; stolen from time-date.el (defun mixi-time-less-p (t1 t2) "Say whether time value T1 is less than time value T2." + (unless (numberp (cdr t1)) + (setq t1 (cons (car t1) (cdr t1)))) + (unless (numberp (cdr t2)) + (setq t2 (cons (car t2) (cdr t2)))) (or (< (car t1) (car t2)) (and (= (car t1) (car t2)) (< (nth 1 t1) (nth 1 t2))))) (defun mixi-time-add (t1 t2) "Add two time values. One should represent a time difference." + (unless (numberp (cdr t1)) + (setq t1 (cons (car t1) (cdr t1)))) + (unless (numberp (cdr t2)) + (setq t2 (cons (car t2) (cdr t2)))) (let ((low (+ (cdr t1) (cdr t2)))) (cons (+ (car t1) (car t2) (lsh low -16)) low)))