Commit Graph

19 Commits

Author SHA1 Message Date
Andrew Gaul f041812939
Revert "Call C++11 get_time and put_time (#2375)" (#2381)
This reverts commit 10a72bfd0f.  These
commit is incompatible with older CentOS 7 libstdc++.
2023-11-27 00:51:17 +09:00
Andrew Gaul 10a72bfd0f
Call C++11 get_time and put_time (#2375)
This removes workarounds and fixed-length buffers.
2023-11-20 18:45:27 +09:00
Andrew Gaul 4845831f93
Convert some const to constexpr (#2342)
This guarantees that the function or value will resolve at compile-time.
2023-11-14 22:15:17 +09:00
Takeshi Nakatani a25cb9e07a
Fixed a bug when reading a reduced file without flushing (#2133) 2023-03-26 11:45:21 +09:00
Garen Chan 9d00b8d4a8
Fixed segmentation fault caused by file write failure (#2123) 2023-03-11 16:45:56 +09:00
Andrew Gaul 2186317676 Include missing ctime header
This caused compilation errors on Fedora 36.
2022-09-01 22:40:16 +09:00
Andrew Gaul 48e9e51f4f
Remove more unneeded headers identified by IWYU (#2011) 2022-07-30 12:06:47 +09:00
Andrew Gaul 01a92476e6
Remove unneeded headers identified by IWYU (#2007) 2022-07-28 23:38:38 +09:00
Andrew Gaul b52f916af6
Avoid extended initializer lists in C++03 (#1960)
C++11 introduces these.
2022-06-12 23:52:16 +09:00
Naoki Ikeguchi 581f5c0356 Move strptime polyfill to string_util 2022-01-23 21:49:51 +09:00
Naoki Ikeguchi b14e39815b Use polyfills in MSYS2 environment 2022-01-23 21:49:51 +09:00
Andrew Gaul b8724425d3
Require explicit base parameter in cvt_strtoofft (#1683)
Also convert most callers of cvt_strtoofft to base 10 which avoid the
magical behavior of interpreting a leading 0 as octal.
References #1682.
2021-06-20 11:00:15 +09:00
Carsten Grohmann 7a488b93d0 Set decimal base for converting subseconds to int
The leading 0 triggers an automatic conversion as an octal value. This
fails because it is a decimal value.

Setting the base to 10 prevents this automatism and treats the value
as a decimal value.

Fixes: [WAN] string_util.cpp:cvt_strtoofft(96): something error is occurred in convert std::string(017080564) to off_t, thus return 0 as default.

Related to #1676
2021-06-17 06:27:02 +09:00
Andrew Gaul 600cee118d
Fix implicit narrowing conversions (#1672)
These do not appear to be problematic but rather just clean up warnings.
Found via clang -Wshorten-64-to-32.
2021-06-13 12:50:07 +09:00
Andrew Gaul 7f3e423bbe
Preserve sub-second time precision (#1624)
Found via pjdfstests.  References #897.  References #1589.
2021-04-18 13:11:12 +09:00
Andrew Gaul d019dda4f7
Simplify substr manipulations with erase (#1532)
This avoids creating a new std::string.
2021-01-25 18:02:32 +09:00
Takeshi Nakatani 059cc57ba6 Added atime and Corrected atime/mtime/ctime operations 2020-10-04 13:54:01 +09:00
Andrew Gaul 1043e08dfa Remove uses of implicit namespace std
Fixed via:

sed -i '/using namespace std/{N;d}' src/*.cpp
sed -i 's/ string/ std::string/g' src/*.cpp
sed -i 's/(string/(std::string/g' src/*.cpp
sed -i 's/\[string/\[std::string/g' src/*.cpp
sed -i 's/^string/std::string/g' src/*.cpp
sed -i 's/ ifstream/ std::ifstream/g' src/*.cpp
sed -i 's/ istringstream/ std::istringstream/g' src/*.cpp
sed -i 's/ ostringstream/ std::ostringstream/g' src/*.cpp
sed -i 's/ max(/ std::max(/g' src/*.cpp
sed -i 's/ min(/ std::min(/g' src/*.cpp
sed -i 's/ endl/ std::endl/g' src/*.cpp
2020-09-13 11:57:20 +09:00
Takeshi Nakatani b5ffd419d8 Source file division and set 4 spaces and cleanup 2020-08-26 17:43:50 +09:00