From c5553a3d18f80132b9079c5504bc0aa1f7f950a0 Mon Sep 17 00:00:00 2001 From: "liujisi@google.com" Date: Wed, 28 May 2014 21:48:28 +0000 Subject: [PATCH] Down-integrate pending changes from internal repository after previous release. --- src/google/protobuf/descriptor.cc | 20 +++++++++++-------- src/google/protobuf/descriptor_database.h | 4 ++-- src/google/protobuf/extension_set.h | 2 +- .../protobuf/generated_message_reflection.cc | 4 ++-- src/google/protobuf/io/tokenizer.h | 3 ++- src/google/protobuf/message.cc | 5 +++-- src/google/protobuf/stubs/atomicops.h | 4 ++-- src/google/protobuf/stubs/common.cc | 4 ++-- src/google/protobuf/stubs/common.h | 3 ++- src/google/protobuf/text_format.cc | 6 +++--- src/google/protobuf/wire_format_lite.cc | 2 +- 11 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 4828a5924..3f0d15f71 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -811,7 +811,7 @@ string* DescriptorPool::Tables::AllocateString(const string& value) { } template -Type* DescriptorPool::Tables::AllocateMessage(Type* dummy) { +Type* DescriptorPool::Tables::AllocateMessage(Type* /* dummy */) { Type* result = new Type; messages_.push_back(result); return result; @@ -3677,7 +3677,7 @@ void DescriptorBuilder::BuildEnumValue(const EnumValueDescriptorProto& proto, } void DescriptorBuilder::BuildService(const ServiceDescriptorProto& proto, - const void* dummy, + const void* /* dummy */, ServiceDescriptor* result) { string* full_name = tables_->AllocateString(file_->package()); if (!full_name->empty()) full_name->append(1, '.'); @@ -3957,7 +3957,8 @@ void DescriptorBuilder::CrossLinkEnum( } void DescriptorBuilder::CrossLinkEnumValue( - EnumValueDescriptor* enum_value, const EnumValueDescriptorProto& proto) { + EnumValueDescriptor* enum_value, + const EnumValueDescriptorProto& /* proto */) { if (enum_value->options_ == NULL) { enum_value->options_ = &EnumValueOptions::default_instance(); } @@ -4158,7 +4159,8 @@ void DescriptorBuilder::ValidateEnumOptions(EnumDescriptor* enm, } void DescriptorBuilder::ValidateEnumValueOptions( - EnumValueDescriptor* enum_value, const EnumValueDescriptorProto& proto) { + EnumValueDescriptor* /* enum_value */, + const EnumValueDescriptorProto& /* proto */) { // Nothing to do so far. } void DescriptorBuilder::ValidateServiceOptions(ServiceDescriptor* service, @@ -4176,8 +4178,8 @@ void DescriptorBuilder::ValidateServiceOptions(ServiceDescriptor* service, VALIDATE_OPTIONS_FROM_ARRAY(service, method, Method); } -void DescriptorBuilder::ValidateMethodOptions(MethodDescriptor* method, - const MethodDescriptorProto& proto) { +void DescriptorBuilder::ValidateMethodOptions(MethodDescriptor* /* method */, + const MethodDescriptorProto& /* proto */) { // Nothing to do so far. } @@ -4805,14 +4807,16 @@ class AggregateErrorCollector : public io::ErrorCollector { public: string error_; - virtual void AddError(int line, int column, const string& message) { + virtual void AddError(int /* line */, int /* column */, + const string& message) { if (!error_.empty()) { error_ += "; "; } error_ += message; } - virtual void AddWarning(int line, int column, const string& message) { + virtual void AddWarning(int /* line */, int /* column */, + const string& /* message */) { // Ignore warnings } }; diff --git a/src/google/protobuf/descriptor_database.h b/src/google/protobuf/descriptor_database.h index 2ccb14583..604648f83 100644 --- a/src/google/protobuf/descriptor_database.h +++ b/src/google/protobuf/descriptor_database.h @@ -96,8 +96,8 @@ class LIBPROTOBUF_EXPORT DescriptorDatabase { // // This method has a default implementation that always returns // false. - virtual bool FindAllExtensionNumbers(const string& extendee_type, - vector* output) { + virtual bool FindAllExtensionNumbers(const string& /* extendee_type */, + vector* /* output */) { return false; } diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h index df8f1f368..73529e52e 100644 --- a/src/google/protobuf/extension_set.h +++ b/src/google/protobuf/extension_set.h @@ -794,7 +794,7 @@ class MessageTypeTraits { MutableType message, ExtensionSet* set) { set->SetAllocatedMessage(number, field_type, NULL, message); } - static inline MutableType Release(int number, FieldType field_type, + static inline MutableType Release(int number, FieldType /* field_type */, ExtensionSet* set) { return static_cast(set->ReleaseMessage( number, Type::default_instance())); diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index fb9cead6c..33297ed10 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -777,7 +777,7 @@ string GeneratedMessageReflection::GetString( const string& GeneratedMessageReflection::GetStringReference( const Message& message, - const FieldDescriptor* field, string* scratch) const { + const FieldDescriptor* field, string* /* scratch */) const { USAGE_CHECK_ALL(GetStringReference, SINGULAR, STRING); if (field->is_extension()) { return GetExtensionSet(message).GetString(field->number(), @@ -838,7 +838,7 @@ string GeneratedMessageReflection::GetRepeatedString( const string& GeneratedMessageReflection::GetRepeatedStringReference( const Message& message, const FieldDescriptor* field, - int index, string* scratch) const { + int index, string* /* scratch */) const { USAGE_CHECK_ALL(GetRepeatedStringReference, REPEATED, STRING); if (field->is_extension()) { return GetExtensionSet(message).GetRepeatedString(field->number(), index); diff --git a/src/google/protobuf/io/tokenizer.h b/src/google/protobuf/io/tokenizer.h index d85b82f9d..6b727d9fe 100644 --- a/src/google/protobuf/io/tokenizer.h +++ b/src/google/protobuf/io/tokenizer.h @@ -67,7 +67,8 @@ class LIBPROTOBUF_EXPORT ErrorCollector { // Indicates that there was a warning in the input at the given line and // column numbers. The numbers are zero-based, so you may want to add // 1 to each before printing them. - virtual void AddWarning(int line, int column, const string& message) { } + virtual void AddWarning(int /* line */, int /* column */, + const string& /* message */) { } private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector); diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index ab7efa990..0c305d568 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -149,7 +149,7 @@ int Message::ByteSize() const { return size; } -void Message::SetCachedSize(int size) const { +void Message::SetCachedSize(int /* size */) const { GOOGLE_LOG(FATAL) << "Message class \"" << GetDescriptor()->full_name() << "\" implements neither SetCachedSize() nor ByteSize(). " "Must implement one or the other."; @@ -216,7 +216,8 @@ HANDLE_TYPE(bool, FieldDescriptor::CPPTYPE_BOOL, -1); #undef HANDLE_TYPE void* Reflection::MutableRawRepeatedString( - Message* message, const FieldDescriptor* field, bool is_string) const { + Message* message, const FieldDescriptor* field, + bool /* is_string */) const { return MutableRawRepeatedField(message, field, FieldDescriptor::CPPTYPE_STRING, FieldOptions::STRING, NULL); } diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h index f389a36bf..eb83047b8 100644 --- a/src/google/protobuf/stubs/atomicops.h +++ b/src/google/protobuf/stubs/atomicops.h @@ -179,7 +179,7 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR #elif defined(__GNUC__) #if defined(GOOGLE_PROTOBUF_ARCH_IA32) || defined(GOOGLE_PROTOBUF_ARCH_X64) #include -#elif defined(GOOGLE_PROTOBUF_ARCH_ARM) +#elif defined(GOOGLE_PROTOBUF_ARCH_ARM) && defined(__linux__) #include #elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64) #include @@ -187,7 +187,7 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR #include #elif defined(GOOGLE_PROTOBUF_ARCH_MIPS) #include -#elif defined(__pnacl__) +#elif defined(__native_client__) #include #else GOOGLE_PROTOBUF_ATOMICOPS_ERROR diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index e60450267..a4de6363d 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -115,8 +115,8 @@ void DefaultLogHandler(LogLevel level, const char* filename, int line, fflush(stderr); // Needed on MSVC. } -void NullLogHandler(LogLevel level, const char* filename, int line, - const string& message) { +void NullLogHandler(LogLevel /* level */, const char* /* filename */, + int /* line */, const string& /* message */) { // Nothing. } diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index 0ecd171b3..c24be485a 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -720,7 +720,8 @@ class LIBPROTOBUF_EXPORT LogFinisher { namespace internal { template -T* CheckNotNull(const char *file, int line, const char *name, T* val) { +T* CheckNotNull(const char* /* file */, int /* line */, + const char* name, T* val) { if (val == NULL) { GOOGLE_LOG(FATAL) << name; } diff --git a/src/google/protobuf/text_format.cc b/src/google/protobuf/text_format.cc index cabb99ed9..b2ea7ee83 100644 --- a/src/google/protobuf/text_format.cc +++ b/src/google/protobuf/text_format.cc @@ -1075,7 +1075,7 @@ bool TextFormat::Parser::MergeFromString(const string& input, return Merge(&input_stream, output); } -bool TextFormat::Parser::MergeUsingImpl(io::ZeroCopyInputStream* input, +bool TextFormat::Parser::MergeUsingImpl(io::ZeroCopyInputStream* /* input */, Message* output, ParserImpl* parser_impl) { if (!parser_impl->Parse(output)) return false; @@ -1280,8 +1280,8 @@ void TextFormat::Printer::PrintShortRepeatedField( } } -void TextFormat::Printer::PrintFieldName(const Message& message, - const Reflection* reflection, +void TextFormat::Printer::PrintFieldName(const Message& /* message */, + const Reflection* /* reflection */, const FieldDescriptor* field, TextGenerator& generator) const { if (field->is_extension()) { diff --git a/src/google/protobuf/wire_format_lite.cc b/src/google/protobuf/wire_format_lite.cc index 738fc4214..0a3357b17 100644 --- a/src/google/protobuf/wire_format_lite.cc +++ b/src/google/protobuf/wire_format_lite.cc @@ -182,7 +182,7 @@ bool FieldSkipper::SkipMessage(io::CodedInputStream* input) { } void FieldSkipper::SkipUnknownEnum( - int field_number, int value) { + int /* field_number */, int /* value */) { // Nothing. }