diff options
author | Syoyo Fujita <syoyo@lighttransport.com> | 2017-02-23 00:35:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 00:35:52 +0900 |
commit | 9d9e987c4776d9df54e0ab65639e1befddb1d5ae (patch) | |
tree | f116bb55e32a1df73639a1e544fe623b09f495e8 | |
parent | 9134c1d3951fc2b3a83dd0691cb79b4245c94523 (diff) | |
parent | 345560040b4bfaa2f60619f435e1e314d3647e14 (diff) | |
download | tinyobjloader-9d9e987c4776d9df54e0ab65639e1befddb1d5ae.tar.gz |
Merge pull request #123 from nikitoz/master
Add std namespace for pow, ldexp, sscanf function calls.
-rw-r--r-- | tiny_obj_loader.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index 6d5a557..7f704d8 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -529,7 +529,7 @@ static bool tryParseDouble(const char *s, const char *s_end, double *result) { // NOTE: Don't use powf here, it will absolutely murder precision. mantissa += static_cast<int>(*curr - 0x30) * - (read < lut_entries ? pow_lut[read] : pow(10.0, -read)); + (read < lut_entries ? pow_lut[read] : std::pow(10.0, -read)); read++; curr++; end_not_reached = (curr != s_end); @@ -571,7 +571,7 @@ static bool tryParseDouble(const char *s, const char *s_end, double *result) { assemble: *result = (sign == '+' ? 1 : -1) * - (exponent ? ldexp(mantissa * pow(5.0, exponent), exponent) : mantissa); + (exponent ? std::ldexp(mantissa * std::pow(5.0, exponent), exponent) : mantissa); return true; fail: return false; @@ -1020,7 +1020,7 @@ void LoadMtl(std::map<std::string, int> *material_map, #ifdef _MSC_VER sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif material.name = namebuf; continue; @@ -1522,7 +1522,7 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes, #ifdef _MSC_VER sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif int newMaterialId = -1; @@ -1642,7 +1642,7 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes, #ifdef _MSC_VER sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif name = std::string(namebuf); @@ -1657,7 +1657,7 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes, #ifdef _MSC_VER sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif tag.name = std::string(namebuf); @@ -1686,7 +1686,7 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes, sscanf_s(token, "%s", stringValueBuffer, (unsigned)_countof(stringValueBuffer)); #else - sscanf(token, "%s", stringValueBuffer); + std::sscanf(token, "%s", stringValueBuffer); #endif tag.stringValues[i] = stringValueBuffer; token += tag.stringValues[i].size() + 1; @@ -1833,7 +1833,7 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback, sscanf_s(token, "%s", namebuf, static_cast<unsigned int>(_countof(namebuf))); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif int newMaterialId = -1; @@ -1947,7 +1947,7 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback, #ifdef _MSC_VER sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif std::string object_name = std::string(namebuf); @@ -1967,7 +1967,7 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback, #ifdef _MSC_VER sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); #else - sscanf(token, "%s", namebuf); + std::sscanf(token, "%s", namebuf); #endif tag.name = std::string(namebuf); @@ -1996,7 +1996,7 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback, sscanf_s(token, "%s", stringValueBuffer, (unsigned)_countof(stringValueBuffer)); #else - sscanf(token, "%s", stringValueBuffer); + std::sscanf(token, "%s", stringValueBuffer); #endif tag.stringValues[i] = stringValueBuffer; token += tag.stringValues[i].size() + 1; |