From 5256cb543a9d35b610df19bd227cde977186aef0 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Fri, 20 Mar 2015 15:36:40 +0100 Subject: [PATCH] Suuports clang compiler --- SConstruct | 12 ++++- docs/doxygen/related/redmine-ref.md | 4 -- example/comm/client/main.cpp | 4 +- example/comm/datagramKClient/main.cpp | 4 +- example/comm/datagramRServer/main.cpp | 4 +- example/comm/kClient/main.cpp | 2 +- example/comm/rServer/main.cpp | 6 +-- example/comm/rrClient/main.cpp | 6 +-- example/core/recycler/main.cpp | 2 +- example/core/trace/main.cpp | 2 +- example/dbms.mysql/insert/main.c | 6 ++- example/dbms.mysql/select/main.c | 2 +- example/dbms.mysql/xInsert/main.cpp | 2 +- example/dbms.mysql/xSelect/main.cpp | 2 +- example/dbos/workdir/main.cpp | 6 +-- example/diameter/launcher/main.cpp | 6 +-- example/http/client/main.cpp | 4 +- example/http/wims20Client/main.cpp | 14 +++--- example/http/wims20RServer/main.cpp | 6 +-- example/http/wims20XClient/main.cpp | 4 +- example/http/xmlClient/main.cpp | 4 +- example/http/xmlSender/main.cpp | 10 ++-- example/io/reader/reader.cpp | 4 +- example/ldap/tSearch/main.cpp | 4 +- .../ArithmeticHTTPServer/Application.hpp | 2 +- .../timex/ArithmeticHTTPServer/Context.cpp | 10 ++-- .../timex/ArithmeticHTTPServer/Context.hpp | 8 +-- .../ArithmeticHTTPServer/Transaction.cpp | 2 +- .../ArithmeticHTTPServer/Transaction.hpp | 4 +- include/anna/config/defines.hpp | 2 +- include/anna/core/define.autoenum.hpp | 2 +- include/anna/core/functions.hpp | 2 +- include/anna/core/oam/Module.hpp | 4 +- include/anna/dbos/StorageArea.hpp | 2 - include/anna/diameter/stack/Command.hpp | 1 - include/anna/test/clang_specific.hpp | 18 +++++++ source/comm/Communicator.cpp | 1 + source/comm/CompatCodec.cpp | 37 +++++--------- source/comm/handler/Manager.cpp | 1 + source/core/DataBlock.cpp | 2 +- source/core/functions.cpp | 50 +++++++++---------- source/core/mt/ThreadManager.cpp | 1 + source/core/oam/Module.cpp | 6 +-- source/core/util/MultiRangeExpression.cpp | 2 +- source/core/util/TextVariable.cpp | 1 + source/core/util/Variable.cpp | 8 +++ source/core/util/ZBlock.cpp | 4 +- source/dbms.mysql/BaseBind.cpp | 1 + source/dbms.oracle/BaseBind.cpp | 1 + source/dbms.oracle/InputBind.cpp | 4 +- source/dbms.oracle/OutputBind.cpp | 2 +- source/dbms/Delivery.cpp | 1 - source/dbms/String.cpp | 2 +- source/dbos/StorageArea.cpp | 2 +- source/diameter.comm/Engine.cpp | 2 +- source/diameter.comm/Entity.cpp | 2 +- source/diameter.comm/Server.cpp | 2 +- source/diameter/codec/Avp.cpp | 2 +- source/diameter/codec/Message.cpp | 6 +++ source/diameter/stack/Avp.cpp | 2 +- source/diameter/stack/AvpRule.cpp | 2 +- source/diameter/stack/Command.cpp | 2 +- source/diameter/stack/Dictionary.cpp | 26 +++++----- source/html/DocumentFile.cpp | 2 +- source/html/DocumentMemory.cpp | 2 +- source/http/Method.cpp | 2 +- source/http/internal/Token.cpp | 4 +- source/http/internal/Tokenizer.cpp | 2 +- source/test/Menu.cpp | 2 +- source/timex/Clock.cpp | 4 +- source/timex/Engine.cpp | 34 ++++++------- source/timex/TimeEvent.cpp | 4 +- source/timex/internal/TickConsumer.cpp | 10 ++-- source/timex/internal/TickProducer.cpp | 8 +-- source/xml/DocumentFile.cpp | 2 +- source/xml/Parser.cpp | 12 ++--- test/config/main.cpp | 1 + test/core/main.cpp | 1 + test/time/main.cpp | 1 + 79 files changed, 236 insertions(+), 204 deletions(-) delete mode 100644 docs/doxygen/related/redmine-ref.md create mode 100644 include/anna/test/clang_specific.hpp diff --git a/SConstruct b/SConstruct index 2db7690..fd6ba85 100644 --- a/SConstruct +++ b/SConstruct @@ -18,7 +18,15 @@ target_opt_bin = os.path.join (opt_bin, "anna") release = ARGUMENTS.get ('release', 0) # Environment -env = Environment () + +# Using clang, uncomment following: +env = Environment(CXX = 'clang++') +env.Append (CCFLAGS = '-DIS_CLANG') +env.Append (CXXFLAGS = '-Wno-parentheses-equality') + +# Using c++, uncomment following: +#env = Environment () + #oracle_includes = os.environ["ORACLE_HOME"] + "/include" oracle_includes = "/usr/lib/oracle/12.1/client64/include" @@ -52,7 +60,7 @@ if int(release): env.Append (VARIANT = variant) else: variant='debug' - env.Append (CCFLAGS = '-g -O0 -D_DEBUG') + env.Append (CCFLAGS = '-g -O0') env.Append (LIBPATH = os.path.join (current_directory, variant)) env.Append (VARIANT = variant) diff --git a/docs/doxygen/related/redmine-ref.md b/docs/doxygen/related/redmine-ref.md deleted file mode 100644 index 887b9f6..0000000 --- a/docs/doxygen/related/redmine-ref.md +++ /dev/null @@ -1,4 +0,0 @@ -Redmine server -============== - -[Return to the project](http://redmine.teslayout.com/projects/anna-suite) diff --git a/example/comm/client/main.cpp b/example/comm/client/main.cpp index 9ecd3fd..afdd934 100644 --- a/example/comm/client/main.cpp +++ b/example/comm/client/main.cpp @@ -58,7 +58,7 @@ #include #include -class Sender : public timex::Clock { +class Sender : public anna::timex::Clock { public: Sender () : Clock ("Sender", (Millisecond)1000), a_messageBySecond (0), @@ -115,7 +115,7 @@ public: private: MyCommunicator a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; Sender a_sender; Server* a_server; diff --git a/example/comm/datagramKClient/main.cpp b/example/comm/datagramKClient/main.cpp index df6a058..27c48aa 100644 --- a/example/comm/datagramKClient/main.cpp +++ b/example/comm/datagramKClient/main.cpp @@ -111,9 +111,9 @@ KClient::KClient () : { CommandLine& commandLine (CommandLine::instantiate ()); - commandLine.add ("as", CommandLine::Argument::Optional, "Dirección broadcast en el que servidor atiende peticiones."); + commandLine.add ("as", CommandLine::Argument::Optional, "Direccion broadcast en el que servidor atiende peticiones."); commandLine.add ("ps", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende las peticiones."); - commandLine.add ("a", CommandLine::Argument::Optional, "Dirección broadcast en la que el cliente atiende respuestas."); + commandLine.add ("a", CommandLine::Argument::Optional, "Direccion broadcast en la que el cliente atiende respuestas."); commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que atiende las respuestas"); activateGeneralPublicLicense (); diff --git a/example/comm/datagramRServer/main.cpp b/example/comm/datagramRServer/main.cpp index 47b925c..eeb918c 100644 --- a/example/comm/datagramRServer/main.cpp +++ b/example/comm/datagramRServer/main.cpp @@ -134,9 +134,9 @@ ArithmeticServer::ArithmeticServer () : { CommandLine& commandLine (CommandLine::instantiate ()); - commandLine.add ("as", CommandLine::Argument::Optional, "Dirección broadcast en el que servidor atiende peticiones."); + commandLine.add ("as", CommandLine::Argument::Optional, "Direccion broadcast en el que servidor atiende peticiones."); commandLine.add ("ps", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende las peticiones."); - commandLine.add ("ac", CommandLine::Argument::Optional, "Dirección broadcast en el que cliente atiende respuestas."); + commandLine.add ("ac", CommandLine::Argument::Optional, "Direccion broadcast en el que cliente atiende respuestas."); commandLine.add ("pc", CommandLine::Argument::Mandatory, "Puerto al que enviar las respuestas"); commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)"); } diff --git a/example/comm/kClient/main.cpp b/example/comm/kClient/main.cpp index c3ed0b4..5171ce1 100644 --- a/example/comm/kClient/main.cpp +++ b/example/comm/kClient/main.cpp @@ -111,7 +111,7 @@ KClient::KClient () : CommandLine& commandLine (CommandLine::instantiate ()); commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende respuestas."); - commandLine.add ("a", CommandLine::Argument::Optional, "Dirección IP Puerto en el que el servidor atiende respuestas."); + commandLine.add ("a", CommandLine::Argument::Optional, "Direccion IP Puerto en el que el servidor atiende respuestas."); commandLine.add ("host", CommandLine::Argument::Optional, "Nombre del host en el que atiende el servidor"); commandLine.add ("auto", CommandLine::Argument::Optional, "Autoreconexion", false); commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)"); diff --git a/example/comm/rServer/main.cpp b/example/comm/rServer/main.cpp index b140daa..474de18 100644 --- a/example/comm/rServer/main.cpp +++ b/example/comm/rServer/main.cpp @@ -139,13 +139,13 @@ ArithmeticServer::ArithmeticServer () : commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que atender peticiones"); commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP en la que atender"); commandLine.add ("d", CommandLine::Argument::Mandatory, "Retardo aplicado a la contestacio"); - commandLine.add ("maxpending", CommandLine::Argument::Optional, "Nº máximo de bytes en la cola de entrada"); + commandLine.add ("maxpending", CommandLine::Argument::Optional, "Numero maximo de bytes en la cola de entrada"); commandLine.add ("limit", CommandLine::Argument::Mandatory, "% de ocupacion que permitimos"); - commandLine.add ("r", CommandLine::Argument::Optional, "Indicador de reuso de direccin", false); + commandLine.add ("r", CommandLine::Argument::Optional, "Indicador de reuso de direccion", false); commandLine.add ("n", CommandLine::Argument::Optional, "Numero de mensajes a servir", true); commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)"); commandLine.add ("clone", CommandLine::Argument::Optional, "Aplica el metodo de clonado en el tratamiento de mensajes", false); - commandLine.add ("chunksize", CommandLine::Argument::Optional, "Tamaño del chunk de lectura"); + commandLine.add ("chunksize", CommandLine::Argument::Optional, "Tamano del chunk de lectura"); } //----------------------------------------------------------------------------------------- diff --git a/example/comm/rrClient/main.cpp b/example/comm/rrClient/main.cpp index 50d94a0..b58c6e0 100644 --- a/example/comm/rrClient/main.cpp +++ b/example/comm/rrClient/main.cpp @@ -57,7 +57,7 @@ #include #include -class Sender : public timex::Clock { +class Sender : public anna::timex::Clock { public: Sender () : Clock ("Sender", (Millisecond)1000), a_messageBySecond (0), @@ -112,7 +112,7 @@ public: private: MyCommunicator a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; Sender a_sender; Service* a_service; @@ -292,7 +292,7 @@ bool Sender::tick () Communicator* communicator = anna::app::functions::component (ANNA_FILE_LOCATION); if (a_messageBySecond == 0) - throw RuntimeException ("Hay que indicar el nº de mensajes por segundo", ANNA_FILE_LOCATION); + throw RuntimeException ("Hay que indicar el numero de mensajes por segundo", ANNA_FILE_LOCATION); if (a_errorCounter > 100) { diff --git a/example/core/recycler/main.cpp b/example/core/recycler/main.cpp index d32b0dd..e30fa77 100644 --- a/example/core/recycler/main.cpp +++ b/example/core/recycler/main.cpp @@ -172,7 +172,7 @@ void reuse (const int freeCounter) } int main (int argc, const char** argv) { - timex::MicroMeter meter; + anna::timex::MicroMeter meter; try { Logger::setLevel (Logger::Debug); diff --git a/example/core/trace/main.cpp b/example/core/trace/main.cpp index aa6eb63..4da6293 100644 --- a/example/core/trace/main.cpp +++ b/example/core/trace/main.cpp @@ -109,7 +109,7 @@ void Test::run () Logger::Level level = Logger::getLevel (); - for (register int i = 0; i < n; i ++) { + for (int i = 0; i < n; i ++) { if ((i % 2) == 0) Logger::write (level, "string", str.c_str (), ANNA_FILE_LOCATION); else diff --git a/example/dbms.mysql/insert/main.c b/example/dbms.mysql/insert/main.c index 4587f5c..f3ffd16 100644 --- a/example/dbms.mysql/insert/main.c +++ b/example/dbms.mysql/insert/main.c @@ -1,3 +1,4 @@ +#include #include #include @@ -5,7 +6,7 @@ #define STRING_SIZE 50 -#define INSERT_SAMPLE "insert into nemesis_db_test (xx, yy, zz, tt) values (?,?,?,?)" +#define INSERT_SAMPLE "insert into anna_db_test (xx, yy, zz, tt) values (?,?,?,?)" #define MAXCOLUMN 4 @@ -27,7 +28,7 @@ my_bool is_null[MAXCOLUMN]; int main () { if ((mysql = mysql_init (NULL)) == NULL) - exit (-12); + exit(-12); if (mysql_real_connect (mysql, NULL, "sdp", "sdp", "test", 0, NULL, 0L) == NULL) { fprintf(stderr, " mysql_stmt_prepare(), SELECT failed\n"); @@ -136,4 +137,5 @@ int main () exit(0); } + return 0; } diff --git a/example/dbms.mysql/select/main.c b/example/dbms.mysql/select/main.c index c7a158f..3851eff 100644 --- a/example/dbms.mysql/select/main.c +++ b/example/dbms.mysql/select/main.c @@ -5,7 +5,7 @@ #define STRING_SIZE 50 -#define SELECT_SAMPLE "SELECT xx, yy, zz, tt FROM nemesis_db_test" +#define SELECT_SAMPLE "SELECT xx, yy, zz, tt FROM anna_db_test" #define MAXCOLUMN 4 diff --git a/example/dbms.mysql/xInsert/main.cpp b/example/dbms.mysql/xInsert/main.cpp index a629241..7818c1a 100644 --- a/example/dbms.mysql/xInsert/main.cpp +++ b/example/dbms.mysql/xInsert/main.cpp @@ -86,7 +86,7 @@ Insert::Insert () : cl.add ("user", CommandLine::Argument::Mandatory, "Nombre del usuario"); cl.add ("password", CommandLine::Argument::Mandatory, "Clave del usuario"); - cl.add ("host", CommandLine::Argument::Optional, "Nombre de la máquina donde se ubica el MySQL"); + cl.add ("host", CommandLine::Argument::Optional, "Nombre de la maquina donde se ubica el MySQL"); cl.add ("db", CommandLine::Argument::Optional, "Nombre de la base de datos"); } diff --git a/example/dbms.mysql/xSelect/main.cpp b/example/dbms.mysql/xSelect/main.cpp index fd8a12f..4a53586 100644 --- a/example/dbms.mysql/xSelect/main.cpp +++ b/example/dbms.mysql/xSelect/main.cpp @@ -86,7 +86,7 @@ Select::Select () : cl.add ("user", CommandLine::Argument::Mandatory, "Nombre del usuario"); cl.add ("password", CommandLine::Argument::Mandatory, "Clave del usuario"); - cl.add ("host", CommandLine::Argument::Optional, "Nombre de la máquina donde se ubica el MySQL"); + cl.add ("host", CommandLine::Argument::Optional, "Nombre de la maquina donde se ubica el MySQL"); cl.add ("db", CommandLine::Argument::Optional, "Nombre de la base de datos"); } diff --git a/example/dbos/workdir/main.cpp b/example/dbos/workdir/main.cpp index cba8019..b6867e7 100644 --- a/example/dbos/workdir/main.cpp +++ b/example/dbos/workdir/main.cpp @@ -133,7 +133,7 @@ WorkDirectory::WorkDirectory () : CommandLine& cl (CommandLine::instantiate ()); cl.add ("dir", CommandLine::Argument::Mandatory, "Nombre del directorio a procesar"); - cl.add ("l", CommandLine::Argument::Optional, "Nº máximo de niveles de profundidad"); + cl.add ("l", CommandLine::Argument::Optional, "Numero maximo de niveles de profundidad"); cl.add ("trace", CommandLine::Argument::Optional, "Nivel de trazado"); cl.add ("s", CommandLine::Argument::Mandatory, "Cache size"); } @@ -278,7 +278,7 @@ void WorkDirectory::reuseHoles (filesystem::Directory* dir, WorkDirectory::file_ { TraceMethod tm ("WorkDirectory", "reuseHoles", ANNA_FILE_LOCATION); - cout << "WorkDirectory::reuseHoles: Invoca dos veces a fullCache para verificar que el tamaño se mantiene la 2ª vez" << endl; + cout << "WorkDirectory::reuseHoles: Invoca dos veces a fullCache para verificar que el tamano se mantiene la segunda vez" << endl; fullCache (dir, files, Flags::Clear); fullCache (dir, files, Flags::Clear); cout << endl; @@ -289,7 +289,7 @@ void WorkDirectory::destroyObjects (filesystem::Directory* dir, WorkDirectory::f { TraceMethod tm ("WorkDirectory", "destroyObjects", ANNA_FILE_LOCATION); - cout << "WorkDirectory::destroyObjects: Carga un directorio distinto, para verificar que destruye los objetos según se dejan de utilizar" << endl; + cout << "WorkDirectory::destroyObjects: Carga un directorio distinto, para verificar que destruye los objetos segun se dejan de utilizar" << endl; filesystem::File* file; filesystem::Directory* other = NULL; diff --git a/example/diameter/launcher/main.cpp b/example/diameter/launcher/main.cpp index 033070b..280624c 100644 --- a/example/diameter/launcher/main.cpp +++ b/example/diameter/launcher/main.cpp @@ -452,7 +452,7 @@ int Launcher::pushBurst(int loadAmount) throw() { } a_burstActive = true; - register int count; + int count; for (count = 0; count < loadAmount; count++) if (!sendBurstMessage()) break; @@ -476,7 +476,7 @@ int Launcher::sendBurst(int loadAmount) throw() { return -2; } - register int count; + int count; for (count = 0; count < loadAmount; count++) if (!sendBurstMessage(true /* anyway */)) break; @@ -517,7 +517,7 @@ bool Launcher::sendBurstMessage(bool anyway) throw() { if (a_burstRepeat) { a_burstCycle++; - if (burstLogEnabled()) writeBurstLogFile(anna::functions::asString(("\nCompleted burst cycle. Starting again (repeat mode) on cycle %d.\n", a_burstCycle))); + if (burstLogEnabled()) writeBurstLogFile(anna::functions::asString("\nCompleted burst cycle. Starting again (repeat mode) on cycle %d.\n", a_burstCycle)); } else { if (burstLogEnabled()) writeBurstLogFile("\nCompleted burst cycle. Burst finished (repeat mode disabled).\n"); diff --git a/example/http/client/main.cpp b/example/http/client/main.cpp index 6ed8f5b..c077cc5 100644 --- a/example/http/client/main.cpp +++ b/example/http/client/main.cpp @@ -63,7 +63,7 @@ #include #include -class Sender : public timex::Clock { +class Sender : public anna::timex::Clock { public: Sender () : Clock ("Sender", (Millisecond)1000), a_messageBySecond (0), @@ -136,7 +136,7 @@ public: private: MyCommunicator a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; Sender a_sender; Server* a_server; diff --git a/example/http/wims20Client/main.cpp b/example/http/wims20Client/main.cpp index d87ee44..2294777 100644 --- a/example/http/wims20Client/main.cpp +++ b/example/http/wims20Client/main.cpp @@ -127,16 +127,16 @@ IHTTPClient::IHTTPClient () : { CommandLine& commandLine (CommandLine::instantiate ()); - commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende respuestas."); - commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP Puerto en el que el servidor atiende respuestas."); - commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la petición WIMS 2.0"); - commandLine.add ("op", CommandLine::Argument::Mandatory, "operación a realizar (sum,sub,mul,div)"); + commandLine.add ("p", CommandLine::Argument::Mandatory, "Port to attend the answers."); + commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccion IP Puerto en el que el servidor atiende respuestas."); + commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la peticion WIMS 2.0"); + commandLine.add ("op", CommandLine::Argument::Mandatory, "operacion a realizar (sum,sub,mul,div)"); commandLine.add ("x", CommandLine::Argument::Mandatory, "Primer operador"); commandLine.add ("y", CommandLine::Argument::Mandatory, "Segundo operador"); - commandLine.add ("op", CommandLine::Argument::Mandatory, "operación a realizar (sum,sub,mul,div)"); + commandLine.add ("op", CommandLine::Argument::Mandatory, "operacion a realizar (sum,sub,mul,div)"); commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)"); - commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la petición WIMS 2.0"); - commandLine.add ("m", CommandLine::Argument::Optional, "Método HTTP a usar"); + commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la peticion WIMS 2.0"); + commandLine.add ("m", CommandLine::Argument::Optional, "Metodo HTTP a usar"); } void IHTTPClient::initialize () diff --git a/example/http/wims20RServer/main.cpp b/example/http/wims20RServer/main.cpp index a7aa58c..1f6428c 100644 --- a/example/http/wims20RServer/main.cpp +++ b/example/http/wims20RServer/main.cpp @@ -130,10 +130,10 @@ HTTPArithmeticServer::HTTPArithmeticServer () : CommandLine& commandLine (CommandLine::instantiate ()); commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que atender peticiones"); - commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP en la que atender"); + commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccion IP en la que atender"); commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)"); - commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la petición WIMS 2.0"); - commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la petición WIMS 2.0"); + commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la peticion WIMS 2.0"); + commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la peticion WIMS 2.0"); } void HTTPArithmeticServer::initialize () diff --git a/example/http/wims20XClient/main.cpp b/example/http/wims20XClient/main.cpp index 5c18cec..e18bec0 100644 --- a/example/http/wims20XClient/main.cpp +++ b/example/http/wims20XClient/main.cpp @@ -69,7 +69,7 @@ static const Millisecond Resolution(250); static const Millisecond Period(500); static const Millisecond OneSecond(1000); -class Sender : public timex::Clock { +class Sender : public anna::timex::Clock { public: Sender () : Clock ("Sender", Period), a_messageByTick (0), @@ -138,7 +138,7 @@ public: private: MyCommunicator a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; Sender a_sender; Server* a_server; http::wims20::ClientSide* a_request; diff --git a/example/http/xmlClient/main.cpp b/example/http/xmlClient/main.cpp index d8b92bf..149d1a8 100644 --- a/example/http/xmlClient/main.cpp +++ b/example/http/xmlClient/main.cpp @@ -68,7 +68,7 @@ static const Millisecond Resolution(250); static const Millisecond Period(500); static const Millisecond OneSecond(1000); -class Sender : public timex::Clock { +class Sender : public anna::timex::Clock { public: Sender (); @@ -142,7 +142,7 @@ public: private: MyCommunicator a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; Sender a_sender; Server* a_server; diff --git a/example/http/xmlSender/main.cpp b/example/http/xmlSender/main.cpp index 46b5d3c..ab5a6bb 100644 --- a/example/http/xmlSender/main.cpp +++ b/example/http/xmlSender/main.cpp @@ -134,14 +134,14 @@ IHTTPClient::IHTTPClient () : CommandLine& commandLine (CommandLine::instantiate ()); commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende respuestas."); - commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP Puerto en el que el servidor atiende respuestas."); + commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccion IP Puerto en el que el servidor atiende respuestas."); commandLine.add ("xml", CommandLine::Argument::Optional, "Documento XML que contiene la peticion"); commandLine.add ("nocheck", CommandLine::Argument::Optional, "Indicador para que no comprueba la validaded del HTML", false); commandLine.add ("version", CommandLine::Argument::Optional, "Indica la version HTTP usada para enviar"); commandLine.add ("uri", CommandLine::Argument::Optional, "URI a usar"); - commandLine.add ("m", CommandLine::Argument::Optional, "Método HTTP a usar"); + commandLine.add ("m", CommandLine::Argument::Optional, "Metodo HTTP a usar"); commandLine.add ("xmlresponse", CommandLine::Argument::Optional, "Visualiza la respuesta como un documento XML", false); - commandLine.add ("overquota", CommandLine::Argument::Optional, "Nº de bytes a recibir sin identificar el protocolo"); + commandLine.add ("overquota", CommandLine::Argument::Optional, "Numero de bytes a recibir sin identificar el protocolo"); commandLine.add ("c", CommandLine::Argument::Optional, "Valor de la cookie"); } @@ -213,7 +213,7 @@ void MyCommunicator::eventStartup () http::Method::Type::_v type = http::Method::Type::asEnum (cl.getValue ("m")); if (type == http::Method::Type::None) { - string msg ("Método HTTP no reconocido. "); + string msg ("Metodo HTTP no reconocido. "); msg += http::Method::Type::asList (); throw RuntimeException (msg, ANNA_FILE_LOCATION); } @@ -252,7 +252,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess void MyCommunicator::eventBreakConnection (Server* server) throw () { - cout << "Perdida conexión con " << server->asString () << endl; + cout << "Perdida conexion con " << server->asString () << endl; requestStop (); } diff --git a/example/io/reader/reader.cpp b/example/io/reader/reader.cpp index b563952..1a74092 100644 --- a/example/io/reader/reader.cpp +++ b/example/io/reader/reader.cpp @@ -75,13 +75,13 @@ int main (int argc, const char** argv) } Test::Test () : - app::Application ("testfunctions", "Comprobación del sistema io", "1.0") + app::Application ("testfunctions", "Comprobacion del sistema io", "1.0") { CommandLine& commandLine (CommandLine::instantiate ()); commandLine.add ("file", CommandLine::Argument::Mandatory, "Nombre del fichero a procesar"); commandLine.add ("mode", CommandLine::Argument::Mandatory, "Modo (binary|text)"); - commandLine.add ("size", CommandLine::Argument::Mandatory, "Tamaño del buffer de entrada"); + commandLine.add ("size", CommandLine::Argument::Mandatory, "Tamano del buffer de entrada"); } void Test::initialize () diff --git a/example/ldap/tSearch/main.cpp b/example/ldap/tSearch/main.cpp index 684dbe9..da47c79 100644 --- a/example/ldap/tSearch/main.cpp +++ b/example/ldap/tSearch/main.cpp @@ -113,7 +113,7 @@ public: private: MyCommunicator a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; MyEngine a_ldapEngine; Buddy a_buddy; Stopper a_stopper; @@ -159,7 +159,7 @@ LDAPClient::LDAPClient () : cl.add ("scope", CommandLine::Argument::Optional, "Ambito"); cl.add ("user", CommandLine::Argument::Optional, "Usuario"); cl.add ("password", CommandLine::Argument::Optional, "Password"); - cl.add ("d", CommandLine::Argument::Optional, "Nivel de depuración (all = activa todo)"); + cl.add ("d", CommandLine::Argument::Optional, "Nivel de depuracion (all = activa todo)"); } //----------------------------------------------------------------------------------------- diff --git a/example/timex/ArithmeticHTTPServer/Application.hpp b/example/timex/ArithmeticHTTPServer/Application.hpp index 5722d30..76ebf46 100644 --- a/example/timex/ArithmeticHTTPServer/Application.hpp +++ b/example/timex/ArithmeticHTTPServer/Application.hpp @@ -70,7 +70,7 @@ public: private: comm::Communicator* a_communicator; - timex::Engine a_timeController; + anna::timex::Engine a_timeController; http4comm::Context* a_context; comm::ReceiverFactoryImpl a_acceptorFactory; diff --git a/example/timex/ArithmeticHTTPServer/Context.cpp b/example/timex/ArithmeticHTTPServer/Context.cpp index e6a521f..2154043 100644 --- a/example/timex/ArithmeticHTTPServer/Context.cpp +++ b/example/timex/ArithmeticHTTPServer/Context.cpp @@ -48,14 +48,14 @@ using namespace std; using namespace anna; using namespace test; -http4comm::Context::Context (timex::Engine& timeController, const Millisecond& timeout) : - timex::Context ("http4comm", timeController, timeout) +http4comm::Context::Context (anna::timex::Engine& timeController, const Millisecond& timeout) : + anna::timex::Context ("http4comm", timeController, timeout) {;} void http4comm::Context::create (const S64 id, comm::ClientSocket& clientSocket) throw (RuntimeException) { - http4comm::Transaction* transaction = static_cast (timex::Context ::open (id, 0)); + http4comm::Transaction* transaction = static_cast (anna::timex::Context ::open (id, 0)); transaction->setClientSocket (&clientSocket); @@ -72,7 +72,7 @@ void http4comm::Context::create (const S64 id, comm::ClientSocket& clientSocket) * Si el fuera necesaria la instancia de una transación y no hay ninguna otra marcada como "no-usada" se * crearía una nueva instancia. */ -timex::Transaction* http4comm::Context::createTransaction (const int /*classType*/) +anna::timex::Transaction* http4comm::Context::createTransaction (const int /*classType*/) throw () { // Si nuestra aplicación tratara más de un tipo de transación tendríamos que obtenerla de @@ -83,7 +83,7 @@ timex::Transaction* http4comm::Context::createTransaction (const int /*classType /** * Cuando la instancia dela transación no se esté usando se marca como no-usada. */ -void http4comm::Context::releaseTransaction (timex::Transaction* tt) +void http4comm::Context::releaseTransaction (anna::timex::Transaction* tt) throw () { // Si nuestra aplicación tratata más de un tipo tendríamos que obtener el tipo diff --git a/example/timex/ArithmeticHTTPServer/Context.hpp b/example/timex/ArithmeticHTTPServer/Context.hpp index 8d719e1..830470d 100644 --- a/example/timex/ArithmeticHTTPServer/Context.hpp +++ b/example/timex/ArithmeticHTTPServer/Context.hpp @@ -53,9 +53,9 @@ class Transaction; using namespace anna; -class Context : public timex::Context { +class Context : public anna::timex::Context { public: - Context (timex::Engine&, const Millisecond& timeout); + Context (anna::timex::Engine&, const Millisecond& timeout); void create (const S64 id, comm::ClientSocket&) throw (RuntimeException); void destroy (Transaction*) throw (); @@ -63,8 +63,8 @@ public: private: Recycler a_transactions; - timex::Transaction* createTransaction (const int /*classType*/) throw (); - void releaseTransaction (timex::Transaction* tt) throw (); + anna::timex::Transaction* createTransaction (const int /*classType*/) throw (); + void releaseTransaction (anna::timex::Transaction* tt) throw (); std::string identifierAsString (const S64&) const throw (); const S64& contextAsIdentifier (const void*) const throw (); diff --git a/example/timex/ArithmeticHTTPServer/Transaction.cpp b/example/timex/ArithmeticHTTPServer/Transaction.cpp index 2c7a770..78e97a8 100644 --- a/example/timex/ArithmeticHTTPServer/Transaction.cpp +++ b/example/timex/ArithmeticHTTPServer/Transaction.cpp @@ -57,7 +57,7 @@ http4comm::Transaction::Transaction () : * Si el servidor aritmético no contesta antes de que se cumpla el tiempo de espera * de la transación se contesta al cliente con un error indicando la situación. */ -void http4comm::Transaction::expire (timex::Engine*) +void http4comm::Transaction::expire (anna::timex::Engine*) throw (RuntimeException) { comm::Communicator* communicator = app::functions::component (ANNA_FILE_LOCATION); diff --git a/example/timex/ArithmeticHTTPServer/Transaction.hpp b/example/timex/ArithmeticHTTPServer/Transaction.hpp index bb301ad..fbaa9c2 100644 --- a/example/timex/ArithmeticHTTPServer/Transaction.hpp +++ b/example/timex/ArithmeticHTTPServer/Transaction.hpp @@ -54,7 +54,7 @@ namespace http4comm { using namespace anna; -class Transaction : public timex::Transaction { +class Transaction : public anna::timex::Transaction { public: Transaction (); @@ -66,7 +66,7 @@ private: comm::ClientSocket* a_clientSocket; http::Response* a_httpResponse; - void expire (timex::Engine*) throw (RuntimeException); + void expire (anna::timex::Engine*) throw (RuntimeException); }; } diff --git a/include/anna/config/defines.hpp b/include/anna/config/defines.hpp index 9eae359..c8ff931 100644 --- a/include/anna/config/defines.hpp +++ b/include/anna/config/defines.hpp @@ -74,7 +74,7 @@ #define anna_strchr(a,b) strchr((a),(b)) #endif -#define anna_signal_shield(r,a) { register int cx (0); do { if ((r = (a)) < 0) cx ++; } while (r < 0 && errno == EINTR && cx < 5); } +#define anna_signal_shield(r,a) { int cx (0); do { if ((r = (a)) < 0) cx ++; } while (r < 0 && errno == EINTR && cx < 5); } //#define anna_append_string(str,str1,str2) (str).append (str1).append (str2) diff --git a/include/anna/core/define.autoenum.hpp b/include/anna/core/define.autoenum.hpp index ebc404c..ab10e70 100644 --- a/include/anna/core/define.autoenum.hpp +++ b/include/anna/core/define.autoenum.hpp @@ -105,7 +105,7 @@ static const char* asNotNullCString (const _v v) throw () { return (v != None) ? literal [v]: ""; } \ static std::string asList () throw () {\ std::string result;\ - for (register int ii = 0; literal [ii] != NULL; ii ++) { \ + for (int ii = 0; literal [ii] != NULL; ii ++) { \ if (ii == 0 && strcmp (literal [ii], "None") == 0) continue; \ if (ii > 1) result += ' '; \ result += "'"; result += literal [ii]; result += "'"; \ diff --git a/include/anna/core/functions.hpp b/include/anna/core/functions.hpp index f8d0680..164417b 100644 --- a/include/anna/core/functions.hpp +++ b/include/anna/core/functions.hpp @@ -517,7 +517,7 @@ struct functions { * \return el número de bits necesarios para representar el valor recibido como parámetro. */ static int bitsize(const S64 n) throw() { - register int aux = n >> intBitSize; + int aux = n >> intBitSize; return (aux != 0) ? (bitsize(aux) + intBitSize) : bitsize((int) n); } diff --git a/include/anna/core/oam/Module.hpp b/include/anna/core/oam/Module.hpp index 28e30e5..032c3a3 100644 --- a/include/anna/core/oam/Module.hpp +++ b/include/anna/core/oam/Module.hpp @@ -472,7 +472,7 @@ public: * @param alarmType Alarm enum-identification within the own context/module * @param ... Optional parsing data for dynamic-composed text. */ - void activateAlarm(const int & type, ...) const throw(anna::RuntimeException); + void activateAlarm(int type, ...) const throw(anna::RuntimeException); /** @@ -482,7 +482,7 @@ public: * @param alarmType Alarm enum-identification within the own context/module * @param ... Optional parsing data for dynamic-composed text. */ - void cancelAlarm(const int & type, ...) const throw(anna::RuntimeException); + void cancelAlarm(int type, ...) const throw(anna::RuntimeException); /** diff --git a/include/anna/dbos/StorageArea.hpp b/include/anna/dbos/StorageArea.hpp index 077da2a..41eb737 100644 --- a/include/anna/dbos/StorageArea.hpp +++ b/include/anna/dbos/StorageArea.hpp @@ -545,8 +545,6 @@ protected: private: typedef std::map ::value_type value_type; - struct Instance; - friend class Holes; class Holes { diff --git a/include/anna/diameter/stack/Command.hpp b/include/anna/diameter/stack/Command.hpp index 5bf6d7b..f09981f 100644 --- a/include/anna/diameter/stack/Command.hpp +++ b/include/anna/diameter/stack/Command.hpp @@ -136,7 +136,6 @@ public: // set void initialize(const Dictionary *d = NULL) throw() { _initialize(d); } void setCode(const U24 & c) throw(anna::RuntimeException) { - if(c < 0) throw anna::RuntimeException("Negative command-code not allowed", ANNA_FILE_LOCATION); a_id.first = c; } diff --git a/include/anna/test/clang_specific.hpp b/include/anna/test/clang_specific.hpp new file mode 100644 index 0000000..24d32cf --- /dev/null +++ b/include/anna/test/clang_specific.hpp @@ -0,0 +1,18 @@ +// This is a Workaround for clang +// See more at: http://reviews.llvm.org/rL201729 and http://gcc.gnu.org/gcc-4.9/porting_to.html (cstddef changes) +// This file and its references should be removed when upgraded clang resources + +#ifndef anna_test_Request_hpp +#define anna_test_Request_hpp + +#if IS_CLANG && ( __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L ) +typedef struct { + long long __clang_max_align_nonce1 + __attribute__((__aligned__(__alignof__(long long)))); + long double __clang_max_align_nonce2 + __attribute__((__aligned__(__alignof__(long double)))); +} max_align_t; +#define __CLANG_MAX_ALIGN_T_DEFINED +#endif + +#endif diff --git a/source/comm/Communicator.cpp b/source/comm/Communicator.cpp index 07cb224..061c59b 100644 --- a/source/comm/Communicator.cpp +++ b/source/comm/Communicator.cpp @@ -451,6 +451,7 @@ throw(RuntimeException) { case Handler::Type::Custom: result = NULL; break; + default: break; } } diff --git a/source/comm/CompatCodec.cpp b/source/comm/CompatCodec.cpp index 4664cba..600d9e1 100644 --- a/source/comm/CompatCodec.cpp +++ b/source/comm/CompatCodec.cpp @@ -199,17 +199,11 @@ throw(RuntimeException) { if(variable == NULL) throw RuntimeException(functions::asString("Id %d is not defined", id), ANNA_FILE_LOCATION); - switch(variable->isNull()) { - case true: - + if(variable->isNull()) { if(isNull == false) a_nullCounter --; - - break; - case false: - + } + else { if(isNull == true) a_nullCounter ++; - - break; } variable->setNull(isNull); @@ -217,17 +211,11 @@ throw(RuntimeException) { void comm::CompatCodec::setNull(const comm::Variable* variable, const bool isNull) throw() { - switch(variable->isNull()) { - case true: - + if(variable->isNull()) { if(isNull == false) a_nullCounter --; - - break; - case false: - + } + else { if(isNull == true) a_nullCounter ++; - - break; } const_cast (variable)->setNull(isNull); @@ -281,10 +269,10 @@ throw(RuntimeException) { //----------------------------------------------------------------------- const DataBlock& comm::CompatCodec::code() throw(RuntimeException) { - register unsigned char c(0); + unsigned char c(0); iterator ii; iterator maxii(a_variables.end()); - register Variable* variable; + Variable* variable; int stringLen; const char* string; char aux [sizeof(S64)]; @@ -349,6 +337,7 @@ throw(RuntimeException) { self += codec; } break; + default: break; } } @@ -364,7 +353,7 @@ throw(RuntimeException) { char* data = const_cast (self.getData()); int size = self.getSize(); - for(register int i = 1, key = data [0]; i < size; i ++) + for(int i = 1, key = data [0]; i < size; i ++) data [i] ^= key ++; } @@ -381,7 +370,7 @@ throw(RuntimeException) { throw RuntimeException("Can not decode an empty DataBlock", ANNA_FILE_LOCATION); if(data [0] != 0) - for(register int i = 1, key(data [0]); i < size; i ++) + for(int i = 1, key(data [0]); i < size; i ++) const_cast (data)[i] ^= key ++; LOGDEBUG(Logger::write(Logger::Debug, "comm::CompatCodec::decode", dataBlock, ANNA_FILE_LOCATION)); @@ -586,7 +575,7 @@ throw() { comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) throw() { - for(register int ii = 0; ii < a_size; ii ++) { + for(int ii = 0; ii < a_size; ii ++) { if(a_variables [ii]->getId() == id) return a_variables [ii]; } @@ -596,7 +585,7 @@ throw() { const comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) const throw() { - for(register int ii = 0; ii < a_size; ii ++) { + for(int ii = 0; ii < a_size; ii ++) { if(a_variables [ii]->getId() == id) return a_variables [ii]; } diff --git a/source/comm/handler/Manager.cpp b/source/comm/handler/Manager.cpp index f4092c1..0e916d6 100644 --- a/source/comm/handler/Manager.cpp +++ b/source/comm/handler/Manager.cpp @@ -124,5 +124,6 @@ throw() { case Handler::Type::ClientSocket: a_clientSockets.release(static_cast (handler)); break; + default: break; } } diff --git a/source/core/DataBlock.cpp b/source/core/DataBlock.cpp index e7e00e1..936b8e3 100644 --- a/source/core/DataBlock.cpp +++ b/source/core/DataBlock.cpp @@ -185,7 +185,7 @@ throw(RuntimeException) { if((a_size + len) >= a_maxSize) extend(len); - register char* w = a_buffer + a_size; + char* w = a_buffer + a_size; switch(len) { case 0: break; diff --git a/source/core/functions.cpp b/source/core/functions.cpp index b007966..a23a0d1 100644 --- a/source/core/functions.cpp +++ b/source/core/functions.cpp @@ -277,7 +277,7 @@ throw(RuntimeException) { int aux; int j = 0; - for(register int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) { + for(int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) { if(isxdigit(aux = src [ii - 1]) == 0) throw RuntimeException("Invalid HexString", ANNA_FILE_LOCATION); @@ -450,7 +450,7 @@ throw() { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; int r = -1; // r will be lg(v) - register unsigned int t, tt; // temporaries + unsigned int t, tt; // temporaries if(tt = v >> 16) { r = (t = tt >> 8) ? 24 + LogTable256[t] : 16 + LogTable256[tt]; @@ -488,7 +488,7 @@ std::string functions::justify(const std::string & title, TextJustifyMode::_v mo } if((mode == TextJustifyMode::Right) || (mode == TextJustifyMode::Center)) { - for(register int k = 0; k < (repeat + (adjust ? 1 : 0)); k++) result += filler; + for(int k = 0; k < (repeat + (adjust ? 1 : 0)); k++) result += filler; result += " "; } @@ -498,7 +498,7 @@ std::string functions::justify(const std::string & title, TextJustifyMode::_v mo if((mode == TextJustifyMode::Left) || (mode == TextJustifyMode::Center)) { result += " "; - for(register int k = 0; k < repeat; k++) result += filler; + for(int k = 0; k < repeat; k++) result += filler; } return result; @@ -517,13 +517,13 @@ std::string functions::highlight(const std::string & title, TextHighlightMode::_ } if((mode == TextHighlightMode::Leftline) || (mode == TextHighlightMode::LeftAndRightline)) { - for(register int k = 0; k < (lr_repeat + (adjust ? 1 : 0)); k++) result += filler; + for(int k = 0; k < (lr_repeat + (adjust ? 1 : 0)); k++) result += filler; result += " "; } if((mode == TextHighlightMode::Overline) || (mode == TextHighlightMode::OverAndUnderline)) { - for(register int k = 0; k < ou_repeat; k++) result += filler; + for(int k = 0; k < ou_repeat; k++) result += filler; result += "\n"; } @@ -533,13 +533,13 @@ std::string functions::highlight(const std::string & title, TextHighlightMode::_ if((mode == TextHighlightMode::Underline) || (mode == TextHighlightMode::OverAndUnderline)) { result += "\n"; - for(register int k = 0; k < ou_repeat; k++) result += filler; + for(int k = 0; k < ou_repeat; k++) result += filler; } if((mode == TextHighlightMode::Rightline) || (mode == TextHighlightMode::LeftAndRightline)) { result += " "; - for(register int k = 0; k < lr_repeat; k++) result += filler; + for(int k = 0; k < lr_repeat; k++) result += filler; } if(appendCR) result += "\n"; @@ -553,7 +553,7 @@ std::string functions::tab(const std::string & text, int tabSpaces) throw() { size_t pos, from = 0; std::string tab, crTab = "\n"; - for(register int k = 0; k < tabSpaces; k++) tab += " "; + for(int k = 0; k < tabSpaces; k++) tab += " "; crTab += tab; result = tab; @@ -699,7 +699,7 @@ std::string functions::asAsciiString(const char * buffer, int size, bool & isFul return result; } - for(register int k = 0; k < size; k ++) { + for(int k = 0; k < size; k ++) { unsigned char c = (unsigned char) buffer [k]; int printable = isprint(c); result += (printable ? (char) c : '.'); @@ -780,7 +780,7 @@ anna::DataBlock functions::rawIpPresentationAsRaw(const std::string & rawPresent char rByte[3]; // readable byte rByte[2] = 0; - for(register int k = 0; k < length; k += 2) { + for(int k = 0; k < length; k += 2) { rByte[0] = rawPresentation[k]; rByte[1] = rawPresentation[k + 1]; sscanf(rByte, "%x", &byte); @@ -802,7 +802,7 @@ std::string functions::rawIpAsRawIpPresentation(const anna::DataBlock & db) thro char rByte[3]; // readable byte rByte[2] = 0; - for(register int k = 0; k < length; k++) { + for(int k = 0; k < length; k++) { byte = (unsigned char)db[k]; sprintf(rByte, "%.2X", byte); result += rByte; @@ -864,7 +864,7 @@ bool functions::isIPv4(const std::string & ip, IPv4Type::_v ipv4Type) throw() { // La expresión regular no controla si hay mas de 3 puntos: int n_dot = 0; - for(register int k = 0; k < ip.length(); k++) + for(int k = 0; k < ip.length(); k++) if(ip[k] == '.') n_dot++; if(n_dot > 3) @@ -911,7 +911,7 @@ bool functions::isIPv4(const std::string & ip, IPv4Type::_v ipv4Type) throw() { bool functions::isIPv6(const std::string & ip) throw() { // Chequeo de digitos permitidos: - for(register int k = 0; k < ip.length(); k++) { + for(int k = 0; k < ip.length(); k++) { bool digit = isdigit(ip[k]); bool hex = ((ip[k] == 'a') || (ip[k] == 'b') || @@ -965,7 +965,7 @@ std::string functions::IPv4To6(const std::string & ip) throw(anna::RuntimeExcept // Number of ocurrences for '.' int n_dot = 0; - for(register int k = 0; k < pureIPv4.length(); k++) + for(int k = 0; k < pureIPv4.length(); k++) if(pureIPv4[k] == '.') n_dot++; if(n_dot > 3) @@ -1016,13 +1016,13 @@ std::string functions::normalizeIP(const std::string & ip) throw(anna::RuntimeEx // Number of ocurrences for ':' int n_colon = 0; - for(register int k = 0; k < result.length(); k++) + for(int k = 0; k < result.length(); k++) if(result[k] == ':') n_colon++; // Generate equivalent to '::' std::string equiv_str; - for(register int k = 0; k < (8 - n_colon); k++) + for(int k = 0; k < (8 - n_colon); k++) equiv_str += ":0"; equiv_str += ":"; @@ -1043,7 +1043,7 @@ std::string functions::normalizeIP(const std::string & ip) throw(anna::RuntimeEx // Protection: it must be seven colons: int n_colon = 0; - for(register int k = 0; k < result.length(); k++) + for(int k = 0; k < result.length(); k++) if(result[k] == ':') n_colon++; if(n_colon != 7) @@ -1070,7 +1070,7 @@ std::string functions::normalizeIP(const std::string & ip) throw(anna::RuntimeEx result.erase(lastPos, 1); // Chequeo de digitos permitidos: - for(register int k = 0; k < result.length(); k++) { + for(int k = 0; k < result.length(); k++) { bool digit = isdigit(result[k]); bool hex = ((result[k] == 'a') || (result[k] == 'b') || @@ -1342,7 +1342,7 @@ throw() { const char* functions::codeInteger(char* result, const int n) throw() { int aux(htonl(n)); - register char* w((char*) &aux); + char* w((char*) &aux); *result = *w; *(result + 1) = *(w + 1); *(result + 2) = *(w + 2); @@ -1353,7 +1353,7 @@ throw() { const char* functions::codeShort(char* result, const short int n) throw() { short int aux(htons(n)); - register char* w((char*) &aux); + char* w((char*) &aux); *result = *w; *(result + 1) = *(w + 1); return result; @@ -1391,7 +1391,7 @@ throw() { int functions::decodeInteger(const char* data) throw() { int result; - register char* w((char*) &result); + char* w((char*) &result); *w = *data; *(w + 1) = *(data + 1); *(w + 2) = *(data + 2); @@ -1402,7 +1402,7 @@ throw() { short int functions::decodeShort(const char* data) throw() { short int result; - register char* w((char*) &result); + char* w((char*) &result); *w = *data; *(w + 1) = *(data + 1); return ntohs(result); @@ -1459,7 +1459,7 @@ void functions::decodeIsupNumber(const char *buffer, int length, isup_number_t & isupNumber.Digits = ""; int byte; - for(register int k = 2; k < length; k ++) { + for(int k = 2; k < length; k ++) { byte = (buffer [k] & 0x0f); isupNumber.Digits += (byte >= 0 && byte <= 9) ? (byte + '0') : ((byte - 0xa) + 'a'); byte = (buffer [k] & 0xf0) >> 4; @@ -1538,7 +1538,7 @@ void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCa //std::transform(dtlc.begin(), dtlc.end(), dtlc.begin(), std::tolower); const char *digits = dtlc.c_str(); - for(register int k = 1; k < isupNumber.Digits.size(); k += 2) { + for(int k = 1; k < isupNumber.Digits.size(); k += 2) { if(isxdigit(byte = digits [k - 1]) == 0) throw anna::RuntimeException("functions::codeIsupNumber | Isup number 'Digits' field contains invalid digits (non hexadecimal)", ANNA_FILE_LOCATION); diff --git a/source/core/mt/ThreadManager.cpp b/source/core/mt/ThreadManager.cpp index 96cdac7..6232bf5 100644 --- a/source/core/mt/ThreadManager.cpp +++ b/source/core/mt/ThreadManager.cpp @@ -148,6 +148,7 @@ throw(RuntimeException) { result = Recycler ::create(); break; + default: break; } result->a_manager = this; diff --git a/source/core/oam/Module.cpp b/source/core/oam/Module.cpp index 742b7e0..f0fad25 100644 --- a/source/core/oam/Module.cpp +++ b/source/core/oam/Module.cpp @@ -418,7 +418,7 @@ void anna::oam::Module::alarmEvent(bool activation, const int & type, va_list ar //------------------------------------------------------------------------------ //------------------------------------------------------ Module::activateAlarm() //------------------------------------------------------------------------------ -void anna::oam::Module::activateAlarm(const int & type, ...) const throw(anna::RuntimeException) { +void anna::oam::Module::activateAlarm(int type, ...) const throw(anna::RuntimeException) { // LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "activateAlarm", ANNA_FILE_LOCATION)); // Checkings @@ -444,7 +444,7 @@ void anna::oam::Module::activateAlarm(const int & type, ...) const throw(anna::R //------------------------------------------------------------------------------ //-------------------------------------------------------- Module::cancelAlarm() //------------------------------------------------------------------------------ -void anna::oam::Module::cancelAlarm(const int & type, ...) const throw(anna::RuntimeException) { +void anna::oam::Module::cancelAlarm(int type, ...) const throw(anna::RuntimeException) { // LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "cancelAlarm", ANNA_FILE_LOCATION)); // Checkings @@ -547,7 +547,7 @@ void anna::oam::Module::recordCounters() throw(anna::RuntimeException) { Guard csGuard(cscope, "oam::CounterScope from oam::Module::record"); - for(register int icounter = 0; icounter < CounterScope::MaxCounter; icounter ++) { + for(int icounter = 0; icounter < CounterScope::MaxCounter; icounter ++) { Counter* counter = cscope->a_counters [icounter]; if(counter == NULL) diff --git a/source/core/util/MultiRangeExpression.cpp b/source/core/util/MultiRangeExpression.cpp index be9ffac..75ca563 100644 --- a/source/core/util/MultiRangeExpression.cpp +++ b/source/core/util/MultiRangeExpression.cpp @@ -78,7 +78,7 @@ void anna::MultiRangeExpression::refresh(void) throw() { } // Update a_data: - for(register unsigned int k = min; k <= max; k++) { + for(unsigned int k = min; k <= max; k++) { a_data[k] = 0; if(k == UINT_MAX/* overflow */) break; diff --git a/source/core/util/TextVariable.cpp b/source/core/util/TextVariable.cpp index 7b16f26..b6ba936 100644 --- a/source/core/util/TextVariable.cpp +++ b/source/core/util/TextVariable.cpp @@ -66,6 +66,7 @@ throw(RuntimeException) { buffer.allocate(a_expression.length() + 32); sprintf((char*) buffer.getData(), a_expression.c_str(), getFloatValue()); break; + default: break; } return buffer.getData(); diff --git a/source/core/util/Variable.cpp b/source/core/util/Variable.cpp index d438868..9f45178 100644 --- a/source/core/util/Variable.cpp +++ b/source/core/util/Variable.cpp @@ -60,6 +60,7 @@ Variable::Variable(const char* name, const Type::_v type) : case Type::Float: a_value.a_float = &a_aux.theFloat; break; case Type::Double: a_value.a_double = &a_aux.theDouble; break; case Type::Custom: a_value.a_custom = NULL; break; + default: break; } } @@ -76,6 +77,7 @@ Variable::~Variable() { delete a_value.a_dataBlock; a_value.a_dataBlock = NULL; break; + default: break; } } @@ -171,6 +173,7 @@ throw(RuntimeException) { switch(a_type) { case Type::Integer: result = *a_value.a_integer; break; case Type::Integer64: result = *a_value.a_longInteger; break; + default: break; } return result; @@ -199,6 +202,7 @@ throw(RuntimeException) { switch(a_type) { case Type::Float: result = *a_value.a_float; break; case Type::Double: result = (float) *a_value.a_double; break; + default: break; } return result; @@ -213,6 +217,7 @@ throw(RuntimeException) { switch(a_type) { case Type::Float: result = (double) *a_value.a_float; break; case Type::Double: result = *a_value.a_double; break; + default: break; } return result; @@ -237,6 +242,7 @@ throw() { case Type::Float: result += functions::asString("%f", *a_value.a_float); break; case Type::Double: result += functions::asString("%g", *a_value.a_double); break; case Type::Custom: result += functions::asHexString(anna_ptrnumber_cast(a_value.a_custom)); break; + default: break; } } @@ -256,6 +262,7 @@ throw() { case Type::Float: result = a_value.a_float; break; case Type::Double: result = a_value.a_double; break; case Type::Custom: result = a_value.a_custom; break; + default: break; } return result; @@ -274,6 +281,7 @@ throw() { case Type::Float: result = a_value.a_float; break; case Type::Double: result = a_value.a_double; break; case Type::Custom: result = a_value.a_custom; break; + default: break; } return result; diff --git a/source/core/util/ZBlock.cpp b/source/core/util/ZBlock.cpp index dc6f10f..b05c9cc 100644 --- a/source/core/util/ZBlock.cpp +++ b/source/core/util/ZBlock.cpp @@ -70,7 +70,7 @@ throw(RuntimeException) { DataBlock::allocate(maxSize); char* buffer = (char*) DataBlock::getData(); int aux = htonl(originalSize); - register char* w((char*) &aux); + char* w((char*) &aux); /* Establece el tamaño original del buffer */ buffer [0] = *w; buffer [1] = *(w + 1); @@ -109,7 +109,7 @@ throw(RuntimeException) { char* buffer = (char*) zdata.getData(); int aux; uLong size; - register char* w((char*) &aux); + char* w((char*) &aux); *w = *buffer; *(w + 1) = *(buffer + 1); *(w + 2) = *(buffer + 2); diff --git a/source/dbms.mysql/BaseBind.cpp b/source/dbms.mysql/BaseBind.cpp index 33bc435..3f83ded 100644 --- a/source/dbms.mysql/BaseBind.cpp +++ b/source/dbms.mysql/BaseBind.cpp @@ -60,6 +60,7 @@ dbms::mysql::BaseBind::BaseBind(const dbms::Data& data) : case Data::Type::TimeStamp: a_time = new MYSQL_TIME; break; + default: break; } } diff --git a/source/dbms.oracle/BaseBind.cpp b/source/dbms.oracle/BaseBind.cpp index 05a7245..486390d 100644 --- a/source/dbms.oracle/BaseBind.cpp +++ b/source/dbms.oracle/BaseBind.cpp @@ -67,6 +67,7 @@ dbms::oracle::BaseBind::BaseBind(const dbms::Data& data) : a_ofb = new anna::DataBlock(true); a_ofb->allocate(2048); // (1) break; + default: break; } } diff --git a/source/dbms.oracle/InputBind.cpp b/source/dbms.oracle/InputBind.cpp index 66b4285..0a703be 100644 --- a/source/dbms.oracle/InputBind.cpp +++ b/source/dbms.oracle/InputBind.cpp @@ -187,9 +187,9 @@ throw() { char* dest = const_cast (a_ofb->getData()); - register int j = 0; + int j = 0; - for(register int i = 0; i < length; i ++) { + for(int i = 0; i < length; i ++) { dest [j ++] = asCharacter((src [i] & 0xf0) >> 4); dest [j ++] = asCharacter(src [i] & 0x0f); } diff --git a/source/dbms.oracle/OutputBind.cpp b/source/dbms.oracle/OutputBind.cpp index 490e31d..a6946ab 100644 --- a/source/dbms.oracle/OutputBind.cpp +++ b/source/dbms.oracle/OutputBind.cpp @@ -192,7 +192,7 @@ throw(RuntimeException) { int j = 0; - for(register int i = 1; i < a_length; i += 2, j ++) { + for(int i = 1; i < a_length; i += 2, j ++) { hex = asByte(src [i - 1]) << 4; hex |= asByte(src [i]); dest [j] = hex; diff --git a/source/dbms/Delivery.cpp b/source/dbms/Delivery.cpp index 8e4cccb..ab4bcf8 100644 --- a/source/dbms/Delivery.cpp +++ b/source/dbms/Delivery.cpp @@ -80,7 +80,6 @@ throw(RuntimeException) { do { w = connection(a_iiConnection); - a_iiConnection; if(a_iiConnection == maxii) a_iiConnection = begin(); diff --git a/source/dbms/String.cpp b/source/dbms/String.cpp index 9983d10..b02a3e0 100644 --- a/source/dbms/String.cpp +++ b/source/dbms/String.cpp @@ -76,7 +76,7 @@ throw() { if(str == NULL || (len = anna_strlen(str)) == 0) return str; - register int end = len - 1; + int end = len - 1; while(end >= 0 && str [end] == ' ') end --; diff --git a/source/dbos/StorageArea.cpp b/source/dbos/StorageArea.cpp index 7754637..ded13e8 100644 --- a/source/dbos/StorageArea.cpp +++ b/source/dbos/StorageArea.cpp @@ -996,7 +996,7 @@ StorageArea::Block::Block(ObjectAllocator objectAllocator, const Size maxSize) : a_maxSize = std::min(8U, std::max(256U, maxSize >> 7)); a_instances = new Instance [a_maxSize]; - for(register int i = 0; i < a_maxSize; i ++) + for(int i = 0; i < a_maxSize; i ++) a_instances [i].object = (*objectAllocator)(); } diff --git a/source/diameter.comm/Engine.cpp b/source/diameter.comm/Engine.cpp index 266b57a..b6f0b55 100644 --- a/source/diameter.comm/Engine.cpp +++ b/source/diameter.comm/Engine.cpp @@ -254,7 +254,7 @@ throw(anna::RuntimeException) { result->a_engine = this; result->initializeStatisticConcepts(); - for(register int k = 0; k < a_numberOfClientSessionsPerServer; k++) + for(int k = 0; k < a_numberOfClientSessionsPerServer; k++) result->addClientSession(k); a_servers.insert(server_value_type(socket, result)); diff --git a/source/diameter.comm/Entity.cpp b/source/diameter.comm/Entity.cpp index e068ba8..dce01c7 100644 --- a/source/diameter.comm/Entity.cpp +++ b/source/diameter.comm/Entity.cpp @@ -165,7 +165,7 @@ bool Entity::send(const Message* message, bool balance) throw(anna::RuntimeExcep // Balance if(balance) { - for(register int k = 0; k < getMaxServers(); k++) { // try round-robin only over one cycle, + for(int k = 0; k < getMaxServers(); k++) { // try round-robin only over one cycle, // no matter where you are: don't repeat same server if(a_deliveryIterator == end()) a_deliveryIterator = begin(); diff --git a/source/diameter.comm/Server.cpp b/source/diameter.comm/Server.cpp index 4e9a1fd..43a3b28 100644 --- a/source/diameter.comm/Server.cpp +++ b/source/diameter.comm/Server.cpp @@ -140,7 +140,7 @@ bool Server::send(const Message* message, int socketId) throw(anna::RuntimeExcep bool fixedSocket = (socketId != -1); int clientSessions = getNumberOfClientSessions(); - for(register int k = 0; k < clientSessions; k++) { // try round-robin only over one cycle, + for(int k = 0; k < clientSessions; k++) { // try round-robin only over one cycle, // no matter where you are: don't repeat same socket if(fixedSocket) a_lastUsedResource = a_engine->findClientSession(a_socket.first /*ip*/, a_socket.second /*port*/, socketId); // exception if not found diff --git a/source/diameter/codec/Avp.cpp b/source/diameter/codec/Avp.cpp index e392268..19a0780 100644 --- a/source/diameter/codec/Avp.cpp +++ b/source/diameter/codec/Avp.cpp @@ -927,7 +927,7 @@ bool Avp::validLevel(const avp_container &avps, anna::diameter::stack::const_avp } avp_it++; - // (*) for (register int k = 0; k < (*rule_it).second.getQualMax(); k++) avp_it++ + // (*) for (int k = 0; k < (*rule_it).second.getQualMax(); k++) avp_it++ } else okFixed = false; diff --git a/source/diameter/codec/Message.cpp b/source/diameter/codec/Message.cpp index e0179a3..9deaf2e 100644 --- a/source/diameter/codec/Message.cpp +++ b/source/diameter/codec/Message.cpp @@ -811,11 +811,13 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc // Application-id u_aux = appid->getIntegerValue(); + /* if(u_aux < 0) { std::string msg = "Error processing command getValue(); msg += "': negative values are not allowed"; throw anna::RuntimeException(msg, ANNA_FILE_LOCATION); } + */ setApplicationId(u_aux); @@ -823,11 +825,13 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc if(hbh) { u_aux = hbh->getIntegerValue(); + /* if(u_aux < 0) { std::string msg = "Error processing command getValue(); msg += "': negative values are not allowed"; throw anna::RuntimeException(msg, ANNA_FILE_LOCATION); } + */ } else u_aux = 0; setHopByHop(u_aux); @@ -836,11 +840,13 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc if(ete) { u_aux = ete->getIntegerValue(); + /* if(u_aux < 0) { std::string msg = "Error processing command getValue(); msg += "': negative values are not allowed"; throw anna::RuntimeException(msg, ANNA_FILE_LOCATION); } + */ } else u_aux = 0; setEndToEnd(u_aux); diff --git a/source/diameter/stack/Avp.cpp b/source/diameter/stack/Avp.cpp index 502745a..d3d971d 100644 --- a/source/diameter/stack/Avp.cpp +++ b/source/diameter/stack/Avp.cpp @@ -184,7 +184,7 @@ std::string anna::diameter::stack::Avp::asString() const throw() { std::string qual = (*it).second.getQual(); int NumberOfSpaces = strlen(DICTIONARY_AVPRULE_TAB) - qual.size(); - for(register int k = 0; k < NumberOfSpaces; k++) trace += " "; + for(int k = 0; k < NumberOfSpaces; k++) trace += " "; trace += (*it).second.asString(); trace += "\n"; diff --git a/source/diameter/stack/AvpRule.cpp b/source/diameter/stack/AvpRule.cpp index b2c5721..2b282cc 100644 --- a/source/diameter/stack/AvpRule.cpp +++ b/source/diameter/stack/AvpRule.cpp @@ -159,7 +159,7 @@ std::string anna::diameter::stack::AvpRule::asString(bool showPair) const throw( /* max expected avp description size */ 48 - /* current trace length */ trace.size(); - for(register int k = 0; k < NumberOfDots; k++) trace += "."; + for(int k = 0; k < NumberOfDots; k++) trace += "."; trace += anna::diameter::functions::avpIdAsPairString(avp->getId()); } diff --git a/source/diameter/stack/Command.cpp b/source/diameter/stack/Command.cpp index f104410..69bfd2f 100644 --- a/source/diameter/stack/Command.cpp +++ b/source/diameter/stack/Command.cpp @@ -103,7 +103,7 @@ std::string anna::diameter::stack::Command::asString(void) const throw() { std::string qual = (*it).second.getQual(); int NumberOfSpaces = strlen(DICTIONARY_AVPRULE_TAB) - qual.size(); - for(register int k = 0; k < NumberOfSpaces; k++) trace += " "; + for(int k = 0; k < NumberOfSpaces; k++) trace += " "; trace += (*it).second.asString(); trace += "\n"; diff --git a/source/diameter/stack/Dictionary.cpp b/source/diameter/stack/Dictionary.cpp index f415fbf..0d48b5d 100644 --- a/source/diameter/stack/Dictionary.cpp +++ b/source/diameter/stack/Dictionary.cpp @@ -157,9 +157,8 @@ void Dictionary::addFormat(const Format & format, bool reserved) throw(anna::Run throw anna::RuntimeException(s_ex, ANNA_FILE_LOCATION); } - const Format * found; - - if(found = getFormat(format.getName())) { + const Format * found = getFormat(format.getName()); + if(found) { if(!a_allowUpdates) { std::string s_ex = "Cannot add a format with an existing type name: "; //s_ex += format.getName(); @@ -186,9 +185,9 @@ void Dictionary::addFormat(const Format & format, bool reserved) throw(anna::Run //------------------------------------------------------ Dictionary::addVendor() //------------------------------------------------------------------------------ void Dictionary::addVendor(const Vendor & vendor) throw(anna::RuntimeException) { - const Vendor * found; - if(found = getVendor(vendor.getId())) { + const Vendor * found = getVendor(vendor.getId()); + if(found) { if(!a_allowUpdates) { std::string s_ex = "Cannot add a vendor with an existing code: "; s_ex += vendor.asString(); @@ -198,7 +197,8 @@ void Dictionary::addVendor(const Vendor & vendor) throw(anna::RuntimeException) ITEM_OVERWRITE("vendor", vendor, a_vendors, a_vendorNames); } - if(found = getVendor(vendor.getName())) { + found = getVendor(vendor.getName()); + if(found) { if(!a_allowUpdates) { std::string s_ex = "Cannot add a vendor with an existing name: "; s_ex += vendor.asString(); @@ -217,9 +217,9 @@ void Dictionary::addVendor(const Vendor & vendor) throw(anna::RuntimeException) //--------------------------------------------------------- Dictionary::addAvp() //------------------------------------------------------------------------------ void Dictionary::addAvp(const Avp & avp) throw(anna::RuntimeException) { - const Avp * found; - if(found = getAvp(avp.getId())) { + const Avp * found = getAvp(avp.getId()); + if (found) { if(!a_allowUpdates) { std::string s_ex = "Cannot add an avp with an existing identifier (code,vendor):\n"; s_ex += avp.asString(); @@ -248,9 +248,9 @@ void Dictionary::addAvp(const Avp & avp) throw(anna::RuntimeException) { //----------------------------------------------------- Dictionary::addCommand() //------------------------------------------------------------------------------ void Dictionary::addCommand(const Command & command) throw(anna::RuntimeException) { - const Command * found; - - if(found = getCommand(command.getId())) { + + const Command * found = getCommand(command.getId()); + if(found) { if(!a_allowUpdates) { std::string s_ex = "Cannot add a command with an existing identifier (code,request):\n"; s_ex += command.asString(); @@ -260,7 +260,9 @@ void Dictionary::addCommand(const Command & command) throw(anna::RuntimeExceptio ITEM_OVERWRITE("command", command, a_commands, a_commandNames); } - if(found = getCommand(command.getName())) { + + found = getCommand(command.getName()); + if(found) { if(!a_allowUpdates) { std::string s_ex = "Cannot add a command with an existing name:\n"; s_ex += command.asString(); diff --git a/source/html/DocumentFile.cpp b/source/html/DocumentFile.cpp index 5046ee8..699d236 100644 --- a/source/html/DocumentFile.cpp +++ b/source/html/DocumentFile.cpp @@ -76,6 +76,6 @@ throw(RuntimeException) { _xmlDoc* html::DocumentFile::do_initialize(const anna::DataBlock&) throw(RuntimeException) { - throw("html::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION); + throw RuntimeException("html::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION); return NULL; } diff --git a/source/html/DocumentMemory.cpp b/source/html/DocumentMemory.cpp index e000841..d4d5939 100644 --- a/source/html/DocumentMemory.cpp +++ b/source/html/DocumentMemory.cpp @@ -66,7 +66,7 @@ throw(RuntimeException) { _xmlDoc* html::DocumentMemory::do_initialize(const anna::DataBlock& contain) throw(RuntimeException) { - throw("html::DocumentMemory::do_initialize | Not implemented", ANNA_FILE_LOCATION); + throw RuntimeException("html::DocumentMemory::do_initialize | Not implemented", ANNA_FILE_LOCATION); return NULL; } diff --git a/source/http/Method.cpp b/source/http/Method.cpp index b9fe7dd..b6c202f 100644 --- a/source/http/Method.cpp +++ b/source/http/Method.cpp @@ -46,7 +46,7 @@ anna_assign_enum(http::Method::Type) = { http::Method::Type::_v http::Method::asType(const http::Token* token) throw() { - for(register int ii = 0; anna_item_enum(http::Method::Type, ii) != NULL; ii ++) { + for(int ii = 0; anna_item_enum(http::Method::Type, ii) != NULL; ii ++) { if(token->match(anna_item_enum(http::Method::Type, ii)) == true) return (Type::_v) ii; } diff --git a/source/http/internal/Token.cpp b/source/http/internal/Token.cpp index 05cfc11..61889c8 100644 --- a/source/http/internal/Token.cpp +++ b/source/http/internal/Token.cpp @@ -67,8 +67,8 @@ throw() { bool http::Token::contains(const char byte) const throw() { - register const char* p; - register const char* maxp; + const char* p; + const char* maxp; for(p = DataBlock::getData(), maxp = p + DataBlock::getSize(); p < maxp; p ++) { if(*p == byte) diff --git a/source/http/internal/Tokenizer.cpp b/source/http/internal/Tokenizer.cpp index 67891ae..e900318 100644 --- a/source/http/internal/Tokenizer.cpp +++ b/source/http/internal/Tokenizer.cpp @@ -137,7 +137,7 @@ throw() { int http::Tokenizer::find(const char* data, const int size, const char searched) throw() { - for(register int i = 0; i < size; i ++, data ++) { + for(int i = 0; i < size; i ++, data ++) { if(*data == searched) return i; } diff --git a/source/test/Menu.cpp b/source/test/Menu.cpp index b02f48b..93dc6e3 100644 --- a/source/test/Menu.cpp +++ b/source/test/Menu.cpp @@ -58,7 +58,7 @@ void test::Menu::paint () const { switch (a_status) { case 0: - cout << "Elija operación [+|-|*|/|q = quit]: " << flush; + cout << "Elija operacion [+|-|*|/|q = quit]: " << flush; break; case 1: cout << "Indique primer operador: " << flush; diff --git a/source/timex/Clock.cpp b/source/timex/Clock.cpp index e4aff90..2082f00 100644 --- a/source/timex/Clock.cpp +++ b/source/timex/Clock.cpp @@ -39,12 +39,12 @@ using namespace anna; -timex::Clock::Clock(const char* name, const Millisecond & timeout) : +anna::timex::Clock::Clock(const char* name, const Millisecond & timeout) : TimeEvent(anna_ptrnumber_cast(this), timeout), a_name(name) { } -void timex::Clock::expire(timex::Engine* timeController) +void anna::timex::Clock::expire(timex::Engine* timeController) throw(RuntimeException) { bool moreTick = true; diff --git a/source/timex/Engine.cpp b/source/timex/Engine.cpp index 51c4f50..ae7f17e 100644 --- a/source/timex/Engine.cpp +++ b/source/timex/Engine.cpp @@ -62,10 +62,10 @@ using namespace anna::comm; Resolucion minima (en milisegundos) soportada por el controlador de tiempos. */ //static -const Millisecond timex::Engine::minResolution(100); +const Millisecond anna::timex::Engine::minResolution(100); -timex::Engine::Engine(const Millisecond & maxTimeout, const Millisecond & resolution) : +anna::timex::Engine::Engine(const Millisecond & maxTimeout, const Millisecond & resolution) : app::Component(getClassName()), a_currentQuantum(0), a_maxQuantum(0), @@ -79,7 +79,7 @@ timex::Engine::Engine(const Millisecond & maxTimeout, const Millisecond & resolu timex::sccs::activate(); } -timex::Engine::~Engine() { +anna::timex::Engine::~Engine() { delete a_tickConsumer; delete [] a_timeTable; } @@ -92,7 +92,7 @@ timex::Engine::~Engine() { // posteriores ualarm vamos a calcular la diferencia entre el tiempo esperado y el momento // en que realmente llega la seal de ualarm. //-------------------------------------------------------------------------------------------- -void timex::Engine::do_initialize() +void anna::timex::Engine::do_initialize() throw(RuntimeException) { LOGMETHOD(TraceMethod tm("timex::Engine", "do_initialize", ANNA_FILE_LOCATION)); @@ -139,7 +139,7 @@ throw(RuntimeException) { } // Reimplementado de app::Component -void timex::Engine::do_cloneParent() +void anna::timex::Engine::do_cloneParent() throw() { } @@ -147,7 +147,7 @@ throw() { * Se invoca desde app::Application::clone -> app::Component::do_cloneChild (ojo EN EL NUEVO PROCESO). * Instala la senhal de tick en el proceso, ya que la alarma no se hereda directamente. */ -void timex::Engine::do_cloneChild() +void anna::timex::Engine::do_cloneChild() throw(RuntimeException) { } @@ -155,7 +155,7 @@ throw(RuntimeException) { // No para los hilos de generacion, sino que evita que se escriban los bytes // en el 'pipe'. //---------------------------------------------------------------------------- -void timex::Engine::pause() +void anna::timex::Engine::pause() throw(RuntimeException) { Guard guard(this, "timex::Engine (pause)"); @@ -169,7 +169,7 @@ throw(RuntimeException) { } } -void timex::Engine::play() +void anna::timex::Engine::play() throw(RuntimeException) { Guard guard(this, "timex::Engine (play)"); @@ -183,7 +183,7 @@ throw(RuntimeException) { } } -void timex::Engine::activate(timex::TimeEvent* timeEvent) +void anna::timex::Engine::activate(timex::TimeEvent* timeEvent) throw(RuntimeException) { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "activate", ANNA_FILE_LOCATION)); @@ -252,7 +252,7 @@ throw(RuntimeException) { ); } -timex::TimeEvent* timex::Engine::getTimeEvent(const timex::TimeEvent::Id eventTimeId) +anna::timex::TimeEvent* anna::timex::Engine::getTimeEvent(const timex::TimeEvent::Id eventTimeId) throw() { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "getTimeEvent", ANNA_FILE_LOCATION)); Directory::iterator iid; @@ -276,7 +276,7 @@ throw() { return result; } -void timex::Engine::cancel(timex::TimeEvent* timeEvent) +void anna::timex::Engine::cancel(timex::TimeEvent* timeEvent) throw(RuntimeException) { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "cancel", ANNA_FILE_LOCATION)); @@ -324,7 +324,7 @@ throw(RuntimeException) { notifyRelease(timeEvent); } -void timex::Engine::do_stop() +void anna::timex::Engine::do_stop() throw() { LOGMETHOD(TraceMethod tm("timex::Engine", "do_stop", ANNA_FILE_LOCATION)); Quantum::iterator ii, maxii; @@ -356,7 +356,7 @@ throw() { } } -void timex::Engine::kill() +void anna::timex::Engine::kill() throw() { Guard guard(this, "timex::Engine (kill)"); app::functions::component (ANNA_FILE_LOCATION)->detach(a_tickConsumer); @@ -385,7 +385,7 @@ throw() { // del proceso, con lo que evita totalmente la posiblidad de perdida. // (3) Si el temporizador ha sido reactivado no tiene que liberarlo. //---------------------------------------------------------------------------------- -void timex::Engine::tick() +void anna::timex::Engine::tick() throw(RuntimeException) { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "tick", ANNA_FILE_LOCATION)); /* @@ -462,13 +462,13 @@ throw(RuntimeException) { eventEndQuantum(counter); } -void timex::Engine::notifyRelease(timex::TimeEvent* timeEvent) +void anna::timex::Engine::notifyRelease(timex::TimeEvent* timeEvent) throw() { if(timeEvent->a_observer != NULL) timeEvent->a_observer->release(timeEvent); } -string timex::Engine::asString() const +string anna::timex::Engine::asString() const throw() { string msg("timex::Engine { "); msg += app::Component::asString(); @@ -483,7 +483,7 @@ throw() { return msg += " }"; } -xml::Node* timex::Engine::asXML(xml::Node* parent) const +xml::Node* anna::timex::Engine::asXML(xml::Node* parent) const throw() { parent = Component::asXML(parent); xml::Node* result = parent->createChild("timex.Engine"); diff --git a/source/timex/TimeEvent.cpp b/source/timex/TimeEvent.cpp index 3ff04dd..603ec89 100644 --- a/source/timex/TimeEvent.cpp +++ b/source/timex/TimeEvent.cpp @@ -42,7 +42,7 @@ using namespace anna; -timex::TimeEvent::~TimeEvent() { +anna::timex::TimeEvent::~TimeEvent() { if(a_controller != NULL) { try { a_controller->cancel(this); @@ -52,7 +52,7 @@ timex::TimeEvent::~TimeEvent() { } } -std::string timex::TimeEvent::asString() const +std::string anna::timex::TimeEvent::asString() const throw() { std::string result("timex::TimeEvent { Id: "); result += functions::asHexString(a_id); diff --git a/source/timex/internal/TickConsumer.cpp b/source/timex/internal/TickConsumer.cpp index 242c889..31be332 100644 --- a/source/timex/internal/TickConsumer.cpp +++ b/source/timex/internal/TickConsumer.cpp @@ -54,7 +54,7 @@ using namespace anna; // se llenaba. // (2) Puede ser que se invoque mas de una vez. //-------------------------------------------------------------------------------------------- -void timex::TickConsumer::initialize() +void anna::timex::TickConsumer::initialize() throw(RuntimeException) { if(a_pipe [0] != -1) // (2) return; @@ -68,7 +68,7 @@ throw(RuntimeException) { setfd(a_pipe [0]); } -void timex::TickConsumer::apply() +void anna::timex::TickConsumer::apply() throw(RuntimeException) { char buffer [256]; @@ -92,7 +92,7 @@ throw(RuntimeException) { } } -void timex::TickConsumer::finalize() +void anna::timex::TickConsumer::finalize() throw() { if(a_timeController.a_tickProducer) a_timeController.a_tickProducer->requestStop(); @@ -106,7 +106,7 @@ throw() { * Asi que cada proceso debe tener su propia copia del pipe, para que cada uno lleve independientemente * el control de tiempos. */ -void timex::TickConsumer::clone() +void anna::timex::TickConsumer::clone() throw(RuntimeException) { close(a_pipe [0]); close(a_pipe [1]); @@ -123,7 +123,7 @@ throw(RuntimeException) { a_timeController.a_tickProducer->setfd(a_pipe [1]); } -std::string timex::TickConsumer::asString() const +std::string anna::timex::TickConsumer::asString() const throw() { string result("timex::TickConsumer { "); result += Handler::asString(); diff --git a/source/timex/internal/TickProducer.cpp b/source/timex/internal/TickProducer.cpp index 38c1700..8744260 100644 --- a/source/timex/internal/TickProducer.cpp +++ b/source/timex/internal/TickProducer.cpp @@ -52,7 +52,7 @@ using namespace std; using namespace anna; //static -void* timex::TickProducer::exec(void* arg) +void* anna::timex::TickProducer::exec(void* arg) throw() { sigset_t mask; sigemptyset(&mask); @@ -77,7 +77,7 @@ throw() { return NULL; } -timex::TickProducer::TickProducer(timex::Engine* timeController, const int fdWrite) : +anna::timex::TickProducer::TickProducer(timex::Engine* timeController, const int fdWrite) : a_timeController(*timeController), a_fdWrite(fdWrite), a_expectedTime(0), @@ -85,7 +85,7 @@ timex::TickProducer::TickProducer(timex::Engine* timeController, const int fdWri a_requestedStop(false) {;} -void timex::TickProducer::tick() +void anna::timex::TickProducer::tick() throw() { static char onebyte = 0xff; static int errorCount = 0; @@ -112,7 +112,7 @@ throw() { // (3) Si la correcin aplicada es mayor del 5% de la resolucin volvemos a calcularla ya // que podemos considerar que normalmente no desviar�tanto tiempo. //-------------------------------------------------------------------------------------------- -Millisecond timex::TickProducer::calculeSlice(const Millisecond & msnow) +Millisecond anna::timex::TickProducer::calculeSlice(const Millisecond & msnow) throw() { Millisecond result(a_timeController.getResolution()); int correction = (a_expectedTime == 0) ? 0 : (a_expectedTime - msnow); // (2) diff --git a/source/xml/DocumentFile.cpp b/source/xml/DocumentFile.cpp index e48d0c2..d1fce3b 100644 --- a/source/xml/DocumentFile.cpp +++ b/source/xml/DocumentFile.cpp @@ -82,7 +82,7 @@ throw(RuntimeException) { _xmlDoc* DocumentFile::do_initialize(const anna::DataBlock&) throw(RuntimeException) { - throw("xml::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION); + throw RuntimeException("xml::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION); return NULL; } diff --git a/source/xml/Parser.cpp b/source/xml/Parser.cpp index 53a8f80..30c2909 100644 --- a/source/xml/Parser.cpp +++ b/source/xml/Parser.cpp @@ -125,8 +125,8 @@ throw(RuntimeException) { const char* w; while(xmlNode != NULL) { - switch(xmlNode->type) { - case XML_ELEMENT_NODE: + + if((xmlNode->type) == XML_ELEMENT_NODE) { child = node->createChild((const char*) xmlNode->name); for(xmlNs* ns = xmlNode->nsDef; ns != NULL; ns = ns->next) @@ -138,8 +138,8 @@ throw(RuntimeException) { attributes(child, xmlNode->properties); children(child, xmlNode->children); - break; - case XML_TEXT_NODE: + } + else if((xmlNode->type) == XML_TEXT_NODE) { w = (const char*) xmlNode->content; isSeparator = true; @@ -148,16 +148,14 @@ throw(RuntimeException) { isSeparator = false; break; } - w ++; } if(isSeparator == false) node->createText(decode(xmlNode->content)); - - break; } + xmlNode = xmlNode->next; } } diff --git a/test/config/main.cpp b/test/config/main.cpp index 0477e2d..c5d8fc1 100644 --- a/test/config/main.cpp +++ b/test/config/main.cpp @@ -36,6 +36,7 @@ #define BOOST_TEST_MODULE ANNA_CONFIG_TEST +#include #include #include diff --git a/test/core/main.cpp b/test/core/main.cpp index b1b6115..d2d2f4f 100644 --- a/test/core/main.cpp +++ b/test/core/main.cpp @@ -36,6 +36,7 @@ #define BOOST_TEST_MODULE ANNA_CORE_TEST +#include #include #include diff --git a/test/time/main.cpp b/test/time/main.cpp index 45275a4..c8f9bd8 100644 --- a/test/time/main.cpp +++ b/test/time/main.cpp @@ -36,6 +36,7 @@ #define BOOST_TEST_MODULE ANNA_TIME_TEST +#include #include //#include -- 2.20.1