Apply the same rules to closed captions.
[libdcp.git] / src / locale_convert.cc
index 5e7c350f4098138370ee763c3deeae548330c066..915cac826bbe58387977ed1c355c1a5243ed8985 100644 (file)
@@ -219,7 +219,7 @@ template<>
 unsigned int
 dcp::locale_convert (string x, int, bool)
 {
-       int y = 0;
+       unsigned int y = 0;
        sscanf (x.c_str(), "%u", &y);
        return y;
 }
@@ -242,6 +242,19 @@ dcp::locale_convert (string x, int, bool)
        return y;
 }
 
+template<>
+unsigned long
+dcp::locale_convert (string x, int, bool)
+{
+       unsigned long y = 0;
+#ifdef LIBDCP_WINDOWS
+       __mingw_sscanf (x.c_str(), "%lud", &y);
+#else
+       sscanf (x.c_str(), "%lud", &y);
+#endif
+       return y;
+}
+
 template<>
 long long
 dcp::locale_convert (string x, int, bool)
@@ -255,6 +268,19 @@ dcp::locale_convert (string x, int, bool)
        return y;
 }
 
+template<>
+unsigned long long
+dcp::locale_convert (string x, int, bool)
+{
+       unsigned long long y = 0;
+#ifdef LIBDCP_WINDOWS
+       __mingw_sscanf (x.c_str(), "%llud", &y);
+#else
+       sscanf (x.c_str(), "%llud", &y);
+#endif
+       return y;
+}
+
 template<>
 float
 dcp::locale_convert (string x, int, bool)