From 4938e017c7705c6c3b750f9a06b015d4a55da1bf Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Sun, 25 Dec 2022 12:14:33 +0000 Subject: [PATCH] TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. gcl (2.6.13-2) unstable; urgency=medium * Version_2_6_14pre1 Gbp-Pq: Name Version_2_6_14pre1 --- git.tag | 2 +- lsp/gcl_mislib.lsp | 27 ++++++++++++++++++--------- release | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/git.tag b/git.tag index 67dfda8..b9b4539 100644 --- a/git.tag +++ b/git.tag @@ -1,2 +1,2 @@ -"Version_2_6_13" +"Version_2_6_14pre1" diff --git a/lsp/gcl_mislib.lsp b/lsp/gcl_mislib.lsp index 7ea572f..70d84ef 100755 --- a/lsp/gcl_mislib.lsp +++ b/lsp/gcl_mislib.lsp @@ -72,8 +72,8 @@ (mmd +md+) (mmd +lmd+ t) -(defun decode-universal-time (ut &optional (tz (current-timezone) tzp) - &aux (dstp (unless tzp (current-dstp))) (ut (- ut (* tz 3600)))) +(defun decode-universal-time (ut &optional (tz (let ((x (current-timezone))) (if (current-dstp) (1+ x) x)) tzp) + &aux (out ut)(ut (- ut (* tz 3600)))) (declare (optimize (safety 2))) (check-type ut integer) (check-type tz rational) @@ -81,19 +81,28 @@ (d ut) (floor ut seconds-per-day) (let* ((dow (mod d 7))(y (+ 1900 (floor d 366)))) (labels ((l (y dd &aux (lyp (leap-year-p y))(td (if lyp 366 365))(x (- d dd))) - (if (< x td) (values (1+ x) y lyp) (l (1+ y) (+ dd td))))) + (if (< x td) (values (1+ x) y lyp) (l (1+ y) (+ dd td))))) (multiple-value-bind (d y lyp) (l y (number-of-days-from-1900 y)) (let* ((l (if lyp +lmd+ +md+)) (m (position d l :test '<=)) (d (if (> m 0) (- d (aref l (1- m))) d))) (multiple-value-bind - (h ut) (floor ut 3600) - (multiple-value-bind - (min sec) (floor ut 60) - (values sec min h d (1+ m) y dow dstp tz))))))))) - -(defun encode-universal-time (sec min h d m y &optional (tz (current-timezone))) + (h ut) (floor ut 3600) + (labels ((nsdom (d dow n) (+ (mod (- d dow 1) 7) (* (1- n) 7))) + (dstp (dow d m h) + (cond ((> 10 m 2)) + ((eql m 2) (let ((s (nsdom d dow 2))) (or (> d s) (when (= d s) (>= h 2))))) + ((eql m 10) (let ((s (nsdom d dow 1))) (or (< d s) (when (= d s) (< h 1)))))))) + (if (unless tzp (dstp dow d m h)) + (multiple-value-bind + (s m h d o y w) (decode-universal-time out (1- tz)) + (values s m h d o y w t tz)) + (multiple-value-bind + (min sec) (floor ut 60) + (values sec min h d (1+ m) y dow nil tz))))))))))) + +(defun encode-universal-time (sec min h d m y &optional (tz (let ((x (current-timezone))) (if (current-dstp) (1+ x) x)))) (declare (optimize (safety 2))) (check-type sec (integer 0 59)) (check-type min (integer 0 59)) diff --git a/release b/release index 5b75dc6..fd3efff 100644 --- a/release +++ b/release @@ -1 +1 @@ -Fri Apr 22 15:51:11 UTC 2016 +Tue Dec 20 16:07:00 UTC 2022 -- 2.30.2