Skip to content

Commit

Permalink
Replacing strtof with fnStringToFloat
Browse files Browse the repository at this point in the history
  • Loading branch information
3dJan committed Oct 20, 2023
1 parent db040c8 commit 9d55347
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace NMR {
__NMRASSERT(pAttributeValue);

if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TEXTURE_U) == 0) {
m_fU = strtof(pAttributeValue, nullptr);
m_fU = fnStringToFloat(pAttributeValue);
#ifdef __MINGW32__
if (isNotANumber(m_fU))
#else
Expand All @@ -99,7 +99,7 @@ namespace NMR {
}

if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_TEXTURE_V) == 0) {
m_fV = strtof(pAttributeValue, nullptr);
m_fV = fnStringToFloat(pAttributeValue);
#ifdef __MINGW32__
if (isNotANumber(m_fV))
#else
Expand Down
6 changes: 3 additions & 3 deletions Source/Model/Reader/v093/NMR_ModelReaderNode093_Vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace NMR {
__NMRASSERT(pAttributeValue);

if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_VERTEX_X) == 0) {
m_fX = strtof(pAttributeValue, nullptr);
m_fX = fnStringToFloat(pAttributeValue);
#ifdef __MINGW32__
if (isNotANumber(m_fX))
#else
Expand All @@ -95,7 +95,7 @@ namespace NMR {
}

if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_VERTEX_Y) == 0) {
m_fY = strtof(pAttributeValue, nullptr);
m_fY = fnStringToFloat(pAttributeValue);
#ifdef __MINGW32__
if (isNotANumber(m_fY))
#else
Expand All @@ -108,7 +108,7 @@ namespace NMR {
}

if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_VERTEX_Z) == 0) {
m_fZ = strtof(pAttributeValue, nullptr);
m_fZ = fnStringToFloat(pAttributeValue);
#ifdef __MINGW32__
if (isNotANumber(m_fZ))
#else
Expand Down
6 changes: 3 additions & 3 deletions Source/Model/Reader/v100/NMR_ModelReaderNode100_Vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ namespace NMR {
__NMRASSERT(pAttributeValue);

if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_VERTEX_X) == 0) {
m_fX = strtof(pAttributeValue, nullptr);
m_fX = fnStringToFloat(pAttributeValue);
if (std::isnan (m_fX))
throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES);
if (fabs (m_fX) > XML_3MF_MAXIMUMCOORDINATEVALUE)
throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES);
m_bHasX = true;
}
else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_VERTEX_Y) == 0) {
m_fY = strtof(pAttributeValue, nullptr);
m_fY = fnStringToFloat(pAttributeValue);
if (std::isnan (m_fY))
throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES);
if (fabs(m_fY) > XML_3MF_MAXIMUMCOORDINATEVALUE)
throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES);
m_bHasY = true;
}
else if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_VERTEX_Z) == 0) {
m_fZ = strtof(pAttributeValue, nullptr);
m_fZ = fnStringToFloat(pAttributeValue);
if (std::isnan (m_fZ))
throw CNMRException(NMR_ERROR_INVALIDMODELCOORDINATES);
if (fabs(m_fZ) > XML_3MF_MAXIMUMCOORDINATEVALUE)
Expand Down

0 comments on commit 9d55347

Please sign in to comment.