Skip to content

Commit

Permalink
Move NumberUtils to the OCIO namespace
Browse files Browse the repository at this point in the history
Signed-off-by: L. E. Segovia <[email protected]>
  • Loading branch information
amyspark committed Nov 11, 2021
1 parent 9a97690 commit e88bfc0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/OpenColorIO/ParseUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ bool StringToFloat(float * fval, const char * str)
if(!str) return false;

float x = NAN;
const auto result = NumberUtils::from_chars(str, str + strlen(str), x);
const auto result = OCIO_NAMESPACE::from_chars(str, str + strlen(str), x);
if (result.ec != std::errc())
{
return false;
Expand Down Expand Up @@ -610,7 +610,7 @@ bool StringVecToFloatVec(std::vector<float> &floatArray, const StringUtils::Stri
{
float x = NAN;
const char *str = lineParts[i].c_str();
const auto result = NumberUtils::from_chars(str, str + strlen(str), x);
const auto result = OCIO_NAMESPACE::from_chars(str, str + strlen(str), x);
if (result.ec != std::errc())
{
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/OpenColorIO/fileformats/FileFormatHDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ readLuts(std::istream& istream,
else if(inlut)
{
float v{};
const auto result = NumberUtils::from_chars(word.c_str(), word.c_str() + word.size(), v);
const auto result = OCIO_NAMESPACE::from_chars(word.c_str(), word.c_str() + word.size(), v);

if (result.ec == std::errc())
{
Expand Down
2 changes: 1 addition & 1 deletion src/OpenColorIO/fileformats/FileFormatIridasLook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class XMLParserHelper

long int size_3d{};

const auto result = NumberUtils::from_chars(size_clean.c_str(), size_clean.c_str() + size_clean.size(), size_3d);
const auto result = OCIO_NAMESPACE::from_chars(size_clean.c_str(), size_clean.c_str() + size_clean.size(), size_3d);

if (result.ec != std::errc())
{
Expand Down
6 changes: 3 additions & 3 deletions src/OpenColorIO/fileformats/FileFormatSpi1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ CachedFileRcPtr LocalFileFormat::read(std::istream & istream,
}
else
{
const auto fromMinAnswer = NumberUtils::from_chars(fromMinS, fromMinS + 64, from_min);
const auto fromMaxAnswer = NumberUtils::from_chars(fromMaxS, fromMaxS + 64, from_max);
const auto fromMinAnswer = OCIO_NAMESPACE::from_chars(fromMinS, fromMinS + 64, from_min);
const auto fromMaxAnswer = OCIO_NAMESPACE::from_chars(fromMaxS, fromMaxS + 64, from_max);

if (fromMinAnswer.ec != std::errc() || fromMaxAnswer.ec != std::errc())
{
Expand Down Expand Up @@ -238,7 +238,7 @@ CachedFileRcPtr LocalFileFormat::read(std::istream & istream,
for (int i = 0; i < components; i++)
{
float v = NAN;
const auto result = NumberUtils::from_chars(inputLUT[i], inputLUT[i] + strlen(inputLUT[i]), v);
const auto result = OCIO_NAMESPACE::from_chars(inputLUT[i], inputLUT[i] + strlen(inputLUT[i]), v);

if (result.ec != std::errc())
{
Expand Down
6 changes: 3 additions & 3 deletions src/OpenColorIO/fileformats/FileFormatSpi3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ CachedFileRcPtr LocalFileFormat::read(std::istream & istream,
redValueS, greenValueS, blueValueS) == 6)
#endif
{
const auto redValueAnswer = NumberUtils::from_chars(redValueS, redValueS + 64, redValue);
const auto greenValueAnswer = NumberUtils::from_chars(greenValueS, greenValueS + 64, greenValue);
const auto blueValueAnswer = NumberUtils::from_chars(blueValueS, blueValueS + 64, blueValue);
const auto redValueAnswer = OCIO_NAMESPACE::from_chars(redValueS, redValueS + 64, redValue);
const auto greenValueAnswer = OCIO_NAMESPACE::from_chars(greenValueS, greenValueS + 64, greenValue);
const auto blueValueAnswer = OCIO_NAMESPACE::from_chars(blueValueS, blueValueS + 64, blueValue);

if (redValueAnswer.ec != std::errc()
|| greenValueAnswer.ec != std::errc()
Expand Down
2 changes: 1 addition & 1 deletion src/OpenColorIO/fileformats/xmlutils/XMLReaderUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void ParseNumber(const char * str, size_t startPos, size_t endPos, T & value)

FindSubString(startParse, endPos - startPos, adjustedStartPos, adjustedEndPos);

const auto result = NumberUtils::from_chars(startParse + adjustedStartPos, startParse + adjustedEndPos, val);
const auto result = OCIO_NAMESPACE::from_chars(startParse + adjustedStartPos, startParse + adjustedEndPos, val);

value = (T)val;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/NumberUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <system_error>
#include <type_traits>

namespace NumberUtils
namespace OCIO_NAMESPACE
{

struct Locale
Expand Down

0 comments on commit e88bfc0

Please sign in to comment.