MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / increment_overflow_time

Function increment_overflow_time

src/date.cpp:467–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465 }
466
467 static int increment_overflow_time(time_t *tp, int_fast32_t j) { // #nocov start
468 /*
469 ** This is like
470 ** 'if (! (time_t_min <= *tp + j && *tp + j <= time_t_max)) ...',
471 ** except that it does the right thing even if *tp + j would overflow.
472 */
473 if (! (j < 0
474 ? (TYPE_SIGNED(time_t) ? time_t_min - j <= *tp : -1 - j < *tp)
475 : *tp <= time_t_max - j))
476 return TRUE;
477 *tp += j;
478 return FALSE;
479 }
480
481 static int_fast32_t detzcode(const char *const codep) {
482 int_fast32_t result = (codep[0] & 0x80) ? -1 : 0;

Callers 1

tzparseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected