summaryrefslogtreecommitdiffstats
path: root/sord
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-21 23:29:13 +0000
committerDavid Robillard <d@drobilla.net>2011-12-21 23:29:13 +0000
commit68f185bfc1140da7c402d4e1100ee71267789b60 (patch)
treee9c7731b39690db61b5f729c1047eac7f0b12ef3 /sord
parentfa5c2b8210ecf22004b27eb8b8de17cfc1ec48f2 (diff)
downloadsord-68f185bfc1140da7c402d4e1100ee71267789b60.tar.gz
sord-68f185bfc1140da7c402d4e1100ee71267789b60.tar.bz2
sord-68f185bfc1140da7c402d4e1100ee71267789b60.zip
Remove locale kludges.
git-svn-id: http://svn.drobilla.net/sord/trunk@183 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord')
-rw-r--r--sord/sordmm.hpp16
1 files 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