|
Post by Sephiroth X on Dec 31, 2008 14:30:14 GMT -5
|
|
|
Post by remixedcat on Dec 31, 2008 19:04:29 GMT -5
why was that last post deleted it was important for people to know that!
glad I didnt get a zune. LOLz.
|
|
|
Post by whicker on Jan 4, 2009 0:32:12 GMT -5
//------------------------------------------------------------------------------ // // Copyright (C) 2004-2007, Freescale Semiconductor, Inc. All Rights Reserved. // THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS // AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT // //------------------------------------------------------------------------------ // // Module: rtc.c // // PQOAL Real-time clock (RTC) routines for the MC13783 PMIC RTC. // //------------------------------------------------------------------------------
...snip...
BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime) { int dayofweek, month, year; UINT8 *month_tab;
//Calculate current day of the week dayofweek = GetDayOfWeek(days);
year = ORIGINYEAR;
while (days > 365) { if (IsLeapYear(year)) { if (days > 366) { days -= 366; year += 1; } } else { days -= 365; year += 1; } }
...etc.
it isn't always m$ fault. many chip manufacturers provide helper source code to make it easier to use in a final product. but yes, infinite while loops are very bad.
|
|
|
Post by remixedcat on Jan 4, 2009 11:49:02 GMT -5
Nice find!
|
|