diff options
author | Abseil Team <absl-team@google.com> | 2020-07-28 11:13:39 -0700 |
---|---|---|
committer | Mark Barolak <mbar@google.com> | 2020-07-28 14:37:27 -0400 |
commit | dea76486cb76c7e1032a5efc15b43538b7c5ce50 (patch) | |
tree | 4c7b7f6bbd39d399b446fdfd9cb6cb37c44e914a /absl/time/internal/cctz/src | |
parent | d39fe6cd6f5eb72dc741f17d3a143a6a5a56538a (diff) |
Export of internal Abseil changes
--
e1d2e93a3328d9e4362c5510e81bd15ddd0dcf00 by Derek Mauro <dmauro@google.com>:
ROLLBACK: Use auto-detected sanitizer attributes for ASAN, MSAN, and TSAN builds
PiperOrigin-RevId: 323612219
--
6fe0914715bcb680ac1dc533aae3461e2ca1ad50 by Derek Mauro <dmauro@google.com>:
Use auto-detected sanitizer attributes for ASAN, MSAN, and TSAN builds
PiperOrigin-RevId: 323597765
--
9ad74e277348585f06a511aac31fff917a89a5d7 by Mark Barolak <mbar@google.com>:
Import of CCTZ from GitHub.
PiperOrigin-RevId: 323594550
--
9e77ccb5adf7e9867cfa254105930f8fed19699d by Evan Brown <ezb@google.com>:
Remove an unnecessary nullptr check in Cord::PrependTree().
We already check for nullptr at all callsites.
PiperOrigin-RevId: 323583641
--
31ab2355c1b91e474b67ff88b8597ad99f346511 by Gennadiy Rozental <rogeeff@google.com>:
Avoid memory allocations while registering retired flags.
PiperOrigin-RevId: 323523011
--
33435e9b97b31763a80d3e41b5ab2459e862e99a by Jorg Brown <jorg@google.com>:
Allow ABSL_PREDICT_FALSE to be used with a type that's explicitly convertible to bool.
So far ABSL_PREDICT_TRUE could be used with these, but not ABSL_PREDICT_FALSE.
PiperOrigin-RevId: 323514860
GitOrigin-RevId: e1d2e93a3328d9e4362c5510e81bd15ddd0dcf00
Change-Id: Iee5b030d9aec1ae2c0fe8997763cee7bd84b4090
Diffstat (limited to 'absl/time/internal/cctz/src')
-rw-r--r-- | absl/time/internal/cctz/src/time_zone_info.cc | 12 | ||||
-rw-r--r-- | absl/time/internal/cctz/src/time_zone_info.h | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/absl/time/internal/cctz/src/time_zone_info.cc b/absl/time/internal/cctz/src/time_zone_info.cc index c7bf0447..8039353e 100644 --- a/absl/time/internal/cctz/src/time_zone_info.cc +++ b/absl/time/internal/cctz/src/time_zone_info.cc @@ -295,7 +295,7 @@ bool TimeZoneInfo::EquivTransitions(std::uint_fast8_t tt1_index, // Find/make a transition type with these attributes. bool TimeZoneInfo::GetTransitionType(std::int_fast32_t utc_offset, bool is_dst, const std::string& abbr, - std::uint_fast8_t* index) { + std::uint_least8_t* index) { std::size_t type_index = 0; std::size_t abbr_index = abbreviations_.size(); for (; type_index != transition_types_.size(); ++type_index) { @@ -334,7 +334,7 @@ bool TimeZoneInfo::ExtendTransitions() { if (!ParsePosixSpec(future_spec_, &posix)) return false; // Find transition type for the future std specification. - std::uint_fast8_t std_ti; + std::uint_least8_t std_ti; if (!GetTransitionType(posix.std_offset, false, posix.std_abbr, &std_ti)) return false; @@ -345,7 +345,7 @@ bool TimeZoneInfo::ExtendTransitions() { } // Find transition type for the future dst specification. - std::uint_fast8_t dst_ti; + std::uint_least8_t dst_ti; if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti)) return false; @@ -365,10 +365,8 @@ bool TimeZoneInfo::ExtendTransitions() { std::int_fast64_t jan1_time = jan1 - civil_second(); int jan1_weekday = ToPosixWeekday(get_weekday(jan1)); - Transition dst = {0, static_cast<uint_least8_t>(dst_ti), civil_second(), - civil_second()}; - Transition std = {0, static_cast<uint_least8_t>(std_ti), civil_second(), - civil_second()}; + Transition dst = {0, dst_ti, civil_second(), civil_second()}; + Transition std = {0, std_ti, civil_second(), civil_second()}; for (const year_t limit = last_year_ + 400;; ++last_year_) { auto dst_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_start); auto std_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_end); diff --git a/absl/time/internal/cctz/src/time_zone_info.h b/absl/time/internal/cctz/src/time_zone_info.h index 068e34be..2467ff55 100644 --- a/absl/time/internal/cctz/src/time_zone_info.h +++ b/absl/time/internal/cctz/src/time_zone_info.h @@ -96,7 +96,7 @@ class TimeZoneInfo : public TimeZoneIf { }; bool GetTransitionType(std::int_fast32_t utc_offset, bool is_dst, - const std::string& abbr, std::uint_fast8_t* index); + const std::string& abbr, std::uint_least8_t* index); bool EquivTransitions(std::uint_fast8_t tt1_index, std::uint_fast8_t tt2_index) const; bool ExtendTransitions(); |