Skip to content

Commit

Permalink
Fix most of the warnings (#165)
Browse files Browse the repository at this point in the history
* Fix a bunch of warnings
  • Loading branch information
knopers8 authored and Barthelemy committed May 28, 2019
1 parent aefc297 commit 0b6786a
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 20 deletions.
6 changes: 5 additions & 1 deletion Framework/include/QualityControl/ServiceDiscovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <memory>
#include <string>
#include <thread>
#include <boost/asio/ip/host_name.hpp>

namespace o2::quality_control::core
{
Expand Down Expand Up @@ -58,7 +59,10 @@ class ServiceDiscovery
/// Health check thread loop
void runHealthServer(unsigned int port);

static inline std::string GetDefaultUrl(); ///< Provides default health check URL
static inline std::string GetDefaultUrl() ///< Provides default health check URL
{
return boost::asio::ip::host_name() + ":" + std::to_string(7777);
}
};

} // namespace o2::quality_control::core
Expand Down
7 changes: 4 additions & 3 deletions Framework/src/Checker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ void Checker::init(framework::InitContext&)
mCollector = MonitoringFactory::Get("infologger://");
} catch (...) {
std::string diagnostic = boost::current_exception_diagnostic_information();
LOG(ERROR) << "Unexpected exception, diagnostic information follows:\n" << diagnostic;
LOG(ERROR) << "Unexpected exception, diagnostic information follows:\n"
<< diagnostic;
throw;
}
startFirstObject = system_clock::time_point::min();
Expand All @@ -110,13 +111,13 @@ void Checker::run(framework::ProcessingContext& ctx)
startFirstObject = system_clock::now();
}

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

for (const auto& to : *moArray) {
std::shared_ptr<MonitorObject> mo{dynamic_cast<MonitorObject*>(to)};
std::shared_ptr<MonitorObject> mo{ dynamic_cast<MonitorObject*>(to) };
moArray->RemoveFirst();
if (mo) {
check(mo);
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/CheckerFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DataProcessorSpec CheckerFactory::create(std::string checkerName, std::string ta
std::vector<std::string>{},
std::vector<DataProcessorLabel>{} };

return std::move(newChecker);
return newChecker;
}

} // namespace o2::quality_control::checker
3 changes: 1 addition & 2 deletions Framework/src/DataDumpGui.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ void updatePayloadGui()
// header row
ImGui::Separator();
resizeColumns(representation /*, old_representation*/);
ImGui::Text("");
ImGui::NextColumn();
ImGui::Text("#1");
ImGui::NextColumn();
Expand Down Expand Up @@ -211,7 +210,7 @@ void updateHeaderGui()
ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, ImGui::GetTextLineHeightWithSpacing() * 7),
false);
ImGui::Text("Header size : %d", header->headerSize);
ImGui::Text("Payload size : %llu", header->payloadSize);
ImGui::Text("Payload size : %llu", static_cast<unsigned long long int>(header->payloadSize));
ImGui::Text("Header version : %d", header->headerVersion);
ImGui::Text("flagsNextHeader : %d", header->flagsNextHeader);
ImGui::Text("dataDescription : %s", header->dataDescription.str);
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/ExamplePrinterSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ExamplePrinterSpec : public framework::Task
void run(ProcessingContext& processingContext) final
{
LOG(INFO) << "Received data";
std::shared_ptr<TObjArray> moArray{ std::move(DataRefUtils::as<TObjArray>(*processingContext.inputs().begin())) };
std::shared_ptr<TObjArray> moArray{ DataRefUtils::as<TObjArray>(*processingContext.inputs().begin()) };

if (moArray->IsEmpty()) {
LOG(INFO) << "Array is empty";
Expand Down
2 changes: 2 additions & 0 deletions Framework/src/InformationService.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ bool InformationService::handleTaskInputData(std::string receivedData)

// publish
sendJson(json);

return true;
}

void InformationService::readFakeDataFile(std::string fakeDataFile)
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/InformationService.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace pt = boost::property_tree;
/// See runInformationService.cxx for the steering code.
///
/// Example usage :
/// qcInfoService -c /absolute/path/to/InformationService.json -n information_service \\
/// qcInfoService -c /absolute/path/to/InformationService.json -n information_service
/// --id information_service --mq-config /absolute/path/to/InformationService.json
///
/// Format of the string coming from the tasks :
Expand Down
6 changes: 0 additions & 6 deletions Framework/src/ServiceDiscovery.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@
#include <boost/asio.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/asio/ip/host_name.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string.hpp>

namespace o2::quality_control::core
{

std::string ServiceDiscovery::GetDefaultUrl()
{
return boost::asio::ip::host_name() + ":" + std::to_string(7777);
}

ServiceDiscovery::ServiceDiscovery(const std::string& url, const std::string& id, const std::string& healthEndpoint) : curlHandle(initCurl(), &ServiceDiscovery::deleteCurl), mConsulUrl(url), mId(id), mHealthEndpoint(healthEndpoint)
{
// parameter check
Expand Down
2 changes: 1 addition & 1 deletion Framework/src/TaskRunnerFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TaskRunnerFactory::create(std::string taskName, std::string configurationSource,
adaptFromTask<TaskRunner>(std::move(qcTask))
};

return std::move(newTask);
return newTask;
}

} // namespace o2::quality_control::core
1 change: 1 addition & 0 deletions Framework/src/runBasic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/// of glfw being installed or not, in the terminal all the logs will be shown as well.

#include "Framework/DataSampling.h"

using namespace o2::framework;

void customize(std::vector<CompletionPolicy>& policies)
Expand Down
4 changes: 2 additions & 2 deletions Framework/src/runnerUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ std::string getFirstTaskName(std::string configurationSource)
{
auto config = o2::configuration::ConfigurationFactory::getConfiguration(configurationSource);

for (const auto&[taskName, taskConfig] : config->getRecursive("qc.tasks")) {
return taskName;
for (const auto& task : config->getRecursive("qc.tasks")) {
return task.first; // task name;
}

throw;
Expand Down
2 changes: 1 addition & 1 deletion Framework/test/testDbFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using namespace o2::quality_control::core;
namespace o2::quality_control::repository
{

bool do_nothing(AliceO2::Common::FatalException const& ex) { return true; }
bool do_nothing(AliceO2::Common::FatalException const&) { return true; }

BOOST_AUTO_TEST_CASE(db_factory_test)
{
Expand Down
2 changes: 1 addition & 1 deletion Modules/Skeleton/src/SkeletonTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SkeletonTask::~SkeletonTask() {
}
}

void SkeletonTask::initialize(o2::framework::InitContext& ctx)
void SkeletonTask::initialize(o2::framework::InitContext& /*ctx*/)
{
QcInfoLogger::GetInstance() << "initialize SkeletonTask" << AliceO2::InfoLogger::InfoLogger::endm;

Expand Down

0 comments on commit 0b6786a

Please sign in to comment.