mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-28 08:14:39 +02:00
Cosmetic changes
This commit is contained in:
parent
a55f17b77a
commit
a52de0d335
@ -140,18 +140,18 @@ unsigned int bit_revert(unsigned int v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Custom timegm function made by Eric S Raymond */
|
/* Custom timegm function made by Eric S Raymond */
|
||||||
time_t c_timegm(register struct tm *t)
|
time_t c_timegm(struct tm *t)
|
||||||
{
|
{
|
||||||
long year;
|
long year;
|
||||||
time_t result;
|
time_t result;
|
||||||
|
|
||||||
#define MONTHS_PER_YEAR 12 /* Months per calendar year */
|
#define MONTHS_PER_YEAR 12 /* Months per calendar year */
|
||||||
|
|
||||||
static const int cumdays[MONTHS_PER_YEAR] =
|
static const int cdays[MONTHS_PER_YEAR] =
|
||||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
|
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
|
||||||
|
|
||||||
year = 1900 + t->tm_year + t->tm_mon / MONTHS_PER_YEAR;
|
year = 1900 + t->tm_year + t->tm_mon / MONTHS_PER_YEAR;
|
||||||
result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHS_PER_YEAR];
|
result = (year - 1970) * 365 + cdays[t->tm_mon % MONTHS_PER_YEAR];
|
||||||
result += (year - 1968) / 4;
|
result += (year - 1968) / 4;
|
||||||
result -= (year - 1900) / 100;
|
result -= (year - 1900) / 100;
|
||||||
result += (year - 1600) / 400;
|
result += (year - 1600) / 400;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user