diff options
author | Abseil Team <absl-team@google.com> | 2022-01-10 10:41:45 -0800 |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2022-01-10 15:52:27 -0500 |
commit | 2a042b082ca6fc8592ec98d800012fc03c965c15 (patch) | |
tree | d698c4f717306c8aa30c84b2904a3f39596db85c /absl/flags/internal/flag.h | |
parent | 78f9680225b9792c26dfdd99d0bd26c96de53dd4 (diff) |
Export of internal Abseil changes
--
389189dbb322df0d0468ab13edf7dc185dc63833 by Abseil Team <absl-team@google.com>:
absl str_format.h can compile with -Wconversion and -Wsign-compare
PiperOrigin-RevId: 420799960
--
762e5adc429fc143756c42fe92fe8073c87c075f by Abseil Team <absl-team@google.com>:
GetStackTraceWithContext: Fix min_dropped_frames when no frames are recorded
Previously, if there were still frames to skip, they would be included
in min_dropped_frames.
PiperOrigin-RevId: 420766341
--
7d4374b8eaa410f4f98ec03d6a8997dccadfb271 by Abseil Team <absl-team@google.com>:
absl::flags compiles with -Wconversion and -Wsign-compare
PiperOrigin-RevId: 420476807
--
5f00f7805419d725fa1ff57b388e4c0750d1d6b0 by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 420282152
--
bd5471fc34956acf3888bf90287b2aee4415c96d by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 420282033
--
61c78020804e4290e9b2fe151aeaf99b198716ee by Derek Mauro <dmauro@google.com>:
Internal change
PiperOrigin-RevId: 420281867
--
dbe3aad24b65ea11664401a307ea3d2f28e8a7b9 by Derek Mauro <dmauro@google.com>:
Remove the incorrect test for the availability of [[nodiscard]]
It should have been ABSL_HAVE_CPP_ATTRIBUTE(nodiscard) instead of
ABSL_HAVE_ATTRIBUTE(nodiscard). As a result, some code is not
compliant with [[nodiscard]], so we cannot simply correct the availability
test.
Recommend that C++17-only code use the standard [[nodiscard] directly.
PiperOrigin-RevId: 420150702
GitOrigin-RevId: 389189dbb322df0d0468ab13edf7dc185dc63833
Change-Id: Idf6ebae3c4edd945c9032c7db3d0ab32d16e8078
Diffstat (limited to 'absl/flags/internal/flag.h')
-rw-r--r-- | absl/flags/internal/flag.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/absl/flags/internal/flag.h b/absl/flags/internal/flag.h index 2d0a7e9c..6154638c 100644 --- a/absl/flags/internal/flag.h +++ b/absl/flags/internal/flag.h @@ -303,7 +303,9 @@ constexpr FlagDefaultArg DefaultArg(char) { /////////////////////////////////////////////////////////////////////////////// // Flag current value auxiliary structs. -constexpr int64_t UninitializedFlagValue() { return 0xababababababababll; } +constexpr int64_t UninitializedFlagValue() { + return static_cast<int64_t>(0xababababababababll); +} template <typename T> using FlagUseValueAndInitBitStorage = std::integral_constant< @@ -755,8 +757,8 @@ void* FlagOps(FlagOp op, const void* v1, void* v2, void* v3) { case FlagOp::kValueOffset: { // Round sizeof(FlagImp) to a multiple of alignof(FlagValue<T>) to get the // offset of the data. - ptrdiff_t round_to = alignof(FlagValue<T>); - ptrdiff_t offset = + size_t round_to = alignof(FlagValue<T>); + size_t offset = (sizeof(FlagImpl) + round_to - 1) / round_to * round_to; return reinterpret_cast<void*>(offset); } |