From ad47ec50604a0b2d4f1a066a53f7621f586a2b48 Mon Sep 17 00:00:00 2001 From: cburdick Date: Wed, 3 Oct 2018 20:11:45 +0000 Subject: [PATCH] Used C++ style casts --- src/google/protobuf/arena_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/arena_impl.h b/src/google/protobuf/arena_impl.h index b727ca7bbe..cab3d86781 100644 --- a/src/google/protobuf/arena_impl.h +++ b/src/google/protobuf/arena_impl.h @@ -52,7 +52,7 @@ namespace internal { inline size_t AlignUpTo8(size_t n) { // Align n to next multiple of 8 (from Hacker's Delight, Chapter 3.) - return (n + 7) & (size_t)-8; + return (n + 7) & static_cast(-8); } // This class provides the core Arena memory allocation library. Different @@ -306,8 +306,8 @@ class PROTOBUF_EXPORT ArenaImpl { public: // kBlockHeaderSize is sizeof(Block), aligned up to the nearest multiple of 8 // to protect the invariant that pos is always at a multiple of 8. - static const size_t kBlockHeaderSize = (sizeof(Block) + 7) & (size_t)-8; - static const size_t kSerialArenaSize = (sizeof(SerialArena) + 7) & (size_t)-8; + static const size_t kBlockHeaderSize = (sizeof(Block) + 7) & static_cast(-8); + static const size_t kSerialArenaSize = (sizeof(SerialArena) + 7) & static_cast(-8); static_assert(kBlockHeaderSize % 8 == 0, "kBlockHeaderSize must be a multiple of 8."); static_assert(kSerialArenaSize % 8 == 0,