# HG changeset patch # User jwe # Date 974395535 0 # Node ID ac4609ffc702bf36335357a3872e066a685a2443 # Parent cf69dbe17e596409b9cb901384f8a19fab0c825f [project @ 2000-11-16 17:25:34 by jwe] diff -r cf69dbe17e59 -r ac4609ffc702 liboctave/ChangeLog --- a/liboctave/ChangeLog Sat Nov 04 05:29:09 2000 +0000 +++ b/liboctave/ChangeLog Thu Nov 16 17:25:35 2000 +0000 @@ -1,3 +1,8 @@ +2000-11-16 Paul Kienzle + + * oct-time.cc (DEFINE_SET_INT_FIELD_FCN): Don't check limits here, + since mktime is supposed to `normalize' the results for us. + 2000-10-31 Paul Kienzle * Array2.cc (Array2::transpose): Avoid copy for empty matrices diff -r cf69dbe17e59 -r ac4609ffc702 liboctave/oct-time.cc --- a/liboctave/oct-time.cc Sat Nov 04 05:29:09 2000 +0000 +++ b/liboctave/oct-time.cc Thu Nov 16 17:25:35 2000 +0000 @@ -97,6 +97,20 @@ #endif } +// From the mktime() manual page: +// +// The mktime() function converts a broken-down time structure, +// expressed as local time, to calendar time representation. +// +// +// +// If structure members are outside their legal interval, they +// will be normalized (so that, e.g., 40 October is changed into +// 9 November). +// +// So, we no longer check limits here. + +#if 0 #define DEFINE_SET_INT_FIELD_FCN(f, lo, hi) \ octave_base_tm& \ octave_base_tm::f (int v) \ @@ -109,6 +123,16 @@ \ return *this; \ } +#else +#define DEFINE_SET_INT_FIELD_FCN(f, lo, hi) \ + octave_base_tm& \ + octave_base_tm::f (int v) \ + { \ + tm_ ## f = v; \ + \ + return *this; \ + } +#endif DEFINE_SET_INT_FIELD_FCN (usec, 0, 1000000) DEFINE_SET_INT_FIELD_FCN (sec, 0, 61)