Re: [PATCH 03/11] cal: clean up use of constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29 April 2013 16:51, Thomas Bächler <thomas@xxxxxxxxxxxxx> wrote:
> Am 28.04.2013 19:10, schrieb Sami Kerola:
>> +#define      FIRST_WEEKDAY           SATURDAY        /* Jan 1st, 1 was a Saturday */
>> +#define      REFORMATION_WEEKDAY     TUESDAY         /* after reformation it was Thursday */
>
> The constant says Tuesday, the comment says Thursday. You should maybe
> double-check the rest of the constants, too.

Thanks Thomas, good catch... although probably not quite what you expected.

I started to wondering why test suite did not catch this. After gazing
code for moment I decided recompile with coverage turned on. Results
were very clear. Not a once the REFORMATION_WEEKDAY was returned. That
puzzled me for some while, until I realized the September 1752 are
never evaluated with day_in_week(), the day_array() is short cutting
that evaluation by setting the short month with memcpy().

>From the original patch REFORMATION_WEEKDAY is removed, and where that
value was returned there is now abort(). Additionally I think the
day_in_week() can be simplified, which I will do as a separated
change.

--
   Sami Kerola
   http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux