Also, who hard-codes magic numbers like that? So many things wrong with this picture.Via jstn.
while (days > 365) { if (IsLeapYear(year)) { if (days > 366) { days -= 366; year += 1; } } else { days -= 365; year += 1; } }Out of curiosity, why was this being rewritten by Freescale or Microsoft at all? This has been a solved problem for a very long time.
(Also, this is very ugly C style in many places. I expected better from Microsoft.)
Comments (View) | 1 year ago