mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-13 17:34:45 +08:00
Fix uninitialized values (#698)
This commit is contained in:
parent
e1aa4837e0
commit
28b5106d4c
@ -6781,7 +6781,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||
int tH;
|
||||
int tM;
|
||||
long double S;
|
||||
long double S{};
|
||||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||
CharT{':'}, rld{S, 1, w});
|
||||
checked_set(H, tH, not_a_hour, is);
|
||||
@ -6861,7 +6861,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||
int tH = not_a_hour;
|
||||
int tM = not_a_minute;
|
||||
long double S;
|
||||
long double S{};
|
||||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||
CharT{':'}, rld{S, 1, w});
|
||||
checked_set(H, tH, not_a_hour, is);
|
||||
@ -7216,7 +7216,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
// "%I:%M:%S %p"
|
||||
using dfs = detail::decimal_format_seconds<Duration>;
|
||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||
long double S;
|
||||
long double S{};
|
||||
int tI = not_a_hour_12_value;
|
||||
int tM = not_a_minute;
|
||||
read(is, ru{tI, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||
@ -7272,7 +7272,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
{
|
||||
using dfs = detail::decimal_format_seconds<Duration>;
|
||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||
long double S;
|
||||
long double S{};
|
||||
read(is, rld{S, 1, width == -1 ? w : static_cast<unsigned>(width)});
|
||||
checked_set(s, round_i<Duration>(duration<long double>{S}),
|
||||
not_a_second, is);
|
||||
@ -7306,7 +7306,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||
int tH = not_a_hour;
|
||||
int tM = not_a_minute;
|
||||
long double S;
|
||||
long double S{};
|
||||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||
CharT{':'}, rld{S, 1, w});
|
||||
checked_set(H, tH, not_a_hour, is);
|
||||
|
Loading…
x
Reference in New Issue
Block a user