Skip to content

Commit

Permalink
Fix some -Wunused parameter issues (#8517)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgthegreat committed Apr 20, 2021
1 parent d1b2eff commit b642625
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/google/protobuf/compiler/cpp/cpp_helpers.h
Expand Up @@ -59,20 +59,20 @@ namespace protobuf {
namespace compiler {
namespace cpp {

inline std::string ProtobufNamespace(const Options& options) {
inline std::string ProtobufNamespace(const Options& /* options */) {
return "PROTOBUF_NAMESPACE_ID";
}

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 " : "";
}
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/google/protobuf/compiler/importer.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/io/printer.h
Expand Up @@ -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() {}
};
Expand Down
4 changes: 2 additions & 2 deletions src/google/protobuf/io/tokenizer.h
Expand Up @@ -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);
Expand Down

0 comments on commit b642625

Please sign in to comment.