forked from HowardHinnant/date
Fix uninitialized values (#698)
This commit is contained in:
@ -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;
|
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||||
int tH;
|
int tH;
|
||||||
int tM;
|
int tM;
|
||||||
long double S;
|
long double S{};
|
||||||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||||
CharT{':'}, rld{S, 1, w});
|
CharT{':'}, rld{S, 1, w});
|
||||||
checked_set(H, tH, not_a_hour, is);
|
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;
|
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||||
int tH = not_a_hour;
|
int tH = not_a_hour;
|
||||||
int tM = not_a_minute;
|
int tM = not_a_minute;
|
||||||
long double S;
|
long double S{};
|
||||||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||||
CharT{':'}, rld{S, 1, w});
|
CharT{':'}, rld{S, 1, w});
|
||||||
checked_set(H, tH, not_a_hour, is);
|
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"
|
// "%I:%M:%S %p"
|
||||||
using dfs = detail::decimal_format_seconds<Duration>;
|
using dfs = detail::decimal_format_seconds<Duration>;
|
||||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
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 tI = not_a_hour_12_value;
|
||||||
int tM = not_a_minute;
|
int tM = not_a_minute;
|
||||||
read(is, ru{tI, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
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>;
|
using dfs = detail::decimal_format_seconds<Duration>;
|
||||||
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
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)});
|
read(is, rld{S, 1, width == -1 ? w : static_cast<unsigned>(width)});
|
||||||
checked_set(s, round_i<Duration>(duration<long double>{S}),
|
checked_set(s, round_i<Duration>(duration<long double>{S}),
|
||||||
not_a_second, is);
|
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;
|
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
|
||||||
int tH = not_a_hour;
|
int tH = not_a_hour;
|
||||||
int tM = not_a_minute;
|
int tM = not_a_minute;
|
||||||
long double S;
|
long double S{};
|
||||||
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2},
|
||||||
CharT{':'}, rld{S, 1, w});
|
CharT{':'}, rld{S, 1, w});
|
||||||
checked_set(H, tH, not_a_hour, is);
|
checked_set(H, tH, not_a_hour, is);
|
||||||
|
Reference in New Issue
Block a user