From af9c86ffb0e28d35ad94d99c5f77e41578c972b4 Mon Sep 17 00:00:00 2001 From: "Eduardo Ramos Testillano (eramedu)" Date: Sun, 24 May 2020 17:36:36 +0200 Subject: [PATCH] Remove warnings (work package 1) --- .gitignore | 1 + include/anna/timex/Context.hpp | 4 ++-- source/comm/ClientSocket.cpp | 8 -------- source/comm/Socket.cpp | 3 --- source/core/DataBlock.cpp | 2 +- source/core/functions.cpp | 2 +- source/statistics/Engine.cpp | 2 +- 7 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index ab64cc3..3e55864 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ CMakeDoxygenDefaults.cmake # Deployments docker-images/anna-adml-http/opt/ +aots-deploy/ # Component test (pytest) example/diameter/launcher/resources/rest_api/ct/**/__pycache__ diff --git a/include/anna/timex/Context.hpp b/include/anna/timex/Context.hpp index d828fae..ab66859 100644 --- a/include/anna/timex/Context.hpp +++ b/include/anna/timex/Context.hpp @@ -116,12 +116,12 @@ public: Transaction* result = (ii != a_transactions.end()) ? transaction(ii) : NULL; if(result == NULL) { - if(Exception::Mode::Throw) { + if(emode == Exception::Mode::Throw) { std::string msg("Transaction: "); msg += identifierAsString(tid); msg += " | Tid not found"; throw RuntimeException(msg, ANNA_FILE_LOCATION); - } else if(Exception::Mode::Trace && Logger::isActive(Logger::Warning)) { + } else if(emode == Exception::Mode::Trace && Logger::isActive(Logger::Warning)) { std::string msg("Transaction: "); msg += identifierAsString(tid); msg += " | Tid not found"; diff --git a/source/comm/ClientSocket.cpp b/source/comm/ClientSocket.cpp index b531581..3bff830 100644 --- a/source/comm/ClientSocket.cpp +++ b/source/comm/ClientSocket.cpp @@ -697,9 +697,6 @@ string comm::ClientSocket::asString() const throw() { string msg("comm::ClientSocket { "); - if (this == NULL) - return msg += " }"; - msg += Socket::asString(); msg += functions::asText(" | RcvBufferSize: ", a_rcvBufferSize); msg += " bytes | Status: "; @@ -719,11 +716,6 @@ xml::Node* comm::ClientSocket::asXML(xml::Node* parent) const throw(RuntimeException) { xml::Node* clientSocket = parent->createChild("comm.ClientSocket"); - if (this == NULL) { - clientSocket->createAttribute("Freed", "yes"); - return clientSocket; - } - Socket::asXML(clientSocket); clientSocket->createAttribute("Status", Status::asString(a_status)); clientSocket->createAttribute("RcvBufferSize", a_rcvBufferSize); diff --git a/source/comm/Socket.cpp b/source/comm/Socket.cpp index 9a7db2b..9f770f3 100644 --- a/source/comm/Socket.cpp +++ b/source/comm/Socket.cpp @@ -239,9 +239,6 @@ std::string Socket::asString() const throw() { std::string msg("comm::Socket { Domain: "); - if(this == NULL) - return msg += " }"; - switch(a_domain) { case Domain::Unix: msg += "Unix"; break; case Domain::Inet: msg += "Inet"; break; diff --git a/source/core/DataBlock.cpp b/source/core/DataBlock.cpp index 3e13027..38700a2 100644 --- a/source/core/DataBlock.cpp +++ b/source/core/DataBlock.cpp @@ -231,7 +231,7 @@ throw(RuntimeException) { std::string DataBlock::asString(const int characterByLine) const throw() { - char aux [8]; + char aux [16]; std::string numbers; std::string characters; unsigned char c; diff --git a/source/core/functions.cpp b/source/core/functions.cpp index 217fd0a..8752a2e 100644 --- a/source/core/functions.cpp +++ b/source/core/functions.cpp @@ -151,7 +151,7 @@ const char* functions::asDateTime(const Second &second, char* result) throw() { struct tm* tt = localtime((time_t*) & second); sprintf( - result, "%02d/%02d/%4d %02d:%02d:%02d", + result, "%02u/%02u/%4u %02u:%02u:%02u", tt->tm_mday, tt->tm_mon + 1, tt->tm_year + 1900, tt->tm_hour, tt->tm_min, tt->tm_sec ); diff --git a/source/statistics/Engine.cpp b/source/statistics/Engine.cpp index 79a23ce..622e58c 100644 --- a/source/statistics/Engine.cpp +++ b/source/statistics/Engine.cpp @@ -209,7 +209,7 @@ std::string Engine::asString(void) const throw() { trace += "\n"; trace += "\n Concept id: "; trace += anna::functions::asString((*iter).first); - if((*iter).second.SampleFile != "") trace += "\n Sample file: "; trace += (*iter).second.SampleFile; + if((*iter).second.SampleFile != "") { trace += "\n Sample file: "; trace += (*iter).second.SampleFile; } trace += "\n Description: "; trace += (*iter).second.Description; trace += "\n Unit: "; trace += (*iter).second.Unit; -- 2.20.1