-
Notifications
You must be signed in to change notification settings - Fork 28
/
unused_parameter_warnings.patch
127 lines (111 loc) · 5.86 KB
/
unused_parameter_warnings.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
From 918e3ee8b46a0f79f97ed0197de08bd61fa5f053 Mon Sep 17 00:00:00 2001
From: Austin Schuh <[email protected]>
Date: Fri, 31 Oct 2014 16:27:55 -0700
Subject: [PATCH 1/2] Fixed Unused Parameter warning in headers.
---
src/google/protobuf/descriptor.h | 10 +++++-----
src/google/protobuf/message.h | 12 ++++++------
src/google/protobuf/repeated_field.h | 3 ++-
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git src/google/protobuf/descriptor.h src/google/protobuf/descriptor.h
index 67afc77..68013f8 100644
--- src/google/protobuf/descriptor.h
+++ src/google/protobuf/descriptor.h
@@ -1280,11 +1280,11 @@ class LIBPROTOBUF_EXPORT DescriptorPool {
// Reports a warning in the FileDescriptorProto. Use this function if the
// problem occured should NOT interrupt building the FileDescriptorProto.
virtual void AddWarning(
- const string& filename, // File name in which the error occurred.
- const string& element_name, // Full name of the erroneous element.
- const Message* descriptor, // Descriptor of the erroneous element.
- ErrorLocation location, // One of the location constants, above.
- const string& message // Human-readable error message.
+ const string& /*filename*/, // File name in which the error occurred.
+ const string& /*element_name*/, // Full name of the erroneous element.
+ const Message* /*descriptor*/, // Descriptor of the erroneous element.
+ ErrorLocation /*location*/, // One of the location constants, above.
+ const string& /*message*/ // Human-readable error message.
) {}
private:
diff --git src/google/protobuf/message.h src/google/protobuf/message.h
index 9593560..67d4549 100644
--- src/google/protobuf/message.h
+++ src/google/protobuf/message.h
@@ -389,19 +389,19 @@ class LIBPROTOBUF_EXPORT Reflection {
// is set, false otherwise.
// TODO(jieluo) - make it pure virtual after updating all
// the subclasses.
- virtual bool HasOneof(const Message& message,
- const OneofDescriptor* oneof_descriptor) const {
+ virtual bool HasOneof(const Message& /*message*/,
+ const OneofDescriptor* /*oneof_descriptor*/) const {
return false;
}
- virtual void ClearOneof(Message* message,
- const OneofDescriptor* oneof_descriptor) const {}
+ virtual void ClearOneof(Message* /*message*/,
+ const OneofDescriptor* /*oneof_descriptor*/) const {}
// Returns the field descriptor if the oneof is set. NULL otherwise.
// TODO(jieluo) - make it pure virtual.
virtual const FieldDescriptor* GetOneofFieldDescriptor(
- const Message& message,
- const OneofDescriptor* oneof_descriptor) const {
+ const Message& /*message*/,
+ const OneofDescriptor* /*oneof_descriptor*/) const {
return NULL;
}
diff --git src/google/protobuf/repeated_field.h src/google/protobuf/repeated_field.h
index 5005183..816ea68 100644
--- src/google/protobuf/repeated_field.h
+++ src/google/protobuf/repeated_field.h
@@ -83,7 +83,8 @@ inline int CalculateReserve(Iter begin, Iter end, std::forward_iterator_tag) {
}
template <typename Iter>
-inline int CalculateReserve(Iter begin, Iter end, std::input_iterator_tag) {
+inline int CalculateReserve(Iter /*begin*/, Iter /*end*/,
+ std::input_iterator_tag) {
return -1;
}
From ec71d5d31946f48c3b7adafa65dadcdbf47702c3 Mon Sep 17 00:00:00 2001
From: Austin Schuh <[email protected]>
Date: Fri, 31 Oct 2014 19:15:54 -0700
Subject: [PATCH 2/2] Fixed Unused Parameter warning in compiler headers.
---
src/google/protobuf/compiler/cpp/cpp_field.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git src/google/protobuf/compiler/cpp/cpp_field.h src/google/protobuf/compiler/cpp/cpp_field.h
index 96c2963..0342c35 100644
--- src/google/protobuf/compiler/cpp/cpp_field.h
+++ src/google/protobuf/compiler/cpp/cpp_field.h
@@ -77,7 +77,7 @@ class FieldGenerator {
// Generate static default variable for this field. These are placed inside
// the message class. Most field types don't need this, so the default
// implementation is empty.
- virtual void GenerateStaticMembers(io::Printer* printer) const {}
+ virtual void GenerateStaticMembers(io::Printer* /*printer*/) const {}
// Generate prototypes for all of the accessor functions related to this
// field. These are placed inside the class definition.
@@ -92,7 +92,7 @@ class FieldGenerator {
// placed somewhere in the .cc file.
// Most field types don't need this, so the default implementation is empty.
virtual void GenerateNonInlineAccessorDefinitions(
- io::Printer* printer) const {}
+ io::Printer* /*printer*/) const {}
// Generate lines of code (statements, not declarations) which clear the
// field. This is used to define the clear_$name$() method as well as
@@ -122,14 +122,15 @@ class FieldGenerator {
// Generate any code that needs to go in the class's SharedDtor() method,
// invoked by the destructor.
// Most field types don't need this, so the default implementation is empty.
- virtual void GenerateDestructorCode(io::Printer* printer) const {}
+ virtual void GenerateDestructorCode(io::Printer* /*printer*/) const {}
// Generate code that allocates the fields's default instance.
- virtual void GenerateDefaultInstanceAllocator(io::Printer* printer) const {}
+ virtual void GenerateDefaultInstanceAllocator(io::Printer* /*printer*/)
+ const {}
// Generate code that should be run when ShutdownProtobufLibrary() is called,
// to delete all dynamically-allocated objects.
- virtual void GenerateShutdownCode(io::Printer* printer) const {}
+ virtual void GenerateShutdownCode(io::Printer* /*printer*/) const {}
// Generate lines to decode this field, which will be placed inside the
// message's MergeFromCodedStream() method.