public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Non-urgent issue with fs/isofs/util.c
       [not found] <19980918151457.C9740@harvestroad.com.au>
@ 1998-09-18  9:34 ` Helge Hafting
  0 siblings, 0 replies; only message in thread
From: Helge Hafting @ 1998-09-18  9:34 UTC (permalink / raw)
  To: Ian McKellar; +Cc: linux-kernel

In <19980918151457.C9740@harvestroad.com.au>, on 09/18/98 
   at 03:14 PM, Ian McKellar <imckellar@harvestroad.com.au> said:


>Hi,

>The iso_date function in fs/isofs/util.c doesn't correctly handle leap
>years.

>Well, it doesn't handle the year 2100 - which according to the code is a
>leap year, but according to the commonly accepted rules is not.

>I don't think we need to be to concerned right now, but changing:
>         if (((year+2) % 4) == 0 && month > 2)
>to:
>             if (((year+2) % 4) == 0 && month > 2 && year != 130) should
>fix it.
The equivalent code
              if (!((year+2) & 3) && month > 2 && year != 130) is probably
faster.  The somewhat expensive mod operator is 
replaced by a bitwise "and", that is faster on most platforms.

Helge Hafting
-- 
-----------------------------------------------------------
helge.hafting@daldata.no
-----------------------------------------------------------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-09-18  5:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <19980918151457.C9740@harvestroad.com.au>
1998-09-18  9:34 ` Non-urgent issue with fs/isofs/util.c Helge Hafting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox