From larry at theclapp.org Mon Mar 23 13:56:55 2009 From: larry at theclapp.org (Larry Clapp) Date: Mon, 23 Mar 2009 09:56:55 -0400 Subject: [local-time-devel] darcs patch: Work with Lispworks Message-ID: A non-text attachment was scrubbed... Name: not available Type: multipart/mixed Size: 1 bytes Desc: not available URL: From mathrick at gmail.com Fri Mar 13 20:31:21 2009 From: mathrick at gmail.com (Maciej Katafiasz) Date: Fri, 13 Mar 2009 20:31:21 -0000 Subject: [local-time-devel] Bugfix: nsec overflows fixnum on 32-bit archs Message-ID: <50b7e5180903131308m414a3953ic83c3cbc05d612d5@mail.gmail.com> Hi, here's a bugfix for one issue that hit me on 32-bit SBCL. Since MOST-POSITIVE-FIXNUM is less than 10^9, nanoseconds can overflow a fixnum. This means that WITH-DECODED-TIMESTAMP (and by extension, ADJUST-TIMESTAMP) would fail randomly. The patch conditionalises the type declaration on whether a fixnum can hold all the required bits. ========================= Fri Mar 13 20:47:25 CET 2009 Maciej Katafiasz * Don't declare NSEC as FIXNUM if MOST-POSITIVE-FIXNUM is smaller than 10^9 New patches: [Don't declare NSEC as FIXNUM if MOST-POSITIVE-FIXNUM is smaller than 10^9 Maciej Katafiasz **20090313194725] hunk ./src/local-time.lisp 600 :collect `(when ,var (push `(type fixnum ,,var) types))) (setf types (nreverse types))))) - (declare-fixnum-type nsec sec minute hour day month year) + (if (> most-positive-fixnum (expt 10 9)) + (declare-fixnum-type nsec sec minute hour day month year) + ;; Don't overflow on 32-bit archs + (declare-fixnum-type sec minute hour day month year)) (initialize nsec sec minute hour day month year day-of-week daylight-p)) `(multiple-value-bind (, at variables) (decode-timestamp ,timestamp :timezone ,(or timezone '*default-timezone*)) Context: [document the interpretation of day-of-week attila.lendvai at gmail.com**20081223002624 Ignore-this: 26bf6ba060df9684a5e60a9464adcfb0 ] [follow :weekday change in the manual attila.lendvai at gmail.com**20081223002030 Ignore-this: 6b303376bed4e880911ce5e3e0f4d037 ] [fix :weekday support for format-timestamp attila.lendvai at gmail.com**20081223000411 Ignore-this: af6abab43e3d60e97a24a627982e09cd ] [TAG 2008-11-27 attila.lendvai at gmail.com**20081127150407 Ignore-this: 9d6f3d956cb6436e69f285ffeaa41207 ] Patch bundle hash: 6b718dd74706d43e533c3490396cd8624e41c5c0