Skip to content

Commit fdf2a09

Browse files
committed
Remove names of unused parameters
Removing the parameter completely is not an option for these as they are part of inherited APIs, but at the same time the names do not have value in terms of documentation.
1 parent ce9c8f1 commit fdf2a09

21 files changed

+45
-50
lines changed

jbmc/src/java_bytecode/select_pointer_type.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ select_pointer_typet::get_recursively_instantiated_type(
228228
std::set<symbol_typet> select_pointer_typet::get_parameter_alternative_types(
229229
const irep_idt &function_name,
230230
const irep_idt &parameter_name,
231-
const namespacet &ns) const
231+
const namespacet &) const
232232
{
233233
// unused parameters
234234
(void)function_name;

jbmc/unit/pointer-analysis/custom_value_set_analysis.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class test_value_sett:public value_sett
9191

9292
void adjust_assign_rhs_values(
9393
const exprt &expr,
94-
const namespacet &ns,
94+
const namespacet &,
9595
object_mapt &dest) const override
9696
{
9797
// Always add an ID_unknown to reads from variables containing
@@ -109,7 +109,7 @@ class test_value_sett:public value_sett
109109

110110
void apply_assign_side_effects(
111111
const exprt &lhs,
112-
const exprt &rhs,
112+
const exprt &,
113113
const namespacet &ns) override
114114
{
115115
// Whenever someone touches the variable "cause", null the

jbmc/unit/util/has_subtype.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ SCENARIO("has_subtype", "[core][utils][has_subtype]")
8080
THEN("has_subtype terminates")
8181
{
8282
REQUIRE_FALSE(
83-
has_subtype(struct_type, [&](const typet &t) { return false; }, ns));
83+
has_subtype(struct_type, [&](const typet &) { return false; }, ns));
8484
}
8585
THEN("symbol type is a subtype")
8686
{

src/analyses/ai_domain.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class ai_domain_baset
6363
const namespacet &ns) = 0;
6464

6565
virtual void
66-
output(std::ostream &out, const ai_baset &ai, const namespacet &ns) const
66+
output(std::ostream &, const ai_baset &, const namespacet &) const
6767
{
6868
}
6969

@@ -102,7 +102,7 @@ class ai_domain_baset
102102
/// simplification
103103

104104
/// return true if unchanged
105-
virtual bool ai_simplify(exprt &condition, const namespacet &ns) const
105+
virtual bool ai_simplify(exprt &condition, const namespacet &) const
106106
{
107107
(void)condition; // unused parameter
108108
return true;

src/analyses/escape_analysis.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ void escape_domaint::get_rhs_aliases_address_of(
166166
}
167167

168168
void escape_domaint::transform(
169-
const irep_idt &function_from,
169+
const irep_idt &,
170170
locationt from,
171-
const irep_idt &function_to,
171+
const irep_idt &,
172172
locationt,
173173
ai_baset &,
174174
const namespacet &)

src/analyses/global_may_alias.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ void global_may_alias_domaint::get_rhs_aliases_address_of(
7676
}
7777

7878
void global_may_alias_domaint::transform(
79-
const irep_idt &function_from,
79+
const irep_idt &,
8080
locationt from,
81-
const irep_idt &function_to,
81+
const irep_idt &,
8282
locationt,
8383
ai_baset &,
8484
const namespacet &)

src/analyses/interval_domain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ void interval_domaint::output(
5757
}
5858

5959
void interval_domaint::transform(
60-
const irep_idt &function_from,
60+
const irep_idt &,
6161
locationt from,
62-
const irep_idt &function_to,
62+
const irep_idt &,
6363
locationt to,
6464
ai_baset &,
6565
const namespacet &ns)

src/analyses/invariant_set_domain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Author: Daniel Kroening, [email protected]
1414
#include <util/simplify_expr.h>
1515

1616
void invariant_set_domaint::transform(
17-
const irep_idt &function_from,
17+
const irep_idt &,
1818
locationt from_l,
19-
const irep_idt &function_to,
19+
const irep_idt &,
2020
locationt to_l,
2121
ai_baset &,
2222
const namespacet &ns)

src/analyses/uninitialized_domain.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Date: January 2010
1919
#include <list>
2020

2121
void uninitialized_domaint::transform(
22-
const irep_idt &function_from,
22+
const irep_idt &,
2323
locationt from,
24-
const irep_idt &function_to,
24+
const irep_idt &,
2525
locationt,
2626
ai_baset &,
2727
const namespacet &ns)

src/pointer-analysis/value_set_domain_transform.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
template<class VST>
1717
void value_set_domain_templatet<VST>::transform(
1818
const namespacet &ns,
19-
const irep_idt &function_from,
19+
const irep_idt &,
2020
locationt from_l,
2121
const irep_idt &function_to,
2222
locationt to_l)

src/solvers/sat/satcheck_minisat2.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ static Minisat::Solver *solver_to_interrupt=nullptr;
156156

157157
static void interrupt_solver(int signum)
158158
{
159+
(void)signum; // unused parameter -- just removing the name trips up cpplint
159160
solver_to_interrupt->interrupt();
160161
}
161162

src/util/expr.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ class exprt:public irept
246246
///
247247
/// The validation mode indicates whether well-formedness check failures are
248248
/// reported via DATA_INVARIANT violations or exceptions.
249-
static void check(
250-
const exprt &expr,
251-
const validation_modet vm = validation_modet::INVARIANT)
249+
static void check(const exprt &, const validation_modet)
252250
{
253251
}
254252

@@ -262,7 +260,7 @@ class exprt:public irept
262260
/// reported via DATA_INVARIANT violations or exceptions.
263261
static void validate(
264262
const exprt &expr,
265-
const namespacet &ns,
263+
const namespacet &,
266264
const validation_modet vm = validation_modet::INVARIANT)
267265
{
268266
check_expr(expr, vm);

src/util/graph.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class graph_nodet
7878
/// << "\"]";
7979
/// return ss.str();
8080
///
81-
virtual std::string dot_attributes(const node_indext &idx) const
81+
virtual std::string dot_attributes(const node_indext &) const
8282
{
8383
return "";
8484
}

src/util/small_shared_ptr.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,17 @@ class small_shared_pointeet
185185
small_shared_pointeet() = default;
186186

187187
// These can't be `= default` because we need the use_count_ to be unaffected
188-
small_shared_pointeet(const small_shared_pointeet &rhs)
188+
small_shared_pointeet(const small_shared_pointeet &)
189189
{
190190
}
191-
small_shared_pointeet &operator=(const small_shared_pointeet &rhs)
191+
small_shared_pointeet &operator=(const small_shared_pointeet &)
192192
{
193193
return *this;
194194
}
195-
small_shared_pointeet(small_shared_pointeet &&rhs)
195+
small_shared_pointeet(small_shared_pointeet &&)
196196
{
197197
}
198-
small_shared_pointeet &operator=(small_shared_pointeet &&rhs)
198+
small_shared_pointeet &operator=(small_shared_pointeet &&)
199199
{
200200
return *this;
201201
}

src/util/small_shared_two_way_ptr.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ class small_shared_two_way_pointeet
225225
small_shared_two_way_pointeet() = default;
226226

227227
// The use count shall be unaffected
228-
small_shared_two_way_pointeet(const small_shared_two_way_pointeet &rhs)
228+
small_shared_two_way_pointeet(const small_shared_two_way_pointeet &)
229229
{
230230
}
231231

232232
// The use count shall be unaffected
233233
small_shared_two_way_pointeet &
234-
operator=(const small_shared_two_way_pointeet &rhs)
234+
operator=(const small_shared_two_way_pointeet &)
235235
{
236236
return *this;
237237
}

src/util/std_code.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ class codet:public exprt
7272
///
7373
/// The validation mode indicates whether well-formedness check failures are
7474
/// reported via DATA_INVARIANT violations or exceptions.
75-
static void check(
76-
const codet &code,
77-
const validation_modet vm = validation_modet::INVARIANT)
75+
static void check(const codet &, const validation_modet)
7876
{
7977
}
8078

@@ -89,7 +87,7 @@ class codet:public exprt
8987
/// reported via DATA_INVARIANT violations or exceptions.
9088
static void validate(
9189
const codet &code,
92-
const namespacet &ns,
90+
const namespacet &,
9391
const validation_modet vm = validation_modet::INVARIANT)
9492
{
9593
check_code(code, vm);
@@ -105,7 +103,7 @@ class codet:public exprt
105103
/// reported via DATA_INVARIANT violations or exceptions.
106104
static void validate_full(
107105
const codet &code,
108-
const namespacet &ns,
106+
const namespacet &,
109107
const validation_modet vm = validation_modet::INVARIANT)
110108
{
111109
check_code(code, vm);

src/util/std_expr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ class binary_exprt:public exprt
782782

783783
static void validate(
784784
const exprt &expr,
785-
const namespacet &ns,
785+
const namespacet &,
786786
const validation_modet vm = validation_modet::INVARIANT)
787787
{
788788
check(expr, vm);

src/util/type.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ class typet:public irept
8787
///
8888
/// The validation mode indicates whether well-formedness check failures are
8989
/// reported via DATA_INVARIANT violations or exceptions.
90-
static void check(
91-
const typet &type,
92-
const validation_modet vm = validation_modet::INVARIANT)
90+
static void check(const typet &, const validation_modet)
9391
{
9492
}
9593

@@ -103,7 +101,7 @@ class typet:public irept
103101
/// reported via DATA_INVARIANT violations or exceptions.
104102
static void validate(
105103
const typet &type,
106-
const namespacet &ns,
104+
const namespacet &,
107105
const validation_modet vm = validation_modet::INVARIANT)
108106
{
109107
check_type(type, vm);

unit/analyses/ai/ai.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class instruction_counter_domaint : public ai_domain_baset
7070
return true;
7171
}
7272

73-
bool merge(const instruction_counter_domaint &b, locationt from, locationt to)
73+
bool merge(const instruction_counter_domaint &b, locationt, locationt)
7474
{
7575
if(b.is_bottom())
7676
return false;

unit/path_strategies.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ SCENARIO("path strategies")
6464
std::string c;
6565
GIVEN("a simple conditional program")
6666
{
67-
std::function<void(optionst &)> opts_callback = [](optionst &opts) {};
67+
std::function<void(optionst &)> opts_callback = [](optionst &) {};
6868

6969
c =
7070
"/* 1 */ int main() \n"
@@ -94,7 +94,7 @@ SCENARIO("path strategies")
9494

9595
GIVEN("a program with nested conditionals")
9696
{
97-
std::function<void(optionst &)> opts_callback = [](optionst &opts) {};
97+
std::function<void(optionst &)> opts_callback = [](optionst &) {};
9898

9999
c =
100100
"/* 1 */ int main() \n"
@@ -229,7 +229,7 @@ SCENARIO("path strategies")
229229
std::function<void(optionst &)> halt_callback = [](optionst &opts) {
230230
opts.set_option("stop-on-fail", true);
231231
};
232-
std::function<void(optionst &)> no_halt_callback = [](optionst &opts) {};
232+
std::function<void(optionst &)> no_halt_callback = [](optionst &) {};
233233

234234
c =
235235
"/* 1 */ int main() \n"

unit/solvers/miniBDD/miniBDD.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class bdd_propt:public propt
6161
return to_literal(to_bdd(a) & to_bdd(b));
6262
}
6363

64-
literalt lor(literalt a, literalt b) override
64+
literalt lor(literalt, literalt) override
6565
{
6666
UNREACHABLE;
6767
return {};
@@ -92,19 +92,19 @@ class bdd_propt:public propt
9292
return to_literal(to_bdd(a) ^ to_bdd(b));
9393
}
9494

95-
literalt lxor(const bvt &bv) override
95+
literalt lxor(const bvt &) override
9696
{
9797
UNREACHABLE;
9898
return {};
9999
}
100100

101-
literalt lnand(literalt a, literalt b) override
101+
literalt lnand(literalt, literalt) override
102102
{
103103
UNREACHABLE;
104104
return {};
105105
}
106106

107-
literalt lnor(literalt a, literalt b) override
107+
literalt lnor(literalt, literalt) override
108108
{
109109
UNREACHABLE;
110110
return {};
@@ -115,19 +115,19 @@ class bdd_propt:public propt
115115
return to_literal(to_bdd(a)==to_bdd(b));
116116
}
117117

118-
literalt limplies(literalt a, literalt b) override
118+
literalt limplies(literalt, literalt) override
119119
{
120120
UNREACHABLE;
121121
return {};
122122
}
123123

124-
literalt lselect(literalt a, literalt b, literalt c) override
124+
literalt lselect(literalt, literalt, literalt) override
125125
{
126126
UNREACHABLE;
127127
return {};
128128
}
129129

130-
void lcnf(const bvt &bv) override
130+
void lcnf(const bvt &) override
131131
{
132132
UNREACHABLE;
133133
}
@@ -153,7 +153,7 @@ class bdd_propt:public propt
153153
return {};
154154
}
155155

156-
tvt l_get(literalt a) const override
156+
tvt l_get(literalt) const override
157157
{
158158
UNREACHABLE;
159159
return {};

0 commit comments

Comments
 (0)