diff options
-rw-r--r-- | java/src/main/java/com/google/protobuf/LazyField.java | 4 | ||||
-rw-r--r-- | src/google/protobuf/io/coded_stream.h | 4 | ||||
-rw-r--r-- | src/google/protobuf/map.h | 4 | ||||
-rw-r--r-- | src/google/protobuf/stubs/platform_macros.h | 2 | ||||
-rw-r--r-- | src/google/protobuf/wire_format_lite_inl.h | 10 |
5 files changed, 15 insertions, 9 deletions
diff --git a/java/src/main/java/com/google/protobuf/LazyField.java b/java/src/main/java/com/google/protobuf/LazyField.java index 3da8b900..5e0a485c 100644 --- a/java/src/main/java/com/google/protobuf/LazyField.java +++ b/java/src/main/java/com/google/protobuf/LazyField.java @@ -39,14 +39,14 @@ import java.util.Map.Entry; * * Most of key methods are implemented in {@link LazyFieldLite} but this class * can contain default instance of the message to provide {@code hashCode()}, - * {@code euqals()} and {@code toString()}. + * {@code equals()} and {@code toString()}. * * @author xiangl@google.com (Xiang Li) */ public class LazyField extends LazyFieldLite { /** - * Carry a message's default instance which is used by {@code hashCode()}, {@code euqals()} and + * Carry a message's default instance which is used by {@code hashCode()}, {@code equals()} and * {@code toString()}. */ private final MessageLite defaultInstance; diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index 361c406b..cb1869a7 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -1035,7 +1035,7 @@ inline const uint8* CodedInputStream::ExpectTagFromArray( inline void CodedInputStream::GetDirectBufferPointerInline(const void** data, int* size) { *data = buffer_; - *size = buffer_end_ - buffer_; + *size = static_cast<int>(buffer_end_ - buffer_); } inline bool CodedInputStream::ExpectAtEnd() { @@ -1231,7 +1231,7 @@ inline MessageFactory* CodedInputStream::GetExtensionFactory() { } inline int CodedInputStream::BufferSize() const { - return buffer_end_ - buffer_; + return static_cast<int>(buffer_end_ - buffer_); } inline CodedInputStream::CodedInputStream(ZeroCopyInputStream* input) diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 52fba603..4bd76f25 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -546,7 +546,9 @@ class Map { } #if __cplusplus >= 201103L && !defined(GOOGLE_PROTOBUF_OS_APPLE) && \ - !defined(GOOGLE_PROTOBUF_OS_NACL) && !defined(GOOGLE_PROTOBUF_OS_ANDROID) + !defined(GOOGLE_PROTOBUF_OS_NACL) && \ + !defined(GOOGLE_PROTOBUF_OS_ANDROID) && \ + !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN) template<class NodeType, class... Args> void construct(NodeType* p, Args&&... args) { new (static_cast<void*>(p)) NodeType(std::forward<Args>(args)...); diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h index 338d22f0..5cde8f4e 100644 --- a/src/google/protobuf/stubs/platform_macros.h +++ b/src/google/protobuf/stubs/platform_macros.h @@ -97,6 +97,8 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR #if TARGET_OS_IPHONE #define GOOGLE_PROTOBUF_OS_IPHONE #endif +#elif defined(__EMSCRIPTEN__) +#define GOOGLE_PROTOBUF_OS_EMSCRIPTEN #elif defined(__native_client__) #define GOOGLE_PROTOBUF_OS_NACL #elif defined(sun) diff --git a/src/google/protobuf/wire_format_lite_inl.h b/src/google/protobuf/wire_format_lite_inl.h index 991c3d04..b1c477d1 100644 --- a/src/google/protobuf/wire_format_lite_inl.h +++ b/src/google/protobuf/wire_format_lite_inl.h @@ -835,12 +835,14 @@ inline int WireFormatLite::EnumSize(int value) { } inline int WireFormatLite::StringSize(const string& value) { - return io::CodedOutputStream::VarintSize32(value.size()) + - value.size(); + return static_cast<int>( + io::CodedOutputStream::VarintSize32(static_cast<uint32>(value.size())) + + value.size()); } inline int WireFormatLite::BytesSize(const string& value) { - return io::CodedOutputStream::VarintSize32(value.size()) + - value.size(); + return static_cast<int>( + io::CodedOutputStream::VarintSize32(static_cast<uint32>(value.size())) + + value.size()); } |