From 68f185bfc1140da7c402d4e1100ee71267789b60 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 21 Dec 2011 23:29:13 +0000 Subject: Remove locale kludges. git-svn-id: http://svn.drobilla.net/sord/trunk@183 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sordmm.hpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp index 8e352d4..cbb5460 100644 --- a/sord/sordmm.hpp +++ b/sord/sordmm.hpp @@ -330,24 +330,16 @@ inline int Node::to_int() const { assert(is_int()); - std::locale c_locale("C"); - std::stringstream ss((const char*)sord_node_get_string(_c_obj)); - ss.imbue(c_locale); - int i = 0; - ss >> i; - return i; + char* endptr; + return strtol((const char*)sord_node_get_string(_c_obj), &endptr, 10); } inline float Node::to_float() const { assert(is_float()); - std::locale c_locale("C"); - std::stringstream ss((const char*)sord_node_get_string(_c_obj)); - ss.imbue(c_locale); - float f = 0.0f; - ss >> f; - return f; + char* endptr; + return serd_strtod((const char*)sord_node_get_string(_c_obj), &endptr); } inline bool -- cgit v1.2.1