X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fcomm%2FCompatCodec.cpp;h=600d9e115075eeaee4328fe0eab1cf107e8239ea;hb=42f606f1c76bfbef24e7e772b6939d69d5ea970e;hp=6d0c5a15265c5d3deeb25dd78968d0148ea824d0;hpb=884501d2411bc4fdfafae65948262c959e068d7d;p=anna.git diff --git a/source/comm/CompatCodec.cpp b/source/comm/CompatCodec.cpp index 6d0c5a1..600d9e1 100644 --- a/source/comm/CompatCodec.cpp +++ b/source/comm/CompatCodec.cpp @@ -1,8 +1,8 @@ -// ANNA - Anna is Not 'N' Anymore +// ANNA - Anna is Not Nothingness Anymore // // (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo // -// https://bitbucket.org/testillano/anna +// http://redmine.teslayout.com/projects/anna-suite // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -14,7 +14,7 @@ // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. -// * Neither the name of Google Inc. nor the names of its +// * Neither the name of the copyright holder nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // @@ -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]; }