| 168 | |
| 169 | |
| 170 | void RarTime::SetUnix(time_t ut) |
| 171 | { |
| 172 | if (sizeof(ut)>4) |
| 173 | SetUnixNS(uint64(ut)*1000000000); |
| 174 | else |
| 175 | { |
| 176 | // Convert 32-bit and possibly signed time_t to uint32 first, |
| 177 | // uint64 cast is not enough. Otherwise sign can expand to 64 bits. |
| 178 | SetUnixNS(uint64(uint32(ut))*1000000000); |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | |
| 183 | // Get the high precision Unix time in nanoseconds since 01-01-1970. |
no outgoing calls
no test coverage detected