summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-09-12 10:40:10 +0100
committerCarl Hetherington <cth@carlh.net>2016-09-12 10:40:10 +0100
commit599af5820d963f9e14516182524f05285c77f66e (patch)
tree74ed535ed1e12e03fc701f323a2878dec4201325 /src
parentda99d514dea384babf98d5a47cca3ab864e9a4e4 (diff)
Remove mysterious use of locked_stringstream.
Diffstat (limited to 'src')
-rw-r--r--src/raw_convert.cc7
-rw-r--r--src/raw_convert.h4
-rw-r--r--src/subtitle_asset.cc7
3 files changed, 12 insertions, 6 deletions
diff --git a/src/raw_convert.cc b/src/raw_convert.cc
index aed965ad..432ce394 100644
--- a/src/raw_convert.cc
+++ b/src/raw_convert.cc
@@ -160,6 +160,13 @@ dcp::raw_convert (string v, int precision, bool fixed)
}
template <>
+long
+dcp::raw_convert (string v, int precision, bool fixed)
+{
+ return locale_convert<long> (make_local (v), precision, fixed);
+}
+
+template <>
int
dcp::raw_convert (char const * v, int precision, bool fixed)
{
diff --git a/src/raw_convert.h b/src/raw_convert.h
index 7f31ac37..8ce5220e 100644
--- a/src/raw_convert.h
+++ b/src/raw_convert.h
@@ -109,6 +109,10 @@ int
raw_convert (std::string v, int, bool);
template <>
+long
+raw_convert (std::string v, int, bool);
+
+template <>
int
raw_convert (char const * v, int, bool);
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 02dfd80f..ac87148d 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -111,12 +111,7 @@ optional_number_attribute (xmlpp::Element const * node, string name)
std::string t = s.get ();
boost::erase_all (t, " ");
- locked_stringstream u;
- u.imbue (std::locale::classic ());
- u << t;
- T n;
- u >> n;
- return n;
+ return raw_convert<T> (t);
}
SubtitleAsset::ParseState