Browse Source

Down-integrate pending changes from internal repository after previous release.

liujisi@google.com 11 năm trước cách đây
mục cha
commit
c5553a3d18

+ 12 - 8
src/google/protobuf/descriptor.cc

@@ -811,7 +811,7 @@ string* DescriptorPool::Tables::AllocateString(const string& value) {
 }
 
 template<typename Type>
-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
   }
 };

+ 2 - 2
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<int>* output) {
+  virtual bool FindAllExtensionNumbers(const string& /* extendee_type */,
+                                       vector<int>* /* output */) {
     return false;
   }
 

+ 1 - 1
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<Type*>(set->ReleaseMessage(
         number, Type::default_instance()));

+ 2 - 2
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);

+ 2 - 1
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);

+ 3 - 2
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);
 }

+ 2 - 2
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 <google/protobuf/stubs/atomicops_internals_x86_gcc.h>
-#elif defined(GOOGLE_PROTOBUF_ARCH_ARM)
+#elif defined(GOOGLE_PROTOBUF_ARCH_ARM) && defined(__linux__)
 #include <google/protobuf/stubs/atomicops_internals_arm_gcc.h>
 #elif defined(GOOGLE_PROTOBUF_ARCH_AARCH64)
 #include <google/protobuf/stubs/atomicops_internals_arm64_gcc.h>
@@ -187,7 +187,7 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR
 #include <google/protobuf/stubs/atomicops_internals_arm_qnx.h>
 #elif defined(GOOGLE_PROTOBUF_ARCH_MIPS)
 #include <google/protobuf/stubs/atomicops_internals_mips_gcc.h>
-#elif defined(__pnacl__)
+#elif defined(__native_client__)
 #include <google/protobuf/stubs/atomicops_internals_pnacl.h>
 #else
 GOOGLE_PROTOBUF_ATOMICOPS_ERROR

+ 2 - 2
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.
 }
 

+ 2 - 1
src/google/protobuf/stubs/common.h

@@ -720,7 +720,8 @@ class LIBPROTOBUF_EXPORT LogFinisher {
 
 namespace internal {
 template<typename T>
-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;
   }

+ 3 - 3
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()) {

+ 1 - 1
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.
 }