Skip to content

Commit 0b6786a

Browse files
knopers8Barthelemy
authored andcommitted
Fix most of the warnings (#165)
* Fix a bunch of warnings
1 parent aefc297 commit 0b6786a

13 files changed

Lines changed: 21 additions & 20 deletions

Framework/include/QualityControl/ServiceDiscovery.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <memory>
1111
#include <string>
1212
#include <thread>
13+
#include <boost/asio/ip/host_name.hpp>
1314

1415
namespace o2::quality_control::core
1516
{
@@ -58,7 +59,10 @@ class ServiceDiscovery
5859
/// Health check thread loop
5960
void runHealthServer(unsigned int port);
6061

61-
static inline std::string GetDefaultUrl(); ///< Provides default health check URL
62+
static inline std::string GetDefaultUrl() ///< Provides default health check URL
63+
{
64+
return boost::asio::ip::host_name() + ":" + std::to_string(7777);
65+
}
6266
};
6367

6468
} // namespace o2::quality_control::core

Framework/src/Checker.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ void Checker::init(framework::InitContext&)
9494
mCollector = MonitoringFactory::Get("infologger://");
9595
} catch (...) {
9696
std::string diagnostic = boost::current_exception_diagnostic_information();
97-
LOG(ERROR) << "Unexpected exception, diagnostic information follows:\n" << diagnostic;
97+
LOG(ERROR) << "Unexpected exception, diagnostic information follows:\n"
98+
<< diagnostic;
9899
throw;
99100
}
100101
startFirstObject = system_clock::time_point::min();
@@ -110,13 +111,13 @@ void Checker::run(framework::ProcessingContext& ctx)
110111
startFirstObject = system_clock::now();
111112
}
112113

113-
std::shared_ptr<TObjArray> moArray{ std::move(framework::DataRefUtils::as<TObjArray>(*ctx.inputs().begin())) };
114+
std::shared_ptr<TObjArray> moArray{ framework::DataRefUtils::as<TObjArray>(*ctx.inputs().begin()) };
114115
moArray->SetOwner(false);
115116
auto checkedMoArray = std::make_unique<TObjArray>();
116117
checkedMoArray->SetOwner();
117118

118119
for (const auto& to : *moArray) {
119-
std::shared_ptr<MonitorObject> mo{dynamic_cast<MonitorObject*>(to)};
120+
std::shared_ptr<MonitorObject> mo{ dynamic_cast<MonitorObject*>(to) };
120121
moArray->RemoveFirst();
121122
if (mo) {
122123
check(mo);

Framework/src/CheckerFactory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DataProcessorSpec CheckerFactory::create(std::string checkerName, std::string ta
3636
std::vector<std::string>{},
3737
std::vector<DataProcessorLabel>{} };
3838

39-
return std::move(newChecker);
39+
return newChecker;
4040
}
4141

4242
} // namespace o2::quality_control::checker

Framework/src/DataDumpGui.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void updatePayloadGui()
139139
// header row
140140
ImGui::Separator();
141141
resizeColumns(representation /*, old_representation*/);
142-
ImGui::Text("");
143142
ImGui::NextColumn();
144143
ImGui::Text("#1");
145144
ImGui::NextColumn();
@@ -211,7 +210,7 @@ void updateHeaderGui()
211210
ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, ImGui::GetTextLineHeightWithSpacing() * 7),
212211
false);
213212
ImGui::Text("Header size : %d", header->headerSize);
214-
ImGui::Text("Payload size : %llu", header->payloadSize);
213+
ImGui::Text("Payload size : %llu", static_cast<unsigned long long int>(header->payloadSize));
215214
ImGui::Text("Header version : %d", header->headerVersion);
216215
ImGui::Text("flagsNextHeader : %d", header->flagsNextHeader);
217216
ImGui::Text("dataDescription : %s", header->dataDescription.str);

Framework/src/ExamplePrinterSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ExamplePrinterSpec : public framework::Task
3131
void run(ProcessingContext& processingContext) final
3232
{
3333
LOG(INFO) << "Received data";
34-
std::shared_ptr<TObjArray> moArray{ std::move(DataRefUtils::as<TObjArray>(*processingContext.inputs().begin())) };
34+
std::shared_ptr<TObjArray> moArray{ DataRefUtils::as<TObjArray>(*processingContext.inputs().begin()) };
3535

3636
if (moArray->IsEmpty()) {
3737
LOG(INFO) << "Array is empty";

Framework/src/InformationService.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ bool InformationService::handleTaskInputData(std::string receivedData)
119119

120120
// publish
121121
sendJson(json);
122+
123+
return true;
122124
}
123125

124126
void InformationService::readFakeDataFile(std::string fakeDataFile)

Framework/src/InformationService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace pt = boost::property_tree;
3838
/// See runInformationService.cxx for the steering code.
3939
///
4040
/// Example usage :
41-
/// qcInfoService -c /absolute/path/to/InformationService.json -n information_service \\
41+
/// qcInfoService -c /absolute/path/to/InformationService.json -n information_service
4242
/// --id information_service --mq-config /absolute/path/to/InformationService.json
4343
///
4444
/// Format of the string coming from the tasks :

Framework/src/ServiceDiscovery.cxx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@
88
#include <boost/asio.hpp>
99
#include <boost/property_tree/ptree.hpp>
1010
#include <boost/property_tree/json_parser.hpp>
11-
#include <boost/asio/ip/host_name.hpp>
1211
#include <boost/algorithm/string/split.hpp>
1312
#include <boost/algorithm/string.hpp>
1413

1514
namespace o2::quality_control::core
1615
{
1716

18-
std::string ServiceDiscovery::GetDefaultUrl()
19-
{
20-
return boost::asio::ip::host_name() + ":" + std::to_string(7777);
21-
}
22-
2317
ServiceDiscovery::ServiceDiscovery(const std::string& url, const std::string& id, const std::string& healthEndpoint) : curlHandle(initCurl(), &ServiceDiscovery::deleteCurl), mConsulUrl(url), mId(id), mHealthEndpoint(healthEndpoint)
2418
{
2519
// parameter check

Framework/src/TaskRunnerFactory.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TaskRunnerFactory::create(std::string taskName, std::string configurationSource,
3434
adaptFromTask<TaskRunner>(std::move(qcTask))
3535
};
3636

37-
return std::move(newTask);
37+
return newTask;
3838
}
3939

4040
} // namespace o2::quality_control::core

Framework/src/runBasic.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
/// of glfw being installed or not, in the terminal all the logs will be shown as well.
3535

3636
#include "Framework/DataSampling.h"
37+
3738
using namespace o2::framework;
3839

3940
void customize(std::vector<CompletionPolicy>& policies)

0 commit comments

Comments
 (0)