Remove warnings (work package 1)
authorEduardo Ramos Testillano (eramedu) <eduardo.ramos.testillano@ericsson.com>
Sun, 24 May 2020 15:36:36 +0000 (17:36 +0200)
committerEduardo Ramos Testillano (eramedu) <eduardo.ramos.testillano@ericsson.com>
Sun, 24 May 2020 19:22:02 +0000 (21:22 +0200)
.gitignore
include/anna/timex/Context.hpp
source/comm/ClientSocket.cpp
source/comm/Socket.cpp
source/core/DataBlock.cpp
source/core/functions.cpp
source/statistics/Engine.cpp

index ab64cc3..3e55864 100644 (file)
@@ -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__
index d828fae..ab66859 100644 (file)
@@ -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";
index b531581..3bff830 100644 (file)
@@ -697,9 +697,6 @@ string comm::ClientSocket::asString() const
 throw() {
    string msg("comm::ClientSocket { ");
 
-   if (this == NULL)
-      return msg += " <freed> }";
-
    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);
index 9a7db2b..9f770f3 100644 (file)
@@ -239,9 +239,6 @@ std::string Socket::asString() const
 throw() {
   std::string msg("comm::Socket { Domain: ");
 
-  if(this == NULL)
-    return msg += " <null> }";
-
   switch(a_domain) {
   case Domain::Unix: msg += "Unix"; break;
   case Domain::Inet: msg += "Inet"; break;
index 3e13027..38700a2 100644 (file)
@@ -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;
index 217fd0a..8752a2e 100644 (file)
@@ -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
   );
index 79a23ce..622e58c 100644 (file)
@@ -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;