From dea76486cb76c7e1032a5efc15b43538b7c5ce50 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 28 Jul 2020 11:13:39 -0700 Subject: Export of internal Abseil changes -- e1d2e93a3328d9e4362c5510e81bd15ddd0dcf00 by Derek Mauro : ROLLBACK: Use auto-detected sanitizer attributes for ASAN, MSAN, and TSAN builds PiperOrigin-RevId: 323612219 -- 6fe0914715bcb680ac1dc533aae3461e2ca1ad50 by Derek Mauro : Use auto-detected sanitizer attributes for ASAN, MSAN, and TSAN builds PiperOrigin-RevId: 323597765 -- 9ad74e277348585f06a511aac31fff917a89a5d7 by Mark Barolak : Import of CCTZ from GitHub. PiperOrigin-RevId: 323594550 -- 9e77ccb5adf7e9867cfa254105930f8fed19699d by Evan Brown : Remove an unnecessary nullptr check in Cord::PrependTree(). We already check for nullptr at all callsites. PiperOrigin-RevId: 323583641 -- 31ab2355c1b91e474b67ff88b8597ad99f346511 by Gennadiy Rozental : Avoid memory allocations while registering retired flags. PiperOrigin-RevId: 323523011 -- 33435e9b97b31763a80d3e41b5ab2459e862e99a by Jorg Brown : 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 --- absl/time/internal/cctz/src/time_zone_info.cc | 12 +++++------- absl/time/internal/cctz/src/time_zone_info.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'absl/time/internal/cctz') 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(dst_ti), civil_second(), - civil_second()}; - Transition std = {0, static_cast(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(); -- cgit v1.2.3