MCPcopy Create free account
hub / github.com/eggert/tz / tmcomp

Function tmcomp

localtime.c:2555–2569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2553{
2554 int_fast64_t aa = a;
2555 return aa - b;
2556}
2557
2558static int
2559tmcomp(register const struct tm *const atmp,
2560 register const struct tm *const btmp)
2561{
2562 register int result;
2563
2564 if (atmp->tm_year != btmp->tm_year)
2565 return atmp->tm_year < btmp->tm_year ? -1 : 1;
2566 if ((result = (atmp->tm_mon - btmp->tm_mon)) == 0 &&
2567 (result = (atmp->tm_mday - btmp->tm_mday)) == 0 &&
2568 (result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
2569 (result = (atmp->tm_min - btmp->tm_min)) == 0)
2570 result = atmp->tm_sec - btmp->tm_sec;
2571 return result;
2572}

Callers 1

time2subFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected