Skip to content

Commit 1505267

Browse files
Fix several minor bugs reported by Claude Opus
1 parent 0e51908 commit 1505267

21 files changed

Lines changed: 144 additions & 136 deletions

cs/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ message("SWIG C# files have been generated.")
5252
target_sources(${CPP_LIBRARY_NAME} PRIVATE ${FESAPI_ROOT_DIR}/swig/swigGeneratedCsWrapper.cpp)
5353
target_sources(${CPP_LIBRARY_NAME} PRIVATE ${FESAPI_ROOT_DIR}/swig/swigGeneratedCsWrapper.h)
5454

55+
# Disable warnings on swig generated file which we do not control
56+
if (WIN32)
57+
set_source_files_properties(${FESAPI_ROOT_DIR}/swig/swigGeneratedCsWrapper.cpp PROPERTIES COMPILE_OPTIONS "/W0")
58+
else()
59+
set_source_files_properties(${FESAPI_ROOT_DIR}/swig/swigGeneratedCsWrapper.cpp PROPERTIES COMPILE_OPTIONS "-w")
60+
endif()
61+
5562
# Create the Visual Studio project from a template file
5663
if (SWIG_LINKED_TO_RELEASE)
5764
set (CS_LIBRARY_NAME FesapiCs${CMAKE_RELEASE_POSTFIX})

java/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ endif (SWIG_LINKED_TO_RELEASE)
9494
target_sources(${CPP_LIBRARY_NAME} PRIVATE ${FESAPI_ROOT_DIR}/swig/swigGeneratedJavaWrapper.cpp)
9595
target_sources(${CPP_LIBRARY_NAME} PRIVATE ${FESAPI_ROOT_DIR}/swig/swigGeneratedJavaWrapper.h)
9696

97+
# Disable warnings on swig generated file which we do not control
98+
if (WIN32)
99+
set_source_files_properties(${FESAPI_ROOT_DIR}/swig/swigGeneratedJavaWrapper.cpp PROPERTIES COMPILE_OPTIONS "/W0")
100+
else()
101+
set_source_files_properties(${FESAPI_ROOT_DIR}/swig/swigGeneratedJavaWrapper.cpp PROPERTIES COMPILE_OPTIONS "-w")
102+
endif()
103+
97104
target_include_directories(${CPP_LIBRARY_NAME} PUBLIC ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
98105

99106
if (SWIG_LINKED_TO_RELEASE)

src/common/AbstractObject.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,8 @@ void AbstractObject::readArrayNdOfFloatValues(gsoap_resqml2_0_1::resqml20__Abstr
894894
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DoubleLatticeArray)
895895
{
896896
gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput);
897-
if (latticeArray->Offset.size() > 1) {
898-
throw invalid_argument("The integer lattice array contains more than one offset.");
897+
if (latticeArray->Offset.size() != 1) {
898+
throw invalid_argument("The double lattice array contains zero or more than one offset.");
899899
}
900900
if (latticeArray->StartValue < (std::numeric_limits<float>::min)() || latticeArray->StartValue > (std::numeric_limits<float>::max)()) {
901901
throw out_of_range("The double start value of the lattice array " + std::to_string(latticeArray->StartValue) + " is out of float range value");
@@ -938,7 +938,7 @@ void AbstractObject::readArrayNdOfFloatValues(gsoap_eml2_3::eml23__AbstractFloat
938938
{
939939
gsoap_eml2_3::eml23__FloatingPointLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput);
940940
if (latticeArray->Offset.empty() || latticeArray->Offset.size() > 1) {
941-
throw invalid_argument("The integer lattice array of UUID " + getUuid() + " contains zero or more than one offset.");
941+
throw invalid_argument("The floating point lattice array of UUID " + getUuid() + " contains zero or more than one offset.");
942942
}
943943
if (latticeArray->StartValue < (std::numeric_limits<float>::min)() || latticeArray->StartValue >(std::numeric_limits<float>::max)()) {
944944
throw out_of_range("The double start value of the lattice array " + std::to_string(latticeArray->StartValue) + " is out of float range value");
@@ -998,8 +998,8 @@ void AbstractObject::readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__Abst
998998
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DoubleLatticeArray)
999999
{
10001000
gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput);
1001-
if (latticeArray->Offset.size() > 1) {
1002-
throw invalid_argument("The integer lattice array contains more than one offset.");
1001+
if (latticeArray->Offset.size() != 1) {
1002+
throw invalid_argument("The double lattice array contains zero or more than one offset.");
10031003
}
10041004

10051005
const double start = latticeArray->StartValue;
@@ -1035,8 +1035,8 @@ void AbstractObject::readArrayNdOfDoubleValues(gsoap_eml2_3::eml23__AbstractFloa
10351035
case SOAP_TYPE_gsoap_eml2_3_eml23__FloatingPointLatticeArray:
10361036
{
10371037
gsoap_eml2_3::eml23__FloatingPointLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput);
1038-
if (latticeArray->Offset.size() > 1) {
1039-
throw invalid_argument("The integer lattice array contains more than one offset.");
1038+
if (latticeArray->Offset.size() != 1) {
1039+
throw invalid_argument("The floating point lattice array contains zero or more than one offset.");
10401040
}
10411041
const double start = latticeArray->StartValue;
10421042
const double step = latticeArray->Offset[0]->Value;
@@ -1410,8 +1410,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractVa
14101410
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray)
14111411
{
14121412
gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*>(arrayInput);
1413-
if (latticeArray->Offset.size() > 1) {
1414-
throw invalid_argument("The integer lattice array contains more than one offset.");
1413+
if (latticeArray->Offset.size() != 1) {
1414+
throw invalid_argument("The integer lattice array contains zero or more than one offset.");
14151415
}
14161416
return latticeArray->Offset[0]->Count + 1;
14171417
}
@@ -1431,8 +1431,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractVa
14311431
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DoubleLatticeArray)
14321432
{
14331433
gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput);
1434-
if (latticeArray->Offset.size() > 1) {
1435-
throw invalid_argument("The lattice array contains more than one offset.");
1434+
if (latticeArray->Offset.size() != 1) {
1435+
throw invalid_argument("The double lattice array contains zero or more than one offset.");
14361436
}
14371437
return static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput)->Offset[0]->Count + 1;
14381438
}
@@ -1481,8 +1481,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
14811481
else if (soapType == SOAP_TYPE_gsoap_eml2_3_eml23__IntegerLatticeArray)
14821482
{
14831483
gsoap_eml2_3::eml23__IntegerLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__IntegerLatticeArray const*>(arrayInput);
1484-
if (latticeArray->Offset.size() > 1) {
1485-
throw invalid_argument("The lattice array contains more than one offset.");
1484+
if (latticeArray->Offset.size() != 1) {
1485+
throw invalid_argument("The integer lattice array contains zero or more than one offset.");
14861486
}
14871487
return latticeArray->Offset[0]->Count + 1ull;
14881488
}
@@ -1507,8 +1507,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
15071507
else if (soapType == SOAP_TYPE_gsoap_eml2_3_eml23__FloatingPointLatticeArray)
15081508
{
15091509
gsoap_eml2_3::eml23__FloatingPointLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput);
1510-
if (latticeArray->Offset.size() > 1) {
1511-
throw invalid_argument("The lattice array contains more than one offset.");
1510+
if (latticeArray->Offset.size() != 1) {
1511+
throw invalid_argument("The floating point lattice array contains zero or more than one offset.");
15121512
}
15131513
return static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput)->Offset[0]->Count + 1;
15141514
}

src/common/AbstractObject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ namespace COMMON_NS
866866
case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray:
867867
{
868868
gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*>(arrayInput);
869-
if (latticeArray->Offset.size() > 1) {
870-
throw std::invalid_argument("The integer lattice array contains more than one offset.");
869+
if (latticeArray->Offset.size() != 1) {
870+
throw std::invalid_argument("The integer lattice array contains zero or more than one offset.");
871871
}
872872
if constexpr (std::is_signed_v<T>) {
873873
if (latticeArray->StartValue < (std::numeric_limits<T>::min)() || latticeArray->Offset[0]->Value < (std::numeric_limits<T>::min)()) {

0 commit comments

Comments
 (0)