uint64_t timestamp, struct ras_time *tm)
{
int days_in_month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- uint64_t month = 0, day = 0, hour = 0, minute = 0, second = 0;
+ uint64_t month = 0, day = 0, hour = 0, minute = 0, second = 0, remainder;
uint32_t year = 0;
int seconds_per_day = 24 * 60 * 60;
int seconds_per_hour = 60 * 60;
int seconds_per_minute = 60;
int days, remaining_seconds;
- days = div64_u64_rem(timestamp, seconds_per_day, (uint64_t *)&remaining_seconds);
+ days = div64_u64_rem(timestamp, seconds_per_day, &remainder);
+ /* remainder will always be less than seconds_per_day. */
+ remaining_seconds = remainder;
/* utc_timestamp follows the Unix epoch */
year = 1970;