From: Eduardo Ramos Testillano Date: Sun, 25 Jun 2017 16:19:51 +0000 (+0200) Subject: Remove warnings X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=7ee10b64f4c116460ffef5784eb9ef87d3f2339c;p=anna.git Remove warnings --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 968a7c5..b2f7460 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") if(CMAKE_CXX_COMPILER_ID MATCHES GNU) #execute_process(COMMAND g++ --version >/dev/null 2>/dev/null) set(CMAKE_CXX_COMPILER "/usr/bin/g++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-unknown-pragmas -Wno-sign-compare -Woverloaded-virtual -Wwrite-strings -Wno-unused") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wwrite-strings -Wno-unknown-pragmas -Wno-sign-compare -Wno-maybe-uninitialized -Wno-unused -Wno-reorder") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3") @@ -77,7 +77,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang) #execute_process(COMMAND clang++ --version >/dev/null 2>/dev/null) add_definitions(-DIS_CLANG) set(CMAKE_CXX_COMPILER "/usr/bin/clang++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-unknown-pragmas -Wno-sign-compare -Woverloaded-virtual -Wwrite-strings -Wno-unused -Wno-parentheses-equality") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wwrite-strings -Wno-unknown-pragmas -Wno-sign-compare -Wno-maybe-uninitialized -Wno-unused -Wno-reorder -Wno-parentheses-equality") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/dynamic/launcher/gx/00001/Procedure.cpp b/dynamic/launcher/gx/00001/Procedure.cpp index b74f362..086a074 100644 --- a/dynamic/launcher/gx/00001/Procedure.cpp +++ b/dynamic/launcher/gx/00001/Procedure.cpp @@ -92,7 +92,7 @@ void Procedure::execute(const std::string &args, std::string &response, anna::di // Load xml messages: anna::diameter::codec::Message ccri, ccrt; anna::diameter::codec::Avp *ccri_sessionId, *ccrt_sessionId, *ccri_framedIPAddress, *ccrt_framedIPAddress, *ccri_msisdn, *ccri_imsi; - anna::diameter::codec::Avp *si1, *si2, *sidata1, *sidata2, *sitype1, *sitype2; + anna::diameter::codec::Avp *si1, *si2, *sidata1, *sidata2, *sitype1; ///////// CCR-Initial: ccri.loadXML(ccr_i); diff --git a/example/comm/client/main.cpp b/example/comm/client/main.cpp index 81e240d..d201821 100644 --- a/example/comm/client/main.cpp +++ b/example/comm/client/main.cpp @@ -66,6 +66,10 @@ private: void eventReceiveMessage (ClientSocket &, const Message&) throw (RuntimeException); +protected: + + using Communicator::eventBreakConnection; + void eventBreakConnection (const ClientSocket&) throw (); void eventBreakConnection (Server* server) throw () { diff --git a/example/comm/datagramKClient/main.cpp b/example/comm/datagramKClient/main.cpp index e8fe252..82688b4 100644 --- a/example/comm/datagramKClient/main.cpp +++ b/example/comm/datagramKClient/main.cpp @@ -96,8 +96,6 @@ void KClient::initialize () { CommandLine& cl (CommandLine::instantiate ()); - Network& network = Network::instantiate (); - /* Define el Socket para enviar las respuestas */ const comm::Device* device = Network::instantiate ().find (Device::asAddress (cl.getValue ("as"))); int port = cl.getIntegerValue ("ps"); diff --git a/example/comm/datagramRServer/main.cpp b/example/comm/datagramRServer/main.cpp index e348d5d..255b63e 100644 --- a/example/comm/datagramRServer/main.cpp +++ b/example/comm/datagramRServer/main.cpp @@ -43,6 +43,7 @@ public: class MyReceiver : public Receiver { public: + virtual ~MyReceiver() {;} static const char* className () throw () { return "MyReceiver"; } private: diff --git a/example/comm/kxClient/main.cpp b/example/comm/kxClient/main.cpp index 018d56a..87bf3c6 100644 --- a/example/comm/kxClient/main.cpp +++ b/example/comm/kxClient/main.cpp @@ -42,6 +42,8 @@ public: }; private: + using comm::Communicator::eventBreakConnection; + test::Response a_response; test::Request a_request; comm::INetAddress a_inetAddress; diff --git a/example/comm/rServer/main.cpp b/example/comm/rServer/main.cpp index be0d4ff..d09404f 100644 --- a/example/comm/rServer/main.cpp +++ b/example/comm/rServer/main.cpp @@ -43,6 +43,7 @@ public: class MyReceiver : public Receiver { public: + virtual ~MyReceiver() {;} static const char* className () throw () { return "MyReceiver"; } private: diff --git a/example/comm/rrClient/main.cpp b/example/comm/rrClient/main.cpp index 5e47a25..252167f 100644 --- a/example/comm/rrClient/main.cpp +++ b/example/comm/rrClient/main.cpp @@ -58,6 +58,8 @@ public: MyCommunicator () : Communicator (), a_avgResponseTime (0), a_rxMessageCounter (0), a_responses ("Response") {;} private: + using Communicator::eventBreakConnection; + ThreadData a_responses; int a_avgResponseTime; int a_rxMessageCounter; diff --git a/example/core/thread/main.cpp b/example/core/thread/main.cpp index 145923b..2f454d4 100644 --- a/example/core/thread/main.cpp +++ b/example/core/thread/main.cpp @@ -254,7 +254,7 @@ void Waiter::notifyResponse (const int result) a_result = result; - write (a_pipe [WriteChannel], &byte, sizeof (byte)); + ssize_t r = write (a_pipe [WriteChannel], &byte, sizeof (byte)); } // Modela al thread que recibe la respuesta correspondiente a la petición por la diff --git a/example/dbms.mysql/xSelect/main.cpp b/example/dbms.mysql/xSelect/main.cpp index 7a84027..6f7fdcc 100644 --- a/example/dbms.mysql/xSelect/main.cpp +++ b/example/dbms.mysql/xSelect/main.cpp @@ -84,7 +84,6 @@ void Select::run () CommandLine& cl (CommandLine::instantiate ()); - Statement* create; Statement* select; dbms::Integer n (true); diff --git a/example/dbos/workdir/main.cpp b/example/dbos/workdir/main.cpp index 9c35ba5..3b9c99f 100644 --- a/example/dbos/workdir/main.cpp +++ b/example/dbos/workdir/main.cpp @@ -344,8 +344,8 @@ void WorkDirectory::load (filesystem::Directory* parent, const int maxLevel, con } } else { - // Se asociado al parent automáticamente. - filesystem::File* ff = new filesystem::File (parent, name); + //Auto association to the parent: + new filesystem::File (parent, name); } } } diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 30ae63f..871fcb3 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -614,7 +614,7 @@ void Launcher::run() throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tm("Launcher", "run", ANNA_FILE_LOCATION)); CommandLine& cl(anna::CommandLine::instantiate()); - anna::diameter::stack::Engine &stackEngine = anna::diameter::stack::Engine::instantiate(); + anna::diameter::stack::Engine::instantiate(); // Start time: a_start_time.setNow(); diff --git a/example/diameter/launcher/MyCommunicator.hpp b/example/diameter/launcher/MyCommunicator.hpp index 4b2677c..f573069 100644 --- a/example/diameter/launcher/MyCommunicator.hpp +++ b/example/diameter/launcher/MyCommunicator.hpp @@ -28,6 +28,8 @@ public: void terminate() throw(); private: + using anna::comm::Communicator::eventBreakConnection; + anna::ThreadData a_contexts; void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException); void eventBreakConnection(Server* server) throw(); diff --git a/example/diameter/launcher/MyDiameterEntity.cpp b/example/diameter/launcher/MyDiameterEntity.cpp index 6027bf0..35ff50f 100644 --- a/example/diameter/launcher/MyDiameterEntity.cpp +++ b/example/diameter/launcher/MyDiameterEntity.cpp @@ -147,8 +147,6 @@ throw(anna::RuntimeException) { anna::diameter::comm::Message* request = const_cast(response.getRequest()); const anna::DataBlock* message = response.getMessage(); const anna::diameter::comm::ClientSession *clientSession = static_cast(response.getSession()); - bool isBindResponse = (code == anna::diameter::comm::ClassCode::Bind); - bool isApplicationMessage = (code == anna::diameter::comm::ClassCode::ApplicationMessage); bool contextExpired = (result == anna::diameter::comm::Response::ResultCode::Timeout); bool isUnavailable = (result == anna::diameter::comm::Response::ResultCode::DiameterUnavailable); bool isOK = (result == anna::diameter::comm::Response::ResultCode::Success); diff --git a/example/diameter/launcher/MyDiameterEntity.hpp b/example/diameter/launcher/MyDiameterEntity.hpp index a63bf28..c238a76 100644 --- a/example/diameter/launcher/MyDiameterEntity.hpp +++ b/example/diameter/launcher/MyDiameterEntity.hpp @@ -33,6 +33,7 @@ class MyDiameterEntity : public anna::diameter::comm::Entity { public: MyDiameterEntity() {;} + virtual ~MyDiameterEntity() {;} anna::diameter::codec::MessagesDeque a_reactingAnswers; anna::diameter::codec::MessagesDeque *getReactingAnswers() throw() { return (anna::diameter::codec::MessagesDeque*)&a_reactingAnswers; } diff --git a/example/diameter/launcher/MyLocalServer.cpp b/example/diameter/launcher/MyLocalServer.cpp index c4f5db7..383db73 100644 --- a/example/diameter/launcher/MyLocalServer.cpp +++ b/example/diameter/launcher/MyLocalServer.cpp @@ -149,8 +149,6 @@ throw(anna::RuntimeException) { anna::diameter::comm::Message* request = const_cast(response.getRequest()); const anna::DataBlock* message = response.getMessage(); const anna::diameter::comm::ServerSession *serverSession = static_cast(response.getSession()); - bool isBindResponse = (code == anna::diameter::comm::ClassCode::Bind); - bool isApplicationMessage = (code == anna::diameter::comm::ClassCode::ApplicationMessage); bool contextExpired = (result == anna::diameter::comm::Response::ResultCode::Timeout); bool isUnavailable = (result == anna::diameter::comm::Response::ResultCode::DiameterUnavailable); bool isOK = (result == anna::diameter::comm::Response::ResultCode::Success); diff --git a/example/diameter/launcher/MyLocalServer.hpp b/example/diameter/launcher/MyLocalServer.hpp index 7f66703..4613173 100644 --- a/example/diameter/launcher/MyLocalServer.hpp +++ b/example/diameter/launcher/MyLocalServer.hpp @@ -30,6 +30,7 @@ class MyLocalServer : public anna::diameter::comm::LocalServer { void eventDPA(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); public: + virtual ~MyLocalServer() {;} anna::diameter::codec::MessagesDeque a_reactingAnswers; anna::diameter::codec::MessagesDeque *getReactingAnswers() throw() { return (anna::diameter::codec::MessagesDeque*)&a_reactingAnswers; } diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index 377b317..cdada35 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -179,12 +179,10 @@ struct sniff_tcp { u_char *getPayload(const u_char* packet, int packetSize, int &payloadSize, std::string &srcIp, std::string &dstIp, int &fragmentId, bool &dfFlag, bool &mfFlag, int &fragmentOffset) { - const struct sniff_ethernet *ethernet; /* The ethernet header */ const struct sniff_ip *ip; /* The IP header */ const struct sniff_tcp *tcp; /* The TCP header */ u_int size_ip; u_int size_tcp; - ethernet = (struct sniff_ethernet*)(packet); ip = (struct sniff_ip*)(packet + SIZE_ETHERNET); size_ip = IP_HL(ip) * 4; // 4 bytes per 32 bits word @@ -306,7 +304,7 @@ int main(int argc, char **argv) { // Command-line parameters: std::string inputFile = argv[1]; - bool isHex = (inputFile.substr(inputFile.find_last_of(".") + 1) == "hex"); + //bool isHex = (inputFile.substr(inputFile.find_last_of(".") + 1) == "hex"); std::string outputFile = inputFile; // extension will be added later std::string optionals; int indx = 2; @@ -321,8 +319,8 @@ int main(int argc, char **argv) { // SNIFFING //////////////////////////////////////////////////////////////////////////////////////////////7 //temporary packet buffers - struct pcap_pkthdr header; // The header that pcap gives us - const u_char *packet; // The actual packet + //struct pcap_pkthdr header; // The header that pcap gives us + //const u_char *packet; // The actual packet //------------------ //open the pcap file pcap_t *handle; diff --git a/example/http/client/main.cpp b/example/http/client/main.cpp index 1ddd525..085a692 100644 --- a/example/http/client/main.cpp +++ b/example/http/client/main.cpp @@ -83,6 +83,8 @@ public: void count (const int delay) throw (RuntimeException); private: + using Communicator::eventBreakConnection; + int a_avgResponseTime; int a_rxMessageCounter; MyHandler a_httpHandler; diff --git a/example/http/echo/main.cpp b/example/http/echo/main.cpp index 165e0e4..06f6ee5 100644 --- a/example/http/echo/main.cpp +++ b/example/http/echo/main.cpp @@ -135,8 +135,6 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess static int messageCounter = 0; static int successCounter = 0; - int value; - CongestionController& congestionController = CongestionController::instantiate (); messageCounter ++; diff --git a/example/http/xmlSender/main.cpp b/example/http/xmlSender/main.cpp index f32a8ad..abcd844 100644 --- a/example/http/xmlSender/main.cpp +++ b/example/http/xmlSender/main.cpp @@ -51,6 +51,8 @@ public: } private: + using Communicator::eventBreakConnection; + MyHandler a_httpHandler; http::Request a_httpRequest; diff --git a/example/timex/ArithmeticHTTPServer/Reactor.hpp b/example/timex/ArithmeticHTTPServer/Reactor.hpp index c913091..949db90 100644 --- a/example/timex/ArithmeticHTTPServer/Reactor.hpp +++ b/example/timex/ArithmeticHTTPServer/Reactor.hpp @@ -25,6 +25,7 @@ using namespace anna; class Reactor : public comm::Receiver { public: Reactor () : comm::Receiver ("http4comm::Reactor") {;} + virtual ~Reactor() {;} static const char* className () throw () { return "http4comm::Reactor"; } diff --git a/example/xml/xmlBinary/main.cpp b/example/xml/xmlBinary/main.cpp index 8b31776..967f8da 100644 --- a/example/xml/xmlBinary/main.cpp +++ b/example/xml/xmlBinary/main.cpp @@ -62,7 +62,6 @@ void Test::run () CommandLine& commandLine (CommandLine::instantiate ()); xml::DocumentFile xmlDoc; - const char* str; xmlDoc.initialize (commandLine.getValue ("xml")); diff --git a/example/xml/xpath/main.cpp b/example/xml/xpath/main.cpp index df7e093..f355883 100644 --- a/example/xml/xpath/main.cpp +++ b/example/xml/xpath/main.cpp @@ -92,7 +92,6 @@ void Test::run () cout << "Time (apply" << i << "): " << final - init << " us" << endl << endl; if (xpath.isEmpty () == false) { if (i == 0) { - const xml::Node* node; for (Node::const_child_iterator ii = xpath.node_begin (), maxii = xpath.node_end (); ii != maxii; ii ++) cout << xmlCompiler.apply (XPath::node (ii)) << endl; } @@ -110,7 +109,6 @@ void Test::run () cout << "match: no node matching expression" << endl << endl; xpath.apply (xmlDoc, expression, mode); - const xml::Node* node; for (Node::const_child_iterator ii = xpath.node_begin (), maxii = xpath.node_end (); ii != maxii; ii ++) cout << xmlCompiler.apply (XPath::node (ii), xml::Compiler::Mode::Compact | xml::Compiler::Mode::NoNamespaces) << endl; } diff --git a/include/anna/app/Application.hpp b/include/anna/app/Application.hpp index 8642937..e4754cf 100644 --- a/include/anna/app/Application.hpp +++ b/include/anna/app/Application.hpp @@ -274,12 +274,12 @@ protected: static pid_t pid(const_pid_iterator& ii) throw() { return *ii; } private: - bool a_running; - std::string a_version; const std::string a_title; std::vector a_components; pid_t a_pid; const char* a_shortName; + bool a_running; + std::string a_version; bool a_enableGPL; pid_container a_pids; diff --git a/include/anna/comm/AccessPoint.hpp b/include/anna/comm/AccessPoint.hpp index f28409f..158b5e5 100644 --- a/include/anna/comm/AccessPoint.hpp +++ b/include/anna/comm/AccessPoint.hpp @@ -63,8 +63,8 @@ public: private: const Socket* a_owner; - INetAddress a_inetAddress; std::string* a_path; + INetAddress a_inetAddress; sockaddr_in a_sockaddr_in; sockaddr_un a_sockaddr_un; }; diff --git a/include/anna/comm/Delivery.hpp b/include/anna/comm/Delivery.hpp index 54c2670..01d597b 100644 --- a/include/anna/comm/Delivery.hpp +++ b/include/anna/comm/Delivery.hpp @@ -230,8 +230,8 @@ private: std::string a_name; Resources a_resources; bool a_isAvailable; - Millisecond a_timeStamp; Millisecond a_recoveryTime; + Millisecond a_timeStamp; bool unsafe_recover(const Resource* resource) throw(); diff --git a/include/anna/comm/DirectTransport.hpp b/include/anna/comm/DirectTransport.hpp index a4c160e..8a55d9c 100644 --- a/include/anna/comm/DirectTransport.hpp +++ b/include/anna/comm/DirectTransport.hpp @@ -42,7 +42,7 @@ public: /** Destructor */ - ~DirectTransport(); + virtual ~DirectTransport(); /** Devuelve el gestor de capas de transporte asociado a esta clase. diff --git a/include/anna/comm/LiteTransport.hpp b/include/anna/comm/LiteTransport.hpp index f41dcfb..feb7566 100644 --- a/include/anna/comm/LiteTransport.hpp +++ b/include/anna/comm/LiteTransport.hpp @@ -33,7 +33,7 @@ public: /** Destructor. */ - ~LiteTransport(); + virtual ~LiteTransport(); /** Returns the class name literal. diff --git a/include/anna/comm/Server.hpp b/include/anna/comm/Server.hpp index c6ca9cc..7d370b5 100644 --- a/include/anna/comm/Server.hpp +++ b/include/anna/comm/Server.hpp @@ -289,8 +289,8 @@ private: const int a_remotePort; const bool a_autoRecovery; Services a_services; - ClientSocket* a_clientSocket; TransportFactory* a_transportFactory; + ClientSocket* a_clientSocket; Millisecond a_msMaxConnectionDelay; Millisecond a_msMaxWriteDelay; ReceiverFactory* a_receiverFactory; diff --git a/include/anna/comm/Socket.hpp b/include/anna/comm/Socket.hpp index cd3c461..a81eb8a 100644 --- a/include/anna/comm/Socket.hpp +++ b/include/anna/comm/Socket.hpp @@ -278,7 +278,6 @@ private: #define anna_comm_socket_check(a,b) \ if ((a) < 0) { \ - const int xerrno = errno; \ std::string msg (asString ()); \ msg += " | "; \ msg += b; \ diff --git a/include/anna/comm/SureTransport.hpp b/include/anna/comm/SureTransport.hpp index db60466..9d6b1ad 100644 --- a/include/anna/comm/SureTransport.hpp +++ b/include/anna/comm/SureTransport.hpp @@ -31,7 +31,7 @@ public: /** Destructor. */ - ~SureTransport(); + virtual ~SureTransport(); /** Class name literal diff --git a/include/anna/comm/Transport.hpp b/include/anna/comm/Transport.hpp index 0cd74a6..6b6b24c 100644 --- a/include/anna/comm/Transport.hpp +++ b/include/anna/comm/Transport.hpp @@ -42,6 +42,14 @@ class Message; sincronizarse nunca mas. */ class Transport { + + static const int MinOverQuotaSize = 512; + + int a_overQuotaSize; + Message* a_inputMessage; + + static Message* nullInputMessage() throw(RuntimeException); + public: /** Maximum number of bytes kept by each ClientSocket without identifying @@ -171,13 +179,8 @@ protected: void setInputMessage(Message* inputMessage) throw() { a_inputMessage = inputMessage; } private: - static const int MinOverQuotaSize = 512; - int a_overQuotaSize; - Message* a_inputMessage; bool a_enableTimeout; - - static Message* nullInputMessage() throw(RuntimeException); }; } diff --git a/include/anna/comm/internal/Poll.hpp b/include/anna/comm/internal/Poll.hpp index 7826f1e..437c089 100644 --- a/include/anna/comm/internal/Poll.hpp +++ b/include/anna/comm/internal/Poll.hpp @@ -30,7 +30,7 @@ namespace comm { */ class Poll { public: - Poll() : a_maxfd(0), a_ptrTimeout(NULL), a_minfd(INT_MAX) { + Poll() : a_ptrTimeout(NULL), a_minfd(INT_MAX), a_maxfd(0) { FD_ZERO(&a_fdmask); FD_ZERO(&a_fdset); } @@ -47,12 +47,12 @@ public: private: fd_set a_fdmask; fd_set a_fdset; + timeval* a_ptrTimeout; int a_minfd; int a_maxfd; int a_pollr; int a_ifd; timeval a_timeout; - timeval* a_ptrTimeout; static int select(const int maxfd, fd_set* fdset, timeval* timeout) throw(RuntimeException) { diff --git a/include/anna/core/mt/Semaphore.hpp b/include/anna/core/mt/Semaphore.hpp index fbe9a11..acf21d2 100644 --- a/include/anna/core/mt/Semaphore.hpp +++ b/include/anna/core/mt/Semaphore.hpp @@ -45,7 +45,7 @@ public: /** Destructor. */ - ~Semaphore(); + virtual ~Semaphore(); /** Notifica que desea acceder al recurso. Si se ha alcanzado la cuenta maxima de accesos diff --git a/include/anna/core/oam/Module.hpp b/include/anna/core/oam/Module.hpp index d3c3542..533eaad 100644 --- a/include/anna/core/oam/Module.hpp +++ b/include/anna/core/oam/Module.hpp @@ -136,16 +136,11 @@ class Module { Handler a_defaultHandler; // default OAM handler Handler *a_handler; // Handler reference - std::string a_name; // module description + bool a_counters_enabled; // Enable/Disable registered counters over this module (default is 'false') bool a_alarms_enabled; // Enable/Disable registered alarms over this module (default is 'false') - // dynamic modifications over alarm text - bool a_alarms_preffix_enabled; // Show own module alarm preffix - bool a_alarms_suffix_enabled; // Show own module alarm suffix - std::string alarmComponentsToText(const std::vector & components, const std::string & psL, const std::string & psS, const std::string & psR) const throw(); - // GENERIC COUNTERS anna::oam::CounterScope* a_active_counter_scope; // Current scope for counters generation typedef std::map scope_container; @@ -156,9 +151,13 @@ class Module { // GENERIC ALARMS typedef std::map < int /*type*/, alarm_data_t > alarm_container; alarm_container a_alarms; - void alarmEvent(bool activation, const int & type, va_list argList) const throw(); + // dynamic modifications over alarm text + bool a_alarms_preffix_enabled; // Show own module alarm preffix + bool a_alarms_suffix_enabled; // Show own module alarm suffix + std::string alarmComponentsToText(const std::vector & components, const std::string & psL, const std::string & psS, const std::string & psR) const throw(); + // Counters typedef scope_container::iterator scope_iterator; typedef scope_container::const_iterator const_scope_iterator; @@ -210,14 +209,15 @@ public: /** Constructor @param name Logical name for the class (better use fullNaming format including namespace resolution) */ - Module(const std::string &name) : a_name(name), + Module(const std::string &name) : a_handler(&a_defaultHandler), + a_name(name), a_counters_enabled(false), - a_counterRecorder(NULL), - a_counterRecording(false), a_alarms_enabled(false), a_alarms_preffix_enabled(true), - a_alarms_suffix_enabled(true) {;} + a_alarms_suffix_enabled(true), + a_counterRecorder(NULL), + a_counterRecording(false) {;} /** * Destructor diff --git a/include/anna/core/util/CommandLine.hpp b/include/anna/core/util/CommandLine.hpp index 35fbb34..6cd4c78 100644 --- a/include/anna/core/util/CommandLine.hpp +++ b/include/anna/core/util/CommandLine.hpp @@ -193,11 +193,11 @@ private: protected: std::string a_name1, a_name2; - const char* a_comment; - char* a_value; Argument::Type a_type; + const char* a_comment; bool a_needValue; bool a_isOn; + char* a_value; }; const char **a_argv; diff --git a/include/anna/core/util/ComponentManager.hpp b/include/anna/core/util/ComponentManager.hpp index 2c77e3b..ea41911 100644 --- a/include/anna/core/util/ComponentManager.hpp +++ b/include/anna/core/util/ComponentManager.hpp @@ -52,6 +52,9 @@ private: // private constructor ComponentManager() {}; + // private destructor + virtual ~ComponentManager() {}; + void attach(Component*) throw(RuntimeException); void detach(Component*) throw(RuntimeException); diff --git a/include/anna/core/util/Variable.hpp b/include/anna/core/util/Variable.hpp index 52e7f34..3db7df1 100644 --- a/include/anna/core/util/Variable.hpp +++ b/include/anna/core/util/Variable.hpp @@ -458,6 +458,10 @@ protected: private: std::string a_name; + bool a_isNull; + const Type::_v a_type; + const bool a_isOwner; + union { std::string* a_string; int* a_integer; @@ -475,9 +479,6 @@ private: float theFloat; double theDouble; } a_aux; - const Type::_v a_type; - const bool a_isOwner; - bool a_isNull; Variable(const Variable&); Variable& operator = (const Variable&); diff --git a/include/anna/diameter.comm/ClientSessionReceiver.hpp b/include/anna/diameter.comm/ClientSessionReceiver.hpp index 25f451c..d7e6cf3 100644 --- a/include/anna/diameter.comm/ClientSessionReceiver.hpp +++ b/include/anna/diameter.comm/ClientSessionReceiver.hpp @@ -34,6 +34,8 @@ class ClientSession; class ClientSessionReceiver : public anna::comm::Receiver { public: + virtual ~ClientSessionReceiver() {;} + static const char* className() throw() { return "diameter.comm.ClientSessionReceiver"; } void setReference(ClientSession *s) throw() { a_session = s; } diff --git a/include/anna/diameter.comm/Server.hpp b/include/anna/diameter.comm/Server.hpp index 6735e5f..8d5dea9 100644 --- a/include/anna/diameter.comm/Server.hpp +++ b/include/anna/diameter.comm/Server.hpp @@ -101,6 +101,9 @@ public: */ Server(int maxClientSessions = 1) : a_maxClientSessions(maxClientSessions) { initialize(); } + /** Destructor */ + virtual ~Server() {;} + /** * Add a server to the entity and create all the client-sessions configured at #setSocketsPerDiameterServer within that server. diff --git a/include/anna/diameter.comm/ServerSessionReceiver.hpp b/include/anna/diameter.comm/ServerSessionReceiver.hpp index 73c4213..c3152c2 100644 --- a/include/anna/diameter.comm/ServerSessionReceiver.hpp +++ b/include/anna/diameter.comm/ServerSessionReceiver.hpp @@ -34,6 +34,8 @@ class ServerSession; class ServerSessionReceiver : public anna::comm::Receiver { public: + virtual ~ServerSessionReceiver() {;} + static const char* className() throw() { return "diameter.comm.ServerSessionReceiver"; } void setReference(ServerSession *s) throw() { a_session = s; } diff --git a/include/anna/diameter.comm/TimerManager.hpp b/include/anna/diameter.comm/TimerManager.hpp index 00b9020..c81af05 100644 --- a/include/anna/diameter.comm/TimerManager.hpp +++ b/include/anna/diameter.comm/TimerManager.hpp @@ -50,6 +50,7 @@ class TimerManager : public anna::timex::TimeEventObserver, public anna::Singlet TimerManager(); TimerManager(const TimerManager&); + virtual ~TimerManager() {;} Timer* createTimer(Response*) throw(anna::RuntimeException); Timer* createTimer(Session*, const anna::diameter::comm::Timer::Type::_v type) throw(anna::RuntimeException); diff --git a/include/anna/diameter.comm/Transport.hpp b/include/anna/diameter.comm/Transport.hpp index bca63a2..8f6e38e 100644 --- a/include/anna/diameter.comm/Transport.hpp +++ b/include/anna/diameter.comm/Transport.hpp @@ -47,7 +47,7 @@ public: /** Destructor */ - ~Transport(); + virtual ~Transport(); /** Devuelve el gestor de capas de transporte asociado a esta clase. diff --git a/include/anna/diameter/codec/Avp.hpp b/include/anna/diameter/codec/Avp.hpp index 0057ac8..c4debd2 100644 --- a/include/anna/diameter/codec/Avp.hpp +++ b/include/anna/diameter/codec/Avp.hpp @@ -425,7 +425,7 @@ public: /** * Destructor */ - ~Avp(); + virtual ~Avp(); // setters diff --git a/include/anna/diameter/codec/EngineManager.hpp b/include/anna/diameter/codec/EngineManager.hpp index 69e063e..e498e69 100644 --- a/include/anna/diameter/codec/EngineManager.hpp +++ b/include/anna/diameter/codec/EngineManager.hpp @@ -55,6 +55,8 @@ private: public: + virtual ~EngineManager() {;} + /** * First element iterator */ diff --git a/include/anna/diameter/codec/Message.hpp b/include/anna/diameter/codec/Message.hpp index 376fa39..dd0b13a 100644 --- a/include/anna/diameter/codec/Message.hpp +++ b/include/anna/diameter/codec/Message.hpp @@ -223,7 +223,8 @@ public: /** * Destructor */ - ~Message(); + virtual ~Message(); + // Virtual destructors are useful when you can delete an instance of a derived class through a pointer to base class: // This destructor is not virtual, then a pointer to base class (even pointing to a children one) will invoke this destructor, not the derived one. // My current solution: virtualizing method 'clear' diff --git a/include/anna/diameter/codec/basetypes/Address.hpp b/include/anna/diameter/codec/basetypes/Address.hpp index 583ac7c..c20c556 100644 --- a/include/anna/diameter/codec/basetypes/Address.hpp +++ b/include/anna/diameter/codec/basetypes/Address.hpp @@ -83,6 +83,11 @@ public: */ Address() : a_abbreviatePresentation(true) {}; + /** + * Destructor + */ + virtual ~Address() {;} + /** * Presentation mode: abbreviate (i.e. two standard rules applied for IPv6) or expanded (i.e. groups of zeroes on IP address) * diff --git a/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp b/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp index 6d9857e..2e99075 100644 --- a/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp +++ b/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp @@ -36,6 +36,8 @@ class DiameterIdentity : public OctetString { public: + virtual ~DiameterIdentity() {;} + // gets std::string getFormatName() const throw() { return "DiameterIdentity"; } diff --git a/include/anna/diameter/codec/basetypes/DiameterURI.hpp b/include/anna/diameter/codec/basetypes/DiameterURI.hpp index 4b1b214..d13f86a 100644 --- a/include/anna/diameter/codec/basetypes/DiameterURI.hpp +++ b/include/anna/diameter/codec/basetypes/DiameterURI.hpp @@ -36,6 +36,8 @@ class DiameterURI : public OctetString { public: + virtual ~DiameterURI() {;} + // gets std::string getFormatName() const throw() { return "DiameterURI"; } diff --git a/include/anna/diameter/codec/basetypes/Enumerated.hpp b/include/anna/diameter/codec/basetypes/Enumerated.hpp index 4a53d0f..e00438c 100644 --- a/include/anna/diameter/codec/basetypes/Enumerated.hpp +++ b/include/anna/diameter/codec/basetypes/Enumerated.hpp @@ -33,6 +33,8 @@ class Enumerated : public Integer32 { public: + virtual ~Enumerated() {;} + // gets std::string getFormatName() const throw() { return "Enumerated"; } diff --git a/include/anna/diameter/codec/basetypes/Float32.hpp b/include/anna/diameter/codec/basetypes/Float32.hpp index 340c5d9..923e29e 100644 --- a/include/anna/diameter/codec/basetypes/Float32.hpp +++ b/include/anna/diameter/codec/basetypes/Float32.hpp @@ -41,6 +41,7 @@ class Float32 : public AvpData { public: + virtual ~Float32() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/Float64.hpp b/include/anna/diameter/codec/basetypes/Float64.hpp index b851058..b7a70be 100644 --- a/include/anna/diameter/codec/basetypes/Float64.hpp +++ b/include/anna/diameter/codec/basetypes/Float64.hpp @@ -41,6 +41,7 @@ class Float64 : public AvpData { public: + virtual ~Float64() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/IPFilterRule.hpp b/include/anna/diameter/codec/basetypes/IPFilterRule.hpp index c982f83..c6afcf6 100644 --- a/include/anna/diameter/codec/basetypes/IPFilterRule.hpp +++ b/include/anna/diameter/codec/basetypes/IPFilterRule.hpp @@ -36,6 +36,8 @@ class IPFilterRule : public OctetString { public: + virtual ~IPFilterRule() {;} + // gets std::string getFormatName() const throw() { return "IPFilterRule"; } diff --git a/include/anna/diameter/codec/basetypes/Integer32.hpp b/include/anna/diameter/codec/basetypes/Integer32.hpp index afdc962..cf7cd38 100644 --- a/include/anna/diameter/codec/basetypes/Integer32.hpp +++ b/include/anna/diameter/codec/basetypes/Integer32.hpp @@ -40,6 +40,7 @@ class Integer32 : public AvpData { public: + virtual ~Integer32() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/Integer64.hpp b/include/anna/diameter/codec/basetypes/Integer64.hpp index 14f982f..8f7c1fa 100644 --- a/include/anna/diameter/codec/basetypes/Integer64.hpp +++ b/include/anna/diameter/codec/basetypes/Integer64.hpp @@ -40,6 +40,7 @@ class Integer64 : public AvpData { public: + virtual ~Integer64() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/OctetString.hpp b/include/anna/diameter/codec/basetypes/OctetString.hpp index 1b36321..cd765e5 100644 --- a/include/anna/diameter/codec/basetypes/OctetString.hpp +++ b/include/anna/diameter/codec/basetypes/OctetString.hpp @@ -42,6 +42,7 @@ protected: public: + virtual ~OctetString() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp b/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp index 07c79e3..c3a81ff 100644 --- a/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp +++ b/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp @@ -36,6 +36,8 @@ class QoSFilterRule : public OctetString { public: + virtual ~QoSFilterRule() {;} + // gets std::string getFormatName() const throw() { return "QoSFilterRule"; } diff --git a/include/anna/diameter/codec/basetypes/Time.hpp b/include/anna/diameter/codec/basetypes/Time.hpp index 157d335..4bc13ba 100644 --- a/include/anna/diameter/codec/basetypes/Time.hpp +++ b/include/anna/diameter/codec/basetypes/Time.hpp @@ -42,6 +42,7 @@ class Time : OctetString { public: + virtual ~Time() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/UTF8String.hpp b/include/anna/diameter/codec/basetypes/UTF8String.hpp index b7aa720..74a7b6a 100644 --- a/include/anna/diameter/codec/basetypes/UTF8String.hpp +++ b/include/anna/diameter/codec/basetypes/UTF8String.hpp @@ -36,6 +36,8 @@ class UTF8String : public OctetString { public: + virtual ~UTF8String() {;} + // gets std::string getFormatName() const throw() { return "UTF8String"; } diff --git a/include/anna/diameter/codec/basetypes/Unknown.hpp b/include/anna/diameter/codec/basetypes/Unknown.hpp index 5a84005..c571f53 100644 --- a/include/anna/diameter/codec/basetypes/Unknown.hpp +++ b/include/anna/diameter/codec/basetypes/Unknown.hpp @@ -30,6 +30,9 @@ namespace basetypes { class Unknown : public OctetString { public: + + virtual ~Unknown() {;} + std::string getFormatName() const throw() { return "Unknown"; } }; diff --git a/include/anna/diameter/codec/basetypes/Unsigned32.hpp b/include/anna/diameter/codec/basetypes/Unsigned32.hpp index 3aaa56f..e2eb417 100644 --- a/include/anna/diameter/codec/basetypes/Unsigned32.hpp +++ b/include/anna/diameter/codec/basetypes/Unsigned32.hpp @@ -40,6 +40,7 @@ class Unsigned32 : public AvpData { public: + virtual ~Unsigned32() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/basetypes/Unsigned64.hpp b/include/anna/diameter/codec/basetypes/Unsigned64.hpp index 6320726..02b050a 100644 --- a/include/anna/diameter/codec/basetypes/Unsigned64.hpp +++ b/include/anna/diameter/codec/basetypes/Unsigned64.hpp @@ -40,6 +40,7 @@ class Unsigned64 : public AvpData { public: + virtual ~Unsigned64() {;} // Class-specific //////////////////////////////////////////////////////////////////////////////////// // diff --git a/include/anna/diameter/codec/functions.hpp b/include/anna/diameter/codec/functions.hpp index 563b501..acafa64 100644 --- a/include/anna/diameter/codec/functions.hpp +++ b/include/anna/diameter/codec/functions.hpp @@ -114,8 +114,6 @@ static const char *MessageDTD = "\ "; - - // Used for alarms, tracing and Failed-AVP construction: typedef struct parent { diff --git a/include/anna/http/Transport.hpp b/include/anna/http/Transport.hpp index 673d3a1..2143f6e 100644 --- a/include/anna/http/Transport.hpp +++ b/include/anna/http/Transport.hpp @@ -41,6 +41,11 @@ public: */ Transport(); + /** + * Destructor. + */ + virtual ~Transport() {;} + /** Devuelve la longitud del cuerpo del mensaje asociado. \return la longitud del cuerpo del mensaje asociado. diff --git a/include/anna/ldap/TimerManager.hpp b/include/anna/ldap/TimerManager.hpp index 2301b00..069c468 100644 --- a/include/anna/ldap/TimerManager.hpp +++ b/include/anna/ldap/TimerManager.hpp @@ -42,6 +42,8 @@ class TimerManager : public timex::TimeEventObserver, public Singleton ; diff --git a/source/comm/ClientSocket.cpp b/source/comm/ClientSocket.cpp index acf2bd3..b531581 100644 --- a/source/comm/ClientSocket.cpp +++ b/source/comm/ClientSocket.cpp @@ -297,7 +297,6 @@ throw() { comm::Socket::Notify::_v comm::ClientSocket::receive() throw(RuntimeException) { Notify::_v result; - int queueLength = 0; if (a_reader.getMaxSize() == 0) { string msg(asString()); diff --git a/source/comm/Host.cpp b/source/comm/Host.cpp index 029082d..43ff561 100644 --- a/source/comm/Host.cpp +++ b/source/comm/Host.cpp @@ -59,7 +59,6 @@ throw(RuntimeException) { //------------------------------------------------------------------------------- comm::Server* comm::Host::createServer(const ServerAllocator& serverAllocator) throw(RuntimeException) { - const int remotePort = serverAllocator.getRemotePort(); Server* result = serverAllocator.apply(); result->setIgnoreIncomingMessages(serverAllocator.getIgnoreIncomingMessages()); return result; diff --git a/source/core/functions.cpp b/source/core/functions.cpp index 1dd3025..567fb71 100644 --- a/source/core/functions.cpp +++ b/source/core/functions.cpp @@ -231,7 +231,6 @@ throw(RuntimeException) { const char* src = hexString.data(); unsigned char hex; int aux; - int j = 0; for(int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) { if(isxdigit(aux = src [ii - 1]) == 0) @@ -703,7 +702,6 @@ std::string functions::getHostnameIP() throw() { std::string result = ""; struct hostent *he; struct in_addr **addr_list; - struct in_addr ipv4addr; char hostname[128]; gethostname(hostname, sizeof hostname); @@ -1472,17 +1470,17 @@ void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCa bool filler = isupNumber.OddEven; bool hasDigits = (isupNumber.Digits.size() > 0); byte = filler ? 0x80 : 0x00; - byte = byte |= isupNumber.NatureOfAddress; + byte |= isupNumber.NatureOfAddress; target += byte; if(calledOrCalling) { byte = isupNumber.InternalNetworkNumber << 7; - byte = byte |= (isupNumber.NumberingPlan << 4); + byte |= (isupNumber.NumberingPlan << 4); } else { byte = isupNumber.NumberIncomplete << 7; - byte = byte |= (isupNumber.NumberingPlan << 4); - byte = byte |= (isupNumber.AddressPresentationRestricted << 2); - byte = byte |= isupNumber.Screening; + byte |= (isupNumber.NumberingPlan << 4); + byte |= (isupNumber.AddressPresentationRestricted << 2); + byte |= isupNumber.Screening; } target += byte; diff --git a/source/core/oam/Module.cpp b/source/core/oam/Module.cpp index 4466ca5..b7baf28 100644 --- a/source/core/oam/Module.cpp +++ b/source/core/oam/Module.cpp @@ -509,7 +509,6 @@ void anna::oam::Module::recordCounters() throw(anna::RuntimeException) { RecordingGuard guard(this); a_counterRecorder->open(); - Counter* counter = NULL; CounterScope* cscope = NULL; try { diff --git a/source/core/tracing/TraceWriter.cpp b/source/core/tracing/TraceWriter.cpp index 239db1c..0fa28a1 100644 --- a/source/core/tracing/TraceWriter.cpp +++ b/source/core/tracing/TraceWriter.cpp @@ -75,12 +75,14 @@ throw() { void TraceWriter::setup(const char* fileName, const int maxSize, const bool clean) throw() { + ssize_t r; + if(a_stream != -1) { if(clean == false) { string msg("\nTraces go on at: "); msg += fileName; msg += '\n'; - write(a_stream, msg.c_str(), msg.length()); + r = write(a_stream, msg.c_str(), msg.length()); } if(a_observed == true) { @@ -104,7 +106,6 @@ throw() { if(maxSize >= (256 * 1024)) a_maxSize = maxSize; - const char* aux = Logger::asString(Logger::getLevel()); char date [anna::functions::DateTimeSizeString + 7]; anna_strcpy(date, "- ["); anna_strcat(anna_strcat(date, getDate()), "]\n"); @@ -113,15 +114,15 @@ throw() { if(stream != ErrorStream) { const char* aux = "\n--------------------------------------------------------------\n"; const char* aux2 = "- Current trace level: "; - write(stream, aux, anna_strlen(aux)); - write(stream, date, anna_strlen(date)); - write(stream, aux2, anna_strlen(aux2)); + r = write(stream, aux, anna_strlen(aux)); + r = write(stream, date, anna_strlen(date)); + r = write(stream, aux2, anna_strlen(aux2)); aux2 = Logger::asString(Logger::getLevel()); - write(stream, aux2, anna_strlen(aux2)); + r = write(stream, aux2, anna_strlen(aux2)); string filesize = functions::asString("\n- Max file size : %d Kb", a_maxSize >> 10); aux2 = filesize.c_str(); - write(stream, aux2, anna_strlen(aux2)); - write(stream, aux, anna_strlen(aux)); + r = write(stream, aux2, anna_strlen(aux2)); + r = write(stream, aux, anna_strlen(aux)); } } diff --git a/source/core/util/TextManager.cpp b/source/core/util/TextManager.cpp index 3f694fa..6762aeb 100644 --- a/source/core/util/TextManager.cpp +++ b/source/core/util/TextManager.cpp @@ -92,8 +92,6 @@ throw() { TextComposer* TextManager::xfind(const int composer) throw() { - TextComposer* result = NULL; - for(TextComposerVector::iterator ii = a_composers.begin(), maxii = a_composers.end(); ii != maxii; ii ++) if((*ii)->getId() == composer) { return (*ii); diff --git a/source/dbms.mysql/InputBind.cpp b/source/dbms.mysql/InputBind.cpp index 983612b..edfb2d3 100644 --- a/source/dbms.mysql/InputBind.cpp +++ b/source/dbms.mysql/InputBind.cpp @@ -72,6 +72,19 @@ throw(RuntimeException) { case Data::Type::TimeStamp: _this->codeDate(data); break; + case Data::Type::Integer: + throw RuntimeException("anna::dbms::mysql::InputBind::code not implemented for Data::Type::Integer", ANNA_FILE_LOCATION); + break; + case Data::Type::Float: + throw RuntimeException("anna::dbms::mysql::InputBind::code not implemented for Data::Type::Float", ANNA_FILE_LOCATION); + break; + case Data::Type::ShortBlock: + throw RuntimeException("anna::dbms::mysql::InputBind::code not implemented for Data::Type::ShortBlock", ANNA_FILE_LOCATION); + break; + case Data::Type::LongBlock: + throw RuntimeException("anna::dbms::mysql::InputBind::code not implemented for Data::Type::LongBlock", ANNA_FILE_LOCATION); + break; + } } diff --git a/source/dbms.mysql/OutputBind.cpp b/source/dbms.mysql/OutputBind.cpp index 4920921..016b9e9 100644 --- a/source/dbms.mysql/OutputBind.cpp +++ b/source/dbms.mysql/OutputBind.cpp @@ -87,6 +87,12 @@ throw(RuntimeException) { case Data::Type::TimeStamp: _this->decodeDate(data); break; + case Data::Type::Integer: + throw RuntimeException("anna::dbms::mysql::OutputBind::decode not implemented for Data::Type::Integer", ANNA_FILE_LOCATION); + break; + case Data::Type::ShortBlock: + throw RuntimeException("anna::dbms::mysql::OutputBind::decode not implemented for Data::Type::ShortBlock", ANNA_FILE_LOCATION); + break; case Data::Type::LongBlock: try { @@ -136,7 +142,6 @@ throw() { void OutputBind::decodeLongBlob(dbms::Data& data) const throw(RuntimeException, dbms::DatabaseException) { const int bufferSize = a_blob->buffer.getMaxSize(); - const int pos = a_blob->pos; st_mysql_bind& bind = a_blob->binds [a_blob->pos]; DataBlock& target = static_cast (data).getValue(); const int maxloop = *bind.length / bufferSize; diff --git a/source/dbms.mysql/Statement.cpp b/source/dbms.mysql/Statement.cpp index 18e5031..df18acc 100644 --- a/source/dbms.mysql/Statement.cpp +++ b/source/dbms.mysql/Statement.cpp @@ -37,7 +37,7 @@ void dbms::mysql::Statement::prepare(dbms::Connection* dbmsConnection) throw(RuntimeException, dbms::DatabaseException) { LOGMETHOD(TraceMethod tm("anna::dbms::mysql::Statement", "prepare", ANNA_FILE_LOCATION)); Connection* connection(static_cast (dbmsConnection)); - Database& dbms(static_cast (connection->getDatabase())); + //Database& dbms(static_cast (connection->getDatabase())); LOGDEBUG( string msg("anna::dbms::mysql::Statement::prepare | "); msg += asString(); @@ -128,7 +128,7 @@ throw(RuntimeException, dbms::DatabaseException) { dbms::ResultCode dbms::mysql::Statement::execute(dbms::Connection* dbmsConnection) throw(RuntimeException, dbms::DatabaseException) { - Connection* connection(static_cast (dbmsConnection)); + //Connection* connection(static_cast (dbmsConnection)); for(input_iterator ii = input_begin(), maxii = input_end(); ii != maxii; ii ++) { inputBind(ii)->code(); diff --git a/source/dbms.oracle/Database.cpp b/source/dbms.oracle/Database.cpp index f8f14b9..a90785e 100644 --- a/source/dbms.oracle/Database.cpp +++ b/source/dbms.oracle/Database.cpp @@ -39,7 +39,6 @@ oracle::Database::Database(const char* componentName, const char* dbmsName) : void oracle::Database::do_initialize() throw(RuntimeException) { LOGMETHOD(TraceMethod tm("anna::dbms::oracle::Database", "do_initialize", ANNA_FILE_LOCATION)); - int status; if(a_env != NULL) { Logger::write(Logger::Warning, asString(), "Already initialized", ANNA_FILE_LOCATION); diff --git a/source/dbms.oracle/InputBind.cpp b/source/dbms.oracle/InputBind.cpp index 4eec659..c554843 100644 --- a/source/dbms.oracle/InputBind.cpp +++ b/source/dbms.oracle/InputBind.cpp @@ -104,12 +104,21 @@ throw(RuntimeException) { return; switch(data.getType()) { + case Data::Type::String: + throw RuntimeException("anna::dbms::oracle::InputBind::code not implemented for Data::Type::String", ANNA_FILE_LOCATION); + break; + case Data::Type::Integer: + throw RuntimeException("anna::dbms::oracle::InputBind::code not implemented for Data::Type::Integer", ANNA_FILE_LOCATION); + break; case Data::Type::Float: codeFloat(data); break; case Data::Type::ShortBlock: codeShortBlock(data); break; + case Data::Type::LongBlock: + throw RuntimeException("anna::dbms::oracle::InputBind::code not implemented for Data::Type::LongBlock", ANNA_FILE_LOCATION); + break; case Data::Type::Date: case Data::Type::TimeStamp: diff --git a/source/dbms.oracle/OutputBind.cpp b/source/dbms.oracle/OutputBind.cpp index 3116b8d..9b18d68 100644 --- a/source/dbms.oracle/OutputBind.cpp +++ b/source/dbms.oracle/OutputBind.cpp @@ -101,6 +101,9 @@ throw(RuntimeException) { else dbms::String::strip(str); + break; + case Data::Type::Integer: + throw RuntimeException("anna::dbms::oracle::OutputBind::decode not implemented for Data::Type::Integer", ANNA_FILE_LOCATION); break; case Data::Type::Float: decodeFloat(data); diff --git a/source/dbms.oracle/ResultCode.cpp b/source/dbms.oracle/ResultCode.cpp index 84bb2a1..d9a2200 100644 --- a/source/dbms.oracle/ResultCode.cpp +++ b/source/dbms.oracle/ResultCode.cpp @@ -36,8 +36,6 @@ oracle::ResultCode::ResultCode(const int status, OCIError* error) : return; } - char* aux; - switch(status) { case OCI_ERROR: OCIErrorGet(error, (ub4) 1, (text*) 0, &errorCode, (unsigned char*) errorText, (ub4) sizeof(errorText), OCI_HTYPE_ERROR); diff --git a/source/dbos/Accesor.cpp b/source/dbos/Accesor.cpp index 2ddf7e6..f77d2aa 100644 --- a/source/dbos/Accesor.cpp +++ b/source/dbos/Accesor.cpp @@ -33,7 +33,6 @@ dbos::Accesor::~Accesor() { //------------------------------------------------------------------------------------------ bool dbos::Accesor::load(dbms::Connection* connection, const dbos::StorageArea* ssaa) throw(RuntimeException, dbms::DatabaseException) { - bool result = false; if(connection == NULL) { std::string msg(ssaa->asString()); diff --git a/source/diameter.comm/ClientSession.cpp b/source/diameter.comm/ClientSession.cpp index 87c9cc1..78aa06c 100644 --- a/source/diameter.comm/ClientSession.cpp +++ b/source/diameter.comm/ClientSession.cpp @@ -81,7 +81,7 @@ int ClientSession::getPort() const throw() { void ClientSession::setState(State::_v state) throw() { Session::setState(state); // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); } void ClientSession::bind() throw(anna::RuntimeException) { @@ -600,7 +600,7 @@ throw(anna::RuntimeException) { setState(State::Bound); //activateTimer(); // Ya se invoca al inicio de este metodo ::receive // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); //startClock(); } } @@ -731,10 +731,8 @@ throw(anna::RuntimeException) { void ClientSession::finalize() throw() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "finalize", ANNA_FILE_LOCATION)); Session::finalize(); - // Check deprecated entity: - const Entity *entity = getParent() /* server */ ->getParent() /* entity */; // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); // OAM const Server *server = getParent(); bool multipleConnections = (server->getMaxClientSessions() > 1); @@ -765,7 +763,7 @@ void ClientSession::recover() throw() { } // Inform father server (availability changes): - bool changes = a_parent->refreshAvailability(); + a_parent->refreshAvailability(); // OAM const Server *server = getParent(); bool multipleConnections = (server->getMaxClientSessions() > 1); diff --git a/source/diameter.comm/LocalServer.cpp b/source/diameter.comm/LocalServer.cpp index 787755b..3224793 100644 --- a/source/diameter.comm/LocalServer.cpp +++ b/source/diameter.comm/LocalServer.cpp @@ -228,7 +228,8 @@ void LocalServer::newConnection() throw(anna::RuntimeException) { } // Inform local server (availability changes): - bool changes = refreshAvailability(); + refreshAvailability(); + // OAM OamModule &oamModule = OamModule::instantiate(); oamModule.count(OamModule::Counter::CreatedConnectionForServerSession); @@ -501,7 +502,7 @@ bool LocalServer::send(const Message* message, int socketId) throw(anna::Runtime // Send: try { - const Response* response = a_lastUsedResource->send(message); + a_lastUsedResource->send(message); return true; // no matter if response is NULL (answers, i.e.) or not. } catch(anna::RuntimeException &ex) { ex.trace(); @@ -519,12 +520,11 @@ bool LocalServer::send(const Message* message, int socketId) throw(anna::Runtime bool LocalServer::broadcast(const Message* message) throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "broadcast", ANNA_FILE_LOCATION)); - const Response* response; bool allok = true; for(serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++) { try { - response = serverSession(it)->send(message); + serverSession(it)->send(message); } catch(anna::RuntimeException &ex) { ex.trace(); allok = false; diff --git a/source/diameter.comm/Server.cpp b/source/diameter.comm/Server.cpp index 3207094..32b3efa 100644 --- a/source/diameter.comm/Server.cpp +++ b/source/diameter.comm/Server.cpp @@ -124,7 +124,7 @@ bool Server::send(const Message* message, int socketId) throw(anna::RuntimeExcep try { // Send: - const Response* response = a_lastUsedResource->send(message); + a_lastUsedResource->send(message); return true; // no matter if response is NULL (answers, i.e.) or not. } catch(anna::RuntimeException &ex) { LOGDEBUG( @@ -146,12 +146,11 @@ bool Server::send(const Message* message, int socketId) throw(anna::RuntimeExcep bool Server::broadcast(const Message* message) throw(anna::RuntimeException) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "broadcast", ANNA_FILE_LOCATION)); assertReady(); - const Response* response; bool allok = true; for(std::vector::iterator it = begin(); it != end(); it++) { try { - response = (*it)->send(message); + (*it)->send(message); } catch(anna::RuntimeException &ex) { ex.trace(); allok = false; diff --git a/source/diameter.comm/ServerSession.cpp b/source/diameter.comm/ServerSession.cpp index ef58f68..e47170a 100644 --- a/source/diameter.comm/ServerSession.cpp +++ b/source/diameter.comm/ServerSession.cpp @@ -567,7 +567,7 @@ void ServerSession::finalize() throw() { } // Inform father local server (availability changes): - bool changes = getParent()->refreshAvailability(); + getParent()->refreshAvailability(); // OAM bool multipleConnections = (getParent()->getMaxConnections() > 1); std::string socket = anna::functions::socketLiteralAsString(getAddress(), getPort()); diff --git a/source/diameter.comm/Session.cpp b/source/diameter.comm/Session.cpp index 778a834..736635c 100644 --- a/source/diameter.comm/Session.cpp +++ b/source/diameter.comm/Session.cpp @@ -439,7 +439,6 @@ throw() { // Messages anna::xml::Node* messages = result->createChild("diameter.comm.Messages"); - const Response* response; const Message* message; for(const_response_iterator ii = response_begin(), maxii = response_end(); ii != maxii; ii ++) { diff --git a/source/diameter/app/dcca/Message.cpp b/source/diameter/app/dcca/Message.cpp index 5441214..529a39e 100644 --- a/source/diameter/app/dcca/Message.cpp +++ b/source/diameter/app/dcca/Message.cpp @@ -14,8 +14,9 @@ using namespace anna::diameter::app::dcca; const qosProfile_t & Message::decode3GPPGPRSNegQoSProfile() throw(anna::RuntimeException) { - const std::string & utf8 = get3GPPGPRSNegQoSProfile()->getValue(); a_qosProfile.reset(); + //const std::string & utf8 = get3GPPGPRSNegQoSProfile()->getValue(); + // TODO: decode here ... return a_qosProfile; } diff --git a/source/diameter/codec/EngineImpl.cpp b/source/diameter/codec/EngineImpl.cpp index 5fff449..f86929a 100644 --- a/source/diameter/codec/EngineImpl.cpp +++ b/source/diameter/codec/EngineImpl.cpp @@ -122,7 +122,7 @@ throw() { result->createAttribute("SingleFailedAVP", a_singleFailedAVP ? "yes" : "no"); result->createAttribute("IgnoreFlags", a_ignoreFlags ? "yes" : "no"); result->createAttribute("FixMode", asText(a_fixMode)); - anna::xml::Node* dictionary = result->createChild("EngineImpl.ActivatedDictionary"); + result->createChild("EngineImpl.ActivatedDictionary"); if(a_dictionary) a_dictionary->asXML(result); diff --git a/source/diameter/codec/basetypes/Address.cpp b/source/diameter/codec/basetypes/Address.cpp index e707fa7..b58a6fd 100644 --- a/source/diameter/codec/basetypes/Address.cpp +++ b/source/diameter/codec/basetypes/Address.cpp @@ -118,7 +118,6 @@ void anna::diameter::codec::basetypes::Address::setPrintableString(const char * // First: User will update child class members // Auxiliary iana_address_t address; - int version; std::string value; // From message.dtd: // [ Address ] ('|' representation; i.e. '1|192.168.0.1'(IPv4), '8|34616279266'(E164), etc. diff --git a/source/diameter/helpers/ericsson/functions.cpp b/source/diameter/helpers/ericsson/functions.cpp index 97cc551..9c65681 100644 --- a/source/diameter/helpers/ericsson/functions.cpp +++ b/source/diameter/helpers/ericsson/functions.cpp @@ -37,7 +37,6 @@ std::string anna::diameter::helpers::ericsson::functions::getSCAPSubscriptionIdD int pos = 1; // first avp const char * subscriptionIdPtr; const char * subscriptionIdDataPtr; - int type; // Decoded avp information: AvpId _id; char _flags; diff --git a/source/diameter/stack/Engine.cpp b/source/diameter/stack/Engine.cpp index d5f3468..0acb5e1 100644 --- a/source/diameter/stack/Engine.cpp +++ b/source/diameter/stack/Engine.cpp @@ -19,11 +19,6 @@ #include - -// libxml2 Parser doesn't support default attribute value retrieving: -// \n\ -// This dtd sintax will be replaced by #IMPLIED attributes. - namespace anna { namespace diameter { namespace stack { @@ -150,7 +145,6 @@ const anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::getDict //------------------------------------------------------------------------------ std::string anna::diameter::stack::Engine::asString(bool all) const throw() { std::string trace; - unsigned int stackId; if(isEmpty()) { trace = "No diameter stacks found"; @@ -192,7 +186,7 @@ anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::registerDicti throw anna::RuntimeException("Such provided stack id has already been created. Removes it before call this method", ANNA_FILE_LOCATION); } else { // new stack a_stacks[stackId] = dictionary; // no need for singleton destructor - const_stack_iterator it = a_stacks.find(stackId); + //const_stack_iterator it = a_stacks.find(stackId); //result = (Dictionary *)(*it).second; result = dictionary; } diff --git a/source/io/BinaryReader.cpp b/source/io/BinaryReader.cpp index b4e23a0..b971159 100644 --- a/source/io/BinaryReader.cpp +++ b/source/io/BinaryReader.cpp @@ -45,7 +45,6 @@ const DataBlock* io::BinaryReader::fetch() throw(RuntimeException) { verify(); allocate(a_blockSize); - const DataBlock* result = NULL; size_t blockSize = fread((char *) getData(), 1, a_blockSize, a_file); if(blockSize == 0) diff --git a/source/ldap/Engine.cpp b/source/ldap/Engine.cpp index 7445e14..42263ca 100644 --- a/source/ldap/Engine.cpp +++ b/source/ldap/Engine.cpp @@ -251,7 +251,6 @@ throw(RuntimeException) { const char* Engine::completeURL(const char* url) throw() { static const char* protocol = "ldap://"; - static const int protocolLen = anna_strlen(protocol); if(anna_strstr(url, "://") == 0) { a_auxURL = protocol; diff --git a/source/ldap/Search.cpp b/source/ldap/Search.cpp index aedcd12..2f2e063 100644 --- a/source/ldap/Search.cpp +++ b/source/ldap/Search.cpp @@ -51,6 +51,7 @@ throw() { case Scope::Base: scope = LDAP_SCOPE_BASE; break; case Scope::OneLevel: scope = LDAP_SCOPE_ONELEVEL; break; case Scope::SubTree: scope = LDAP_SCOPE_SUBTREE; break; + case Scope::None: return result; break; } int maxi = attribute_size() + 1; diff --git a/source/ldap/Session.cpp b/source/ldap/Session.cpp index fdf6196..8507218 100644 --- a/source/ldap/Session.cpp +++ b/source/ldap/Session.cpp @@ -69,7 +69,6 @@ throw(RuntimeException) { LDAP* handle = NULL; int aux; ResultCode resultCode; - Response* response(NULL); try { resultCode = ldap_initialize(&handle, a_url.c_str()); @@ -462,7 +461,6 @@ throw(RuntimeException) { int error = LDAP_SUCCESS; char **values(NULL); ResultCode resultCode; - bool isOk = true; response->cancelTimer(); const int ldap_result = ldap_parse_result(handle, hmessage, &error, NULL, NULL, &values, NULL, 0); resultCode.setValue(ldap_result, error); @@ -607,7 +605,6 @@ throw() { result->createChild("NetworkTimeout")->createAttribute("Value", getNetworkTimeout()); xml::Node* requests = result->createChild("ldap.Requests"); - const Response* response; const Request* request; for(const_response_iterator ii = response_begin(), maxii = response_end(); ii != maxii; ii ++) { diff --git a/source/testing/TestStep.cpp b/source/testing/TestStep.cpp index e180437..413ad28 100644 --- a/source/testing/TestStep.cpp +++ b/source/testing/TestStep.cpp @@ -101,6 +101,7 @@ namespace { // TODO: mutex the step while setting data here !! } +/* void cmdRunOnThreadWithFork (TestStepCmd *step, const std::string &cmd) { // Thread running: @@ -148,6 +149,7 @@ namespace { step->complete(); } } +*/ bool decodeMessage(const anna::DataBlock &message, anna::diameter::codec::Message &messageCodec) throw() { diff --git a/source/xml/DocumentFile.cpp b/source/xml/DocumentFile.cpp index c51ed79..f5ac226 100644 --- a/source/xml/DocumentFile.cpp +++ b/source/xml/DocumentFile.cpp @@ -74,7 +74,7 @@ throw(RuntimeException) { const int size = lseek(stream, 0, SEEK_END); lseek(stream, 0, SEEK_SET); char* buffer = new char [size]; - read(stream, buffer, size); + ssize_t r = read(stream, buffer, size); close(stream); const_cast (this)->setContent(buffer, size); delete buffer; diff --git a/source/xml/XPath.cpp b/source/xml/XPath.cpp index 77803d9..f2e98cc 100644 --- a/source/xml/XPath.cpp +++ b/source/xml/XPath.cpp @@ -67,7 +67,6 @@ throw(RuntimeException) { const xml::Node* xml::XPath::find(const Document& document, const char* expression, const int mode, const Exception::Mode::_v emode) throw(RuntimeException) { apply(document, expression, mode); - const xml::Node* result = NULL; Node::const_child_iterator ii = node_begin(); if(ii == node_end()) { @@ -238,6 +237,9 @@ throw(RuntimeException) { node->createText(decode(xmlNode->content)); return; + + default: + ; } xmlNode = xmlNode->next;