@@ -411,7 +411,7 @@ namespace COMMON_NS
411411 *
412412 * @returns The gSOAP type.
413413 */
414- int getGsoapType () const ;
414+ long getGsoapType () const ;
415415
416416 /* *
417417 * Creates an returns an EML2.0 data object reference which targets this data object
@@ -831,11 +831,13 @@ namespace COMMON_NS
831831 throw std::underflow_error (" Cannot deal with negative values when using unsigned integer" );
832832 }
833833 }
834- if (rangeArray->Value + rangeArray-> Count > static_cast <uint64_t >((std::numeric_limits<T>::max)())) {
835- throw std::overflow_error (" The range integer values are superior to maximum value of read datatype. " );
834+ if (rangeArray->Count > static_cast <uint64_t >((std::numeric_limits<T>::max)())) {
835+ throw std::overflow_error (" Please use a larger integer type " );
836836 }
837- for (T i = 0 ; i < static_cast <T>(rangeArray->Count ); ++i) {
838- arrayOutput[i] = i + static_cast <T>(rangeArray->Value );
837+ const T initialValue = static_cast <T>(rangeArray->Value );
838+ const T count = static_cast <T>(rangeArray->Count );
839+ for (T i = 0 ; i < count; ++i) {
840+ arrayOutput[i] = i + initialValue;
839841 }
840842 return (std::numeric_limits<T>::max)();
841843 }
@@ -872,7 +874,8 @@ namespace COMMON_NS
872874 throw std::underflow_error (" Too low integers in XML for the C++ chosen datatype" );
873875 }
874876 if (latticeArray->StartValue > (std::numeric_limits<T>::max)() ||
875- latticeArray->Offset [0 ]->Value > (std::numeric_limits<T>::max)()) {
877+ latticeArray->Offset [0 ]->Value > (std::numeric_limits<T>::max)() ||
878+ latticeArray->Offset [0 ]->Count > (std::numeric_limits<T>::max)()) {
876879 throw std::overflow_error (" Too big integers in XML for the C++ chosen datatype" );
877880 }
878881 }
@@ -881,12 +884,16 @@ namespace COMMON_NS
881884 throw std::underflow_error (" Cannot deal with negative values when using unsigned integer" );
882885 }
883886 if (static_cast <uint64_t >(latticeArray->StartValue ) > (std::numeric_limits<T>::max)() ||
884- static_cast <uint64_t >(latticeArray->Offset [0 ]->Value ) > (std::numeric_limits<T>::max)()) {
887+ static_cast <uint64_t >(latticeArray->Offset [0 ]->Value ) > (std::numeric_limits<T>::max)() ||
888+ static_cast <uint64_t >(latticeArray->Offset [0 ]->Count ) > (std::numeric_limits<T>::max)()) {
885889 throw std::overflow_error (" Too big integers in XML for the C++ chosen datatype" );
886890 }
887891 }
888- for (uint64_t i = 0 ; i <= latticeArray->Offset [0 ]->Count ; ++i) {
889- arrayOutput[i] = static_cast <T>(latticeArray->StartValue ) + (i * static_cast <T>(latticeArray->Offset [0 ]->Value ));
892+ const T start = static_cast <T>(latticeArray->StartValue );
893+ const T step = static_cast <T>(latticeArray->Offset [0 ]->Value );
894+ const T count = static_cast <T>(latticeArray->Offset [0 ]->Count );
895+ for (T i = 0 ; i <= count; ++i) {
896+ arrayOutput[i] = start + i * step;
890897 }
891898 return (std::numeric_limits<T>::max)();
892899 }
0 commit comments