Skip to content

Commit 6f9ae5d

Browse files
gsoap generate eml23__PositiveLongand eml23__NonNegativeLong as uint64_t
Also fix some conversion warnings
1 parent f68f216 commit 6f9ae5d

17 files changed

Lines changed: 1491 additions & 1518 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1212

1313
# version mechanism
1414
set (Fesapi_VERSION_MAJOR 2)
15-
set (Fesapi_VERSION_MINOR 14)
16-
set (Fesapi_VERSION_PATCH 1)
15+
set (Fesapi_VERSION_MINOR 15)
16+
set (Fesapi_VERSION_PATCH 0)
1717
set (Fesapi_VERSION_TWEAK 0)
1818

1919
set (Fesapi_VERSION ${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.${Fesapi_VERSION_PATCH}.${Fesapi_VERSION_TWEAK})

src/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ list(APPEND ALL_SOURCES_AND_HEADERS
191191
)
192192

193193
target_sources(${CPP_LIBRARY_NAME} PRIVATE ${ALL_SOURCES_AND_HEADERS})
194+
# Disable warnings on gsoap which we do not control
195+
if (WIN32)
196+
set_source_files_properties(${FESAPI_PROXIES_SOURCES} PROPERTIES COMPILE_OPTIONS "/W0")
197+
else()
198+
set_source_files_properties(${FESAPI_PROXIES_SOURCES} PROPERTIES COMPILE_OPTIONS "-w")
199+
endif()
194200

195201
target_include_directories(${CPP_LIBRARY_NAME} SYSTEM PRIVATE ${MINIZIP_INCLUDE_DIR})
196202

src/common/AbstractObject.cpp

Lines changed: 45 additions & 36 deletions
Large diffs are not rendered by default.

src/common/AbstractObject.h

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}
@@ -871,22 +873,27 @@ namespace COMMON_NS
871873
if (latticeArray->StartValue < (std::numeric_limits<T>::min)() || latticeArray->Offset[0]->Value < (std::numeric_limits<T>::min)()) {
872874
throw std::underflow_error("Too low integers in XML for the C++ chosen datatype");
873875
}
874-
if (latticeArray->StartValue > (std::numeric_limits<T>::max)() ||
875-
latticeArray->Offset[0]->Value > (std::numeric_limits<T>::max)()) {
876+
if (latticeArray->StartValue > static_cast<int64_t>((std::numeric_limits<T>::max)()) ||
877+
latticeArray->Offset[0]->Value > static_cast<int64_t>((std::numeric_limits<T>::max)()) ||
878+
latticeArray->Offset[0]->Count > static_cast<uint64_t>((std::numeric_limits<T>::max)())) {
876879
throw std::overflow_error("Too big integers in XML for the C++ chosen datatype");
877880
}
878881
}
879882
else {
880883
if (latticeArray->StartValue < 0 || latticeArray->Offset[0]->Value < 0) {
881884
throw std::underflow_error("Cannot deal with negative values when using unsigned integer");
882885
}
883-
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)()) {
886+
if (static_cast<uint64_t>(latticeArray->StartValue) > static_cast<uint64_t>((std::numeric_limits<T>::max)()) ||
887+
static_cast<uint64_t>(latticeArray->Offset[0]->Value) > static_cast<uint64_t>((std::numeric_limits<T>::max)()) ||
888+
latticeArray->Offset[0]->Count > static_cast<uint64_t>((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] = static_cast<T>(start + i * step);
890897
}
891898
return (std::numeric_limits<T>::max)();
892899
}
@@ -932,12 +939,12 @@ namespace COMMON_NS
932939
if (latticeArray->Offset.empty() || latticeArray->Offset.size() > 1) {
933940
throw std::invalid_argument("The integer lattice array of UUID " + getUuid() + " contains zero or more than one offset.");
934941
}
935-
if (latticeArray->Offset[0]->Count < 0) {
936-
throw std::invalid_argument("The count of the integer lattice array of UUID " + getUuid() + " is negative which is not valid.");
937-
}
938942

939-
for (size_t i = 0; i <= static_cast<size_t>(latticeArray->Offset[0]->Count); ++i) {
940-
arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
943+
const T start = static_cast<T>(latticeArray->StartValue);
944+
const T step = static_cast<T>(latticeArray->Offset[0]->Value);
945+
const T count = static_cast<T>(latticeArray->Offset[0]->Count);
946+
for (T i = 0; i <= count; ++i) {
947+
arrayOutput[i] = static_cast<T>(start + i * step);
941948
}
942949
return (std::numeric_limits<T>::max)();
943950
}
@@ -949,7 +956,7 @@ namespace COMMON_NS
949956
std::sregex_token_iterator endToken;
950957
size_t index = 0;
951958
while (it != endToken) {
952-
arrayOutput[index++] = std::stoll(*it++);
959+
arrayOutput[index++] = static_cast<T>(std::stoll(*it++));
953960
}
954961
return (std::numeric_limits<T>::max)();
955962
}
@@ -1076,7 +1083,7 @@ namespace COMMON_NS
10761083
/**
10771084
* Create an external data array part pointing to a named dataset in an HDF proxy
10781085
*/
1079-
gsoap_eml2_3::eml23__ExternalDataArrayPart* createExternalDataArrayPart(const std::string& datasetName, LONG64 count, EML2_NS::AbstractHdfProxy* proxy = nullptr) const;
1086+
gsoap_eml2_3::eml23__ExternalDataArrayPart* createExternalDataArrayPart(const std::string& datasetName, uint64_t count, EML2_NS::AbstractHdfProxy* proxy = nullptr) const;
10801087

10811088
gsoap_resqml2_0_1::resqml20__IndexableElements mapIndexableElement(gsoap_eml2_3::eml23__IndexableElement toMap) const;
10821089

src/common/NumberArrayStatistics.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,20 @@ namespace COMMON_NS
129129
}
130130

131131
//mean
132-
valuesMean[j] += (pair.second * pair.first) / validValueCount[j];
132+
valuesMean[j] += (static_cast<double>(pair.second) * static_cast<double>(pair.first)) / static_cast<double>(validValueCount[j]);
133+
133134
}
134-
valuesMedian[j] = (validValueCount[j] % 2 == 0) ? (median1 + median2) / 2.0 : median2;
135-
modePercentage[j] = static_cast<double>(maxCount) / validValueCount[j];
135+
valuesMedian[j] = (validValueCount[j] % 2 == 0) ? (static_cast<double>(median1) + static_cast<double>(median2)) / 2.0 : static_cast<double>(median2);
136+
modePercentage[j] = static_cast<double>(maxCount) / static_cast<double>(validValueCount[j]);
136137

137138

138139
// Standard Deviation
139140
double variance = 0.0;
140141
for (const auto& pair : mapView) {
141142
double diff = static_cast<double>(pair.first) - valuesMean[j];
142-
variance += pair.second * diff * diff;
143+
variance += static_cast<double>(pair.second) * diff * diff;
143144
}
144-
valuesStandardDeviation[j] = std::sqrt(variance / validValueCount[j]);
145+
valuesStandardDeviation[j] = std::sqrt(variance / static_cast<double>(validValueCount[j]));
145146
}
146147
}
147148

src/prodml2_3/FluidCharacterization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void FluidCharacterization::pushBackPlusFluidComponent(const std::string & uid,
281281
}
282282
SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES_IMPL(PlusFluidComponent)
283283
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PlusFluidComponent, SpecificGravity, double, soap_new_double)
284-
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PlusFluidComponent, StartingCarbonNumber, int64_t, soap_new_LONG64)
284+
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PlusFluidComponent, StartingCarbonNumber, uint64_t, soap_new_ULONG64)
285285
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PlusFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)
286286
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PlusFluidComponent, AvgDensity, std::string, gsoap_eml2_3::soap_new_eml23__MassPerVolumeMeasure)
287287
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PlusFluidComponent, AvgMolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom, gsoap_eml2_3::soap_new_eml23__MolecularWeightMeasure)
@@ -371,8 +371,8 @@ void FluidCharacterization::pushBackPseudoFluidComponent(const std::string & uid
371371
}
372372
SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES_IMPL(PseudoFluidComponent)
373373
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, SpecificGravity, double, soap_new_double)
374-
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, StartingCarbonNumber, int64_t, soap_new_LONG64)
375-
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, EndingCarbonNumber, int64_t, soap_new_LONG64)
374+
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, StartingCarbonNumber, uint64_t, soap_new_ULONG64)
375+
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, EndingCarbonNumber, uint64_t, soap_new_ULONG64)
376376
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PseudoFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)
377377
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PseudoFluidComponent, EndingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)
378378
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PseudoFluidComponent, AvgBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)

src/prodml2_3/FluidCharacterization.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ namespace PRODML2_3_NS
293293
DLL_IMPORT_OR_EXPORT void pushBackPlusFluidComponent(const std::string & uid, gsoap_eml2_3::prodml23__PlusComponentKind kind);
294294
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PlusFluidComponent)
295295
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, SpecificGravity, double)
296-
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, StartingCarbonNumber, int64_t)
296+
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, StartingCarbonNumber, uint64_t)
297297
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
298298
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, AvgDensity, std::string)
299299
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, AvgMolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
@@ -356,8 +356,8 @@ namespace PRODML2_3_NS
356356
DLL_IMPORT_OR_EXPORT void pushBackPseudoFluidComponent(const std::string & uid, gsoap_eml2_3::prodml23__PseudoComponentKind kind);
357357
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PseudoFluidComponent)
358358
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, SpecificGravity, double)
359-
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, StartingCarbonNumber, int64_t)
360-
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, EndingCarbonNumber, int64_t)
359+
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, StartingCarbonNumber, uint64_t)
360+
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, EndingCarbonNumber, uint64_t)
361361
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
362362
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, EndingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
363363
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, AvgBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)

src/proxies/envC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Product and source code licensed by Genivia Inc., contact@genivia.com
1717

1818
#include "envH.h"
1919

20-
SOAP_SOURCE_STAMP("@(#) envC.cpp ver 2.8.140E 2026-02-16 09:13:49 GMT")
20+
SOAP_SOURCE_STAMP("@(#) envC.cpp ver 2.8.140E 2026-03-17 16:59:43 GMT")
2121

2222

2323
#ifndef WITH_NOGLOBAL

0 commit comments

Comments
 (0)