Skip to content

Commit 8e973d7

Browse files
author
matthias
committed
WT-11772: Resolve some Wunused-parameter warnings
These mostly come from the signature being copied from an interface. In some cases, we cannot remove the warning, if a default value is being assigned to it. These warnings will be resolved in the next commit.
1 parent d226e97 commit 8e973d7

File tree

118 files changed

+489
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+489
-508
lines changed

src/3rdparty/rapidxml/rapidxml_print.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ namespace rapidxml
206206

207207
// Print attributes of the node
208208
template<class OutIt, class Ch>
209-
inline OutIt print_attributes(OutIt out, const xml_node<Ch> *node, int flags)
209+
inline OutIt print_attributes(OutIt out, const xml_node<Ch> *node, int)
210210
{
211211
for (xml_attribute<Ch> *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute())
212212
{

src/Wt/Auth/AbstractUserDatabase.C

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,25 @@ AbstractUserDatabase::Transaction *AbstractUserDatabase::startTransaction()
5252
return nullptr;
5353
}
5454

55-
AccountStatus AbstractUserDatabase::status(const User& user) const
55+
AccountStatus AbstractUserDatabase::status(WT_MAYBE_UNUSED const User& user) const
5656
{
5757
return AccountStatus::Normal;
5858
}
5959

60-
void AbstractUserDatabase::setStatus(const User& user, AccountStatus status)
60+
void AbstractUserDatabase::setStatus(WT_MAYBE_UNUSED const User& user, WT_MAYBE_UNUSED AccountStatus status)
6161
{
6262
LOG_ERROR(Require("setStatus()").what());
6363
}
6464

65-
PasswordHash AbstractUserDatabase::password(const User& user) const
65+
PasswordHash AbstractUserDatabase::password(WT_MAYBE_UNUSED const User& user) const
6666
{
6767
LOG_ERROR(Require("password()", PASSWORDS).what());
6868

6969
return PasswordHash();
7070
}
7171

72-
void AbstractUserDatabase::setPassword(const User& user,
73-
const PasswordHash& password)
72+
void AbstractUserDatabase::setPassword(WT_MAYBE_UNUSED const User& user,
73+
WT_MAYBE_UNUSED const PasswordHash& password)
7474
{
7575
LOG_ERROR(Require("setPassword()", PASSWORDS).what());
7676
}
@@ -90,245 +90,245 @@ User AbstractUserDatabase::registerNew()
9090
return User();
9191
}
9292

93-
void AbstractUserDatabase::deleteUser(const User& user)
93+
void AbstractUserDatabase::deleteUser(WT_MAYBE_UNUSED const User& user)
9494
{
9595
LOG_ERROR(Require("deleteUser()", REGISTRATION).what());
9696
}
9797

98-
std::string AbstractUserDatabase::email(const User& user) const
98+
std::string AbstractUserDatabase::email(WT_MAYBE_UNUSED const User& user) const
9999
{
100100
LOG_ERROR(Require("email()", EMAIL_VERIFICATION).what());
101101

102102
return std::string();
103103
}
104104

105-
bool AbstractUserDatabase::setEmail(const User& user,
106-
const std::string& address)
105+
bool AbstractUserDatabase::setEmail(WT_MAYBE_UNUSED const User& user,
106+
WT_MAYBE_UNUSED const std::string& address)
107107
{
108108
LOG_ERROR(Require("setEmail()", EMAIL_VERIFICATION).what());
109109
return false;
110110
}
111111

112-
User AbstractUserDatabase::findWithEmail(const std::string& address) const
112+
User AbstractUserDatabase::findWithEmail(WT_MAYBE_UNUSED const std::string& address) const
113113
{
114114
LOG_ERROR(Require("findWithEmail()", EMAIL_VERIFICATION).what());
115115

116116
return User();
117117
}
118118

119-
std::string AbstractUserDatabase::unverifiedEmail(const User& user) const
119+
std::string AbstractUserDatabase::unverifiedEmail(WT_MAYBE_UNUSED const User& user) const
120120
{
121121
LOG_ERROR(Require("unverifiedEmail()", EMAIL_VERIFICATION).what());
122122

123123
return std::string();
124124
}
125125

126-
void AbstractUserDatabase::setUnverifiedEmail(const User& user,
127-
const std::string& address)
126+
void AbstractUserDatabase::setUnverifiedEmail(WT_MAYBE_UNUSED const User& user,
127+
WT_MAYBE_UNUSED const std::string& address)
128128
{
129129
LOG_ERROR(Require("setUnverifiedEmail()", EMAIL_VERIFICATION).what());
130130
}
131131

132-
Token AbstractUserDatabase::emailToken(const User& user) const
132+
Token AbstractUserDatabase::emailToken(WT_MAYBE_UNUSED const User& user) const
133133
{
134134
LOG_ERROR(Require("emailToken()", EMAIL_VERIFICATION).what());
135135

136136
return Token();
137137
}
138138

139-
EmailTokenRole AbstractUserDatabase::emailTokenRole(const User& user)
139+
EmailTokenRole AbstractUserDatabase::emailTokenRole(WT_MAYBE_UNUSED const User& user)
140140
const
141141
{
142142
LOG_ERROR(Require("emailTokenRole()", EMAIL_VERIFICATION).what());
143143

144144
return EmailTokenRole::VerifyEmail;
145145
}
146146

147-
void AbstractUserDatabase::setEmailToken(const User& user, const Token& token,
148-
EmailTokenRole role)
147+
void AbstractUserDatabase::setEmailToken(WT_MAYBE_UNUSED const User& user, WT_MAYBE_UNUSED const Token& token,
148+
WT_MAYBE_UNUSED EmailTokenRole role)
149149
{
150150
LOG_ERROR(Require("setEmailToken()", EMAIL_VERIFICATION).what());
151151
}
152152

153-
User AbstractUserDatabase::findWithEmailToken(const std::string& hash) const
153+
User AbstractUserDatabase::findWithEmailToken(WT_MAYBE_UNUSED const std::string& hash) const
154154
{
155155
LOG_ERROR(Require("findWithEmailToken()", EMAIL_VERIFICATION).what());
156156

157157
return User();
158158
}
159159

160-
void AbstractUserDatabase::addAuthToken(const User& user, const Token& token)
160+
void AbstractUserDatabase::addAuthToken(WT_MAYBE_UNUSED const User& user, WT_MAYBE_UNUSED const Token& token)
161161
{
162162
LOG_ERROR(Require("addAuthToken()", AUTH_TOKEN).what());
163163
}
164164

165-
void AbstractUserDatabase::removeAuthToken(const User& user,
166-
const std::string& hash)
165+
void AbstractUserDatabase::removeAuthToken(WT_MAYBE_UNUSED const User& user,
166+
WT_MAYBE_UNUSED const std::string& hash)
167167
{
168168
LOG_ERROR(Require("removeAuthToken()", AUTH_TOKEN).what());
169169
}
170170

171-
int AbstractUserDatabase::updateAuthToken(const User& user,
172-
const std::string& hash,
173-
const std::string& newHash)
171+
int AbstractUserDatabase::updateAuthToken(WT_MAYBE_UNUSED const User& user,
172+
WT_MAYBE_UNUSED const std::string& hash,
173+
WT_MAYBE_UNUSED const std::string& newHash)
174174
{
175175
LOG_WARN(Require("updateAuthToken()", AUTH_TOKEN).what());
176176

177177
return -1;
178178
}
179179

180-
User AbstractUserDatabase::findWithAuthToken(const std::string& hash) const
180+
User AbstractUserDatabase::findWithAuthToken(WT_MAYBE_UNUSED const std::string& hash) const
181181
{
182182
LOG_ERROR(Require("findWithAuthToken()", AUTH_TOKEN).what());
183183

184184
return User();
185185
}
186186

187-
int AbstractUserDatabase::failedLoginAttempts(const User& user) const
187+
int AbstractUserDatabase::failedLoginAttempts(WT_MAYBE_UNUSED const User& user) const
188188
{
189189
LOG_ERROR(Require("failedLoginAttempts()", THROTTLING).what());
190190

191191
return 0;
192192
}
193193

194-
void AbstractUserDatabase::setFailedLoginAttempts(const User& user, int count)
194+
void AbstractUserDatabase::setFailedLoginAttempts(WT_MAYBE_UNUSED const User& user, WT_MAYBE_UNUSED int count)
195195
{
196196
LOG_ERROR(Require("setFailedLoginAttempts()", THROTTLING).what());
197197
}
198198

199-
WDateTime AbstractUserDatabase::lastLoginAttempt(const User& user) const
199+
WDateTime AbstractUserDatabase::lastLoginAttempt(WT_MAYBE_UNUSED const User& user) const
200200
{
201201
LOG_ERROR(Require("lastLoginAttempt()", THROTTLING).what());
202202

203203
return WDateTime(WDate(1970, 1, 1));
204204
}
205205

206-
void AbstractUserDatabase::setLastLoginAttempt(const User& user,
207-
const WDateTime& t)
206+
void AbstractUserDatabase::setLastLoginAttempt(WT_MAYBE_UNUSED const User& user,
207+
WT_MAYBE_UNUSED const WDateTime& timestamp)
208208
{
209209
LOG_ERROR(Require("setLastLoginAttempt()", THROTTLING).what());
210210
}
211211

212212
// ...
213-
Auth::IssuedToken AbstractUserDatabase::idpTokenAdd(const std::string& value,
214-
const WDateTime& expirationTime,
215-
const std::string& purpose,
216-
const std::string& scope,
217-
const std::string& redirectUri,
218-
const User& user,
219-
const OAuthClient& authClient)
213+
Auth::IssuedToken AbstractUserDatabase::idpTokenAdd(WT_MAYBE_UNUSED const std::string& value,
214+
WT_MAYBE_UNUSED const WDateTime& expirationTime,
215+
WT_MAYBE_UNUSED const std::string& purpose,
216+
WT_MAYBE_UNUSED const std::string& scope,
217+
WT_MAYBE_UNUSED const std::string& redirectUri,
218+
WT_MAYBE_UNUSED const User& user,
219+
WT_MAYBE_UNUSED const OAuthClient& authClient)
220220
{
221221
LOG_ERROR(Require("idpTokenAdd()", IDP_SUPPORT).what());
222222
return IssuedToken();
223223
}
224224

225-
void AbstractUserDatabase::idpTokenRemove(const IssuedToken& token)
225+
void AbstractUserDatabase::idpTokenRemove(WT_MAYBE_UNUSED const IssuedToken& token)
226226
{
227227
LOG_ERROR(Require("idpTokenRemove()", IDP_SUPPORT).what());
228228
}
229229

230230
IssuedToken AbstractUserDatabase::idpTokenFindWithValue(
231-
const std::string& purpose, const std::string& value) const
231+
WT_MAYBE_UNUSED const std::string& purpose, WT_MAYBE_UNUSED const std::string& scope) const
232232
{
233233
LOG_ERROR(Require("idpTokenFindWithValue()", IDP_SUPPORT).what());
234234
return IssuedToken();
235235
}
236236

237-
WDateTime AbstractUserDatabase::idpTokenExpirationTime(const IssuedToken &token) const
237+
WDateTime AbstractUserDatabase::idpTokenExpirationTime(WT_MAYBE_UNUSED const IssuedToken& token) const
238238
{
239239
LOG_ERROR(Require("idpTokenExpirationTime)", IDP_SUPPORT).what());
240240
return WDateTime(WDate(1970, 1, 1));
241241
}
242242

243-
std::string AbstractUserDatabase::idpTokenValue(const IssuedToken &token) const
243+
std::string AbstractUserDatabase::idpTokenValue(WT_MAYBE_UNUSED const IssuedToken& token) const
244244
{
245245
LOG_ERROR(Require("idpTokenValue()", IDP_SUPPORT).what());
246246
return std::string();
247247
}
248248

249-
std::string AbstractUserDatabase::idpTokenPurpose(const IssuedToken &token) const
249+
std::string AbstractUserDatabase::idpTokenPurpose(WT_MAYBE_UNUSED const IssuedToken& token) const
250250
{
251251
LOG_ERROR(Require("idpTokenPurpose()", IDP_SUPPORT).what());
252252
return std::string();
253253
}
254254

255-
std::string AbstractUserDatabase::idpTokenScope(const IssuedToken &token) const
255+
std::string AbstractUserDatabase::idpTokenScope(WT_MAYBE_UNUSED const IssuedToken& token) const
256256
{
257257
LOG_ERROR(Require("idpTokenScope()", IDP_SUPPORT).what());
258258
return std::string();
259259
}
260260

261-
std::string AbstractUserDatabase::idpTokenRedirectUri(const IssuedToken &token) const
261+
std::string AbstractUserDatabase::idpTokenRedirectUri(WT_MAYBE_UNUSED const IssuedToken& token) const
262262
{
263263
LOG_ERROR(Require("idpTokenRedirectUri()", IDP_SUPPORT).what());
264264
return std::string();
265265
}
266266

267-
User AbstractUserDatabase::idpTokenUser(const IssuedToken &token) const
267+
User AbstractUserDatabase::idpTokenUser(WT_MAYBE_UNUSED const IssuedToken& token) const
268268
{
269269
LOG_ERROR(Require("idpTokenUser()", IDP_SUPPORT).what());
270270
return User();
271271
}
272272

273-
OAuthClient AbstractUserDatabase::idpTokenOAuthClient(const IssuedToken &token) const
273+
OAuthClient AbstractUserDatabase::idpTokenOAuthClient(WT_MAYBE_UNUSED const IssuedToken& token) const
274274
{
275275
LOG_ERROR(Require("idpTokenOAuthClient()", IDP_SUPPORT).what());
276276
return OAuthClient();
277277
}
278278

279-
Json::Value AbstractUserDatabase::idpJsonClaim(const User& user, const std::string& claim) const
279+
Json::Value AbstractUserDatabase::idpJsonClaim(WT_MAYBE_UNUSED const User& user, WT_MAYBE_UNUSED const std::string& claim) const
280280
{
281281
LOG_ERROR(Require("idpClaim()", IDP_SUPPORT).what());
282282
return Wt::Json::Value::Null; // full namespace for cnor
283283
}
284284

285-
OAuthClient AbstractUserDatabase::idpClientFindWithId(const std::string &clientId) const
285+
OAuthClient AbstractUserDatabase::idpClientFindWithId(WT_MAYBE_UNUSED const std::string& clientId) const
286286
{
287287
LOG_ERROR(Require("idpClientFindWithId()", IDP_SUPPORT).what());
288288
return OAuthClient();
289289
}
290290

291-
std::string AbstractUserDatabase::idpClientSecret(const OAuthClient &client) const
291+
std::string AbstractUserDatabase::idpClientSecret(WT_MAYBE_UNUSED const OAuthClient& client) const
292292
{
293293
LOG_ERROR(Require("idpClientSecret()", IDP_SUPPORT).what());
294294
return std::string();
295295
}
296296

297-
bool AbstractUserDatabase::idpVerifySecret(const OAuthClient &client, const std::string& secret) const
297+
bool AbstractUserDatabase::idpVerifySecret(WT_MAYBE_UNUSED const OAuthClient& client, WT_MAYBE_UNUSED const std::string& secret) const
298298
{
299299
LOG_ERROR(Require("idpVerifySecret()", IDP_SUPPORT).what());
300300
return false;
301301
}
302302

303-
std::set<std::string> AbstractUserDatabase::idpClientRedirectUris(const OAuthClient &client) const
303+
std::set<std::string> AbstractUserDatabase::idpClientRedirectUris(WT_MAYBE_UNUSED const OAuthClient& client) const
304304
{
305305
LOG_ERROR(Require("idpClientRedirectUris()", IDP_SUPPORT).what());
306306
return std::set<std::string>();
307307
}
308308

309-
std::string AbstractUserDatabase::idpClientId(const OAuthClient &client) const
309+
std::string AbstractUserDatabase::idpClientId(WT_MAYBE_UNUSED const OAuthClient& client) const
310310
{
311311
LOG_ERROR(Require("idpClientId()", IDP_SUPPORT).what());
312312
return std::string();
313313
}
314314

315-
bool AbstractUserDatabase::idpClientConfidential(const OAuthClient &client) const
315+
bool AbstractUserDatabase::idpClientConfidential(WT_MAYBE_UNUSED const OAuthClient& client) const
316316
{
317317
LOG_ERROR(Require("idpClientConfidential()", IDP_SUPPORT).what());
318318
return false;
319319
}
320320

321-
ClientSecretMethod AbstractUserDatabase::idpClientAuthMethod(const OAuthClient &client) const
321+
ClientSecretMethod AbstractUserDatabase::idpClientAuthMethod(WT_MAYBE_UNUSED const OAuthClient& client) const
322322
{
323323
LOG_ERROR(Require("idpClientAuthMethod()", IDP_SUPPORT).what());
324324
return HttpAuthorizationBasic;
325325
}
326326

327-
OAuthClient AbstractUserDatabase::idpClientAdd(const std::string& clientId,
328-
bool confidential,
329-
const std::set<std::string> &redirectUris,
330-
ClientSecretMethod authMethod,
331-
const std::string &secret)
327+
OAuthClient AbstractUserDatabase::idpClientAdd(WT_MAYBE_UNUSED const std::string& clientId,
328+
WT_MAYBE_UNUSED bool confidential,
329+
WT_MAYBE_UNUSED const std::set<std::string>& redirectUris,
330+
WT_MAYBE_UNUSED ClientSecretMethod authMethod,
331+
WT_MAYBE_UNUSED const std::string& secret)
332332
{
333333
LOG_ERROR(Require("idpTokenAdd()", IDP_SUPPORT).what());
334334
return OAuthClient();

src/Wt/Auth/AuthWidget.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void AuthWidget::onPathChange(const std::string& path)
106106
handleRegistrationPath(path);
107107
}
108108

109-
bool AuthWidget::handleRegistrationPath(const std::string& path)
109+
bool AuthWidget::handleRegistrationPath(WT_MAYBE_UNUSED const std::string& path)
110110
{
111111
if (!basePath_.empty()) {
112112
WApplication *app = WApplication::instance();

src/Wt/Auth/HashFunction.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ std::string BCryptHashFunction::compute(const std::string& msg,
112112
}
113113

114114
bool BCryptHashFunction::verify(const std::string& msg,
115-
const std::string& salt,
115+
WT_MAYBE_UNUSED const std::string& salt,
116116
const std::string& hash) const
117117
{
118118
char result[64];

src/Wt/Auth/OAuthService.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ void OAuthProcess::connectStartAuthenticate(EventSignalBase &s)
304304
}
305305
#endif
306306

307-
void OAuthProcess::getIdentity(const OAuthAccessToken& token)
307+
void OAuthProcess::getIdentity(WT_MAYBE_UNUSED const OAuthAccessToken& token)
308308
{
309309
throw WException("OAuth::Process::Identity(): not specialized");
310310
}

src/Wt/Auth/OAuthTokenEndpoint.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void OAuthTokenEndpoint::handleRequest(const Http::Request &request, Http::Respo
214214
}
215215

216216
const std::string OAuthTokenEndpoint::idTokenPayload(const std::string &clientId,
217-
const std::string &scope,
217+
WT_MAYBE_UNUSED const std::string& scope,
218218
const User &user)
219219
{
220220
Json::Object root;

src/Wt/Auth/RegistrationWidget.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void RegistrationWidget::doRegister()
278278
t->commit();
279279
}
280280

281-
void RegistrationWidget::registerUserDetails(User& user)
281+
void RegistrationWidget::registerUserDetails(WT_MAYBE_UNUSED User& user)
282282
{ }
283283

284284
void RegistrationWidget::close()

0 commit comments

Comments
 (0)