summaryrefslogtreecommitdiffstats
path: root/src/time64.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-22[clang-tidy] Avoid global non-const variablesGravatar Rosen Penev1-2/+2
Found with cppcoreguidelines-avoid-non-const-global-variables Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-24time64: Remove code duplication in separate if branches by combining the ↵Gravatar Rosen Penev1-6/+1
conditions [clang-tidy] Found with bugprone-branch-clone Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-24Improve code readability by not using else after returnGravatar Rosen Penev1-16/+10
[clang-tidy] Found with readability-else-after-return Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-08Remove whitespace errors from all filesGravatar Martin Szulecki1-7/+7
2020-05-14time64: Silence compiler warnings about shadowed variable declarationsGravatar Nikias Bassen1-29/+29
2020-04-21time64/ctime64_r: localtime64_r can failGravatar Derrick Lyndon Pallas1-1/+3
In ctime64_r, the call to localtime64_r can fail. If we don't check for this and then call asctime64_r, the results are garbage. Signed-off-by: Derrick Lyndon Pallas <derrick@pallas.us>
2017-04-14Initialize safe_year in time64.cGravatar Greg Dennis1-2/+2
Clang fails with stricter compilation options, because it thinks safe_year may be uninitialized at the return statement. The logic prevents it from being uninitialized, but probably worth the initialization to avoid the compiler error. The rest of libimobiledevice compiles successfully under the same options.
2017-01-03time64: Remove some unused (and non-thread-safe) functionsGravatar Nikias Bassen1-24/+0
2016-09-19Use time64 implementation by Michael G Schwern to extend allowed date/time rangeGravatar Nikias Bassen1-0/+836
The main benefit of this is to allow date/time values outside of the 32bit time_t range which is very important on 32bit platforms. But there are also some other issues that will be fixed with this, for example on macOS, mktime() will not work for dates < 1902 despite time_t being 64bit. In the same run this commit will also use a reentrant version of gmtime64_r that should help in multithreaded scenarios. Original code taken from: https://github.com/evalEmpire/y2038