Fix some -Wunused parameter issues (#8517)

pull/8519/head
Yuriy Chernyshov 4 years ago committed by GitHub
parent d1b2eff440
commit b6426256fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/google/protobuf/compiler/cpp/cpp_helpers.h
  2. 4
      src/google/protobuf/compiler/importer.h
  3. 2
      src/google/protobuf/io/printer.h
  4. 4
      src/google/protobuf/io/tokenizer.h

@ -59,7 +59,7 @@ namespace protobuf {
namespace compiler {
namespace cpp {
inline std::string ProtobufNamespace(const Options& options) {
inline std::string ProtobufNamespace(const Options& /* options */) {
return "PROTOBUF_NAMESPACE_ID";
}
@ -67,12 +67,12 @@ inline std::string MacroPrefix(const Options& options) {
return options.opensource_runtime ? "GOOGLE_PROTOBUF" : "GOOGLE_PROTOBUF";
}
inline std::string DeprecatedAttribute(const Options& options,
inline std::string DeprecatedAttribute(const Options& /* options */,
const FieldDescriptor* d) {
return d->options().deprecated() ? "PROTOBUF_DEPRECATED " : "";
}
inline std::string DeprecatedAttribute(const Options& options,
inline std::string DeprecatedAttribute(const Options& /* options */,
const EnumValueDescriptor* d) {
return d->options().deprecated() ? "PROTOBUF_DEPRECATED_ENUM " : "";
}
@ -345,7 +345,7 @@ inline bool IsLazy(const FieldDescriptor* field, const Options& options) {
!options.opensource_runtime;
}
inline bool IsFieldUsed(const FieldDescriptor* field, const Options& options) {
inline bool IsFieldUsed(const FieldDescriptor* /* field */, const Options& /* options */) {
return true;
}

@ -202,8 +202,8 @@ class PROTOBUF_EXPORT MultiFileErrorCollector {
virtual void AddError(const std::string& filename, int line, int column,
const std::string& message) = 0;
virtual void AddWarning(const std::string& filename, int line, int column,
const std::string& message) {}
virtual void AddWarning(const std::string& /* filename */, int /* line */, int /* column */,
const std::string& /* message */) {}
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MultiFileErrorCollector);

@ -65,7 +65,7 @@ class PROTOBUF_EXPORT AnnotationCollector {
// TODO(gerbens) I don't see why we need virtuals here. Just a vector of
// range, payload pairs stored in a context should suffice.
virtual void AddAnnotationNew(Annotation& a) {}
virtual void AddAnnotationNew(Annotation& /* a */) {}
virtual ~AnnotationCollector() {}
};

@ -78,8 +78,8 @@ class PROTOBUF_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, ColumnNumber column,
const std::string& message) {}
virtual void AddWarning(int /* line */, ColumnNumber /* column */,
const std::string& /* message */) {}
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector);

Loading…
Cancel
Save