From eee38b0c018b3279f77d03dff796f440f40d3516 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Sat, 22 Aug 2015 18:25:48 -0700 Subject: Down-integrate from google3. --- src/google/protobuf/metadata.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/google/protobuf/metadata.h') diff --git a/src/google/protobuf/metadata.h b/src/google/protobuf/metadata.h index 30b2a6ee..fdee150b 100644 --- a/src/google/protobuf/metadata.h +++ b/src/google/protobuf/metadata.h @@ -69,8 +69,7 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { ptr_ = NULL; } - inline const UnknownFieldSet& unknown_fields() const - GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE const UnknownFieldSet& unknown_fields() const { if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) { return PtrValue()->unknown_fields_; } else { @@ -78,7 +77,7 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { } } - inline UnknownFieldSet* mutable_unknown_fields() GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE UnknownFieldSet* mutable_unknown_fields() { if (GOOGLE_PREDICT_TRUE(have_unknown_fields())) { return &PtrValue()->unknown_fields_; } else { @@ -86,7 +85,7 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { } } - inline Arena* arena() const GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE Arena* arena() const { if (GOOGLE_PREDICT_FALSE(have_unknown_fields())) { return PtrValue()->arena_; } else { @@ -94,11 +93,11 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { } } - inline bool have_unknown_fields() const GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE bool have_unknown_fields() const { return PtrTag() == kTagContainer; } - inline void Swap(InternalMetadataWithArena* other) GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE void Swap(InternalMetadataWithArena* other) { // Semantics here are that we swap only the unknown fields, not the arena // pointer. We cannot simply swap ptr_ with other->ptr_ because we need to // maintain our own arena ptr. Also, our ptr_ and other's ptr_ may be in @@ -110,7 +109,7 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { } } - inline void* raw_arena_ptr() const GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE void* raw_arena_ptr() const { return ptr_; } @@ -128,7 +127,7 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { static const intptr_t kPtrValueMask = ~kPtrTagMask; // Accessors for pointer tag and pointer value. - inline int PtrTag() const GOOGLE_ATTRIBUTE_ALWAYS_INLINE { + GOOGLE_ATTRIBUTE_ALWAYS_INLINE int PtrTag() const { return reinterpret_cast(ptr_) & kPtrTagMask; } @@ -143,7 +142,7 @@ class LIBPROTOBUF_EXPORT InternalMetadataWithArena { Arena* arena_; }; - UnknownFieldSet* mutable_unknown_fields_slow() GOOGLE_ATTRIBUTE_NOINLINE { + GOOGLE_ATTRIBUTE_NOINLINE UnknownFieldSet* mutable_unknown_fields_slow() { Arena* my_arena = arena(); Container* container = Arena::Create(my_arena); ptr_ = reinterpret_cast( -- cgit v1.2.3