summaryrefslogtreecommitdiff
path: root/src/state/activating_state.cpp
diff options
context:
space:
mode:
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>2022-01-26 18:51:08 +0300
committerGitHub <noreply@github.com>2022-01-26 18:51:08 +0300
commit8542fa62c13306e8e8cc623183f105a868a36b6c (patch)
tree34c1706af99fe436a247d2ac49e6fb0faa8f29c2 /src/state/activating_state.cpp
parent6165e07cd0ef6da314ed1ef4f58fe47b7d8112db (diff)
downloadvirtual-media-8542fa62c13306e8e8cc623183f105a868a36b6c.tar.xz
Add -Wextra, remove warnings (#1)
Removed all -Wextra warnings in VM sources. -Wno-unused-parameter has to be disabled due to lots of such warnings in sdbusplus. Tested: Compilation generates no warnings Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Diffstat (limited to 'src/state/activating_state.cpp')
-rw-r--r--src/state/activating_state.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/state/activating_state.cpp b/src/state/activating_state.cpp
index 7506aed..686de99 100644
--- a/src/state/activating_state.cpp
+++ b/src/state/activating_state.cpp
@@ -48,8 +48,8 @@ std::unique_ptr<BasicState>
std::move(gadget), event);
}
-std::unique_ptr<BasicState>
- ActivatingState::handleEvent(SubprocessStoppedEvent event)
+std::unique_ptr<BasicState> ActivatingState::handleEvent([
+ [maybe_unused]] SubprocessStoppedEvent event)
{
LogMsg(Logger::Error, "Process ended prematurely");
return std::make_unique<ReadyState>(machine);
@@ -229,7 +229,7 @@ std::unique_ptr<resource::Process>
args.insert(args.end(), params.begin(), params.end());
if (!process->spawn(args, [&machine = machine, secret = std::move(secret)](
- int exitCode, bool isReady) {
+ int exitCode, [[maybe_unused]] bool isReady) {
LogMsg(Logger::Info, machine.getName(), " process ended.");
machine.getExitCode() = exitCode;
machine.emitSubprocessStoppedEvent();
@@ -278,11 +278,12 @@ std::unique_ptr<resource::Process>
{
// Pack password into buffer
utils::CredentialsProvider::SecureBuffer buff =
- machine.getTarget()->credentials->pack([](const std::string& user,
- const std::string& pass,
- std::vector<char>& buff) {
- std::copy(pass.begin(), pass.end(), std::back_inserter(buff));
- });
+ machine.getTarget()->credentials->pack(
+ []([[maybe_unused]] const std::string& user,
+ const std::string& pass, std::vector<char>& buff) {
+ std::copy(pass.begin(), pass.end(),
+ std::back_inserter(buff));
+ });
// Prepare file to provide the password with
secret = std::make_unique<utils::VolatileFile>(std::move(buff));
@@ -319,7 +320,7 @@ bool ActivatingState::getImagePathFromUrl(const std::string& urlScheme,
}
else
{
- LogMsg(Logger::Error, "Provied url does not match scheme");
+ LogMsg(Logger::Error, "Provided url does not match scheme");
return false;
}
}