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

Function getsave

zic.c:2117–2133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2115 for times of day and for UT offsets in TZif files, and it
2116 avoids later problems during arithmetic on these numbers,
2117 as stringzone can compute up to 3 times one of these values
2118 when computing fake timezones, and stringrule can do a bit more.
2119 Do not limit R strictly to 32 bits here, as it is OK to go
2120 over the TZif limit temporarily so long as the result fits. */
2121 omul(r, 4);
2122 /* Discard omul's return value, as it is not needed here. */
2123
2124 return r;
2125}
2126
2127static zic_t
2128getsave(char *field, bool *isdst)
2129{
2130 int dst = -1;
2131 zic_t save;
2132 ptrdiff_t fieldlen = strlen(field);
2133 if (fieldlen != 0) {
2134 char *ep = field + fieldlen - 1;
2135 switch (*ep) {
2136 case 'd': dst = 1; *ep = '\0'; break;

Callers 2

associateFunction · 0.85
inruleFunction · 0.85

Calls 1

gethmsFunction · 0.85

Tested by

no test coverage detected