From e3c807d4e752b477b707f5d021264faf9b127304 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Fri, 23 Jun 2017 12:56:44 -0700 Subject: Fix more implicit type conversions in public headers and generated code. --- src/google/protobuf/stubs/port.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/google/protobuf/stubs/port.h') diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 0afd55d7..7879aed4 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -354,7 +354,7 @@ class Bits { public: static uint32 Log2FloorNonZero(uint32 n) { #if defined(__GNUC__) - return 31 ^ __builtin_clz(n); + return 31 ^ static_cast(__builtin_clz(n)); #elif defined(COMPILER_MSVC) && defined(_M_IX86) _asm { bsr ebx, n @@ -373,7 +373,7 @@ class Bits { // To work around this, when we build for NaCl we use the portable // implementation instead. #if defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_OS_NACL) - return 63 ^ __builtin_clzll(n); + return 63 ^ static_cast(__builtin_clzll(n)); #else return Log2FloorNonZero64_Portable(n); #endif @@ -400,9 +400,9 @@ class Bits { const uint32 topbits = static_cast(n >> 32); if (topbits == 0) { // Top bits are zero, so scan in bottom bits - return Log2FloorNonZero(static_cast(n)); + return static_cast(Log2FloorNonZero(static_cast(n))); } else { - return 32 + Log2FloorNonZero(topbits); + return 32 + static_cast(Log2FloorNonZero(topbits)); } } }; -- cgit v1.2.3