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

Function oadd

zic.c:4067–4080  ·  view source on GitHub ↗

Return T1 + T2, but diagnose any overflow and exit. */

Source from the content-addressed store, hash-verified

4065 exit(EXIT_FAILURE);
4066}
4067
4068/* Return T1 + T2, but diagnose any overflow and exit. */
4069ATTRIBUTE_PURE_114833_HACK
4070static zic_t
4071oadd(zic_t t1, zic_t t2)
4072{
4073#ifdef ckd_add
4074 zic_t sum;
4075 if (!ckd_add(&sum, t1, t2))
4076 return sum;
4077#else
4078 if (t1 < 0 ? ZIC_MIN - t1 <= t2 : t2 <= ZIC_MAX - t1)
4079 return t1 + t2;
4080#endif
4081 time_overflow();
4082}
4083

Callers 5

gethmsFunction · 0.85
getleapdatetimeFunction · 0.85
adjleapFunction · 0.85
taddFunction · 0.85
rpytimeFunction · 0.85

Calls 1

time_overflowFunction · 0.85

Tested by

no test coverage detected