diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-15 13:53:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-15 13:53:01 +0100 |
| commit | 9b9be06af7a51cac6f957db16ec2695c79ffb8fd (patch) | |
| tree | 5ee7676944630906dd6b857e8c5785217f07f988 | |
| parent | 809e35fcb53c26c8d200df805d2c57c2ac6668ef (diff) | |
Hack.
| -rw-r--r-- | src/locale_convert.cc | 24 | ||||
| -rw-r--r-- | src/locale_convert.h | 13 | ||||
| -rw-r--r-- | src/raw_convert.cc | 12 | ||||
| -rw-r--r-- | src/raw_convert.h | 19 |
4 files changed, 30 insertions, 38 deletions
diff --git a/src/locale_convert.cc b/src/locale_convert.cc index 1a25ceeb..4cd24a7f 100644 --- a/src/locale_convert.cc +++ b/src/locale_convert.cc @@ -39,55 +39,55 @@ using std::string; template<> string -dcp::locale_convert (int16_t x, int, bool) +dcp::locale_convert (int x, int, bool) { char buffer[64]; - snprintf (buffer, sizeof(buffer), "%" PRId16, x); + snprintf (buffer, sizeof(buffer), "%d", x); return buffer; } template<> string -dcp::locale_convert (uint16_t x, int, bool) +dcp::locale_convert (unsigned int x, int, bool) { char buffer[64]; - snprintf (buffer, sizeof(buffer), "%" PRIu16, x); + snprintf (buffer, sizeof(buffer), "%u", x); return buffer; } template<> string -dcp::locale_convert (int32_t x, int, bool) +dcp::locale_convert (long int x, int, bool) { char buffer[64]; - snprintf (buffer, sizeof(buffer), "%" PRId32, x); + snprintf (buffer, sizeof(buffer), "%ld", x); return buffer; } template<> string -dcp::locale_convert (uint32_t x, int, bool) +dcp::locale_convert (unsigned long int x, int, bool) { char buffer[64]; - snprintf (buffer, sizeof(buffer), "%" PRIu32, x); + snprintf (buffer, sizeof(buffer), "%lu", x); return buffer; } template<> string -dcp::locale_convert (int64_t x, int, bool) +dcp::locale_convert (long long int x, int, bool) { char buffer[64]; - snprintf (buffer, sizeof(buffer), "%" PRId64, x); + snprintf (buffer, sizeof(buffer), "%lld", x); return buffer; } template<> string -dcp::locale_convert (uint64_t x, int, bool) +dcp::locale_convert (unsigned long long int x, int, bool) { char buffer[64]; - snprintf (buffer, sizeof(buffer), "%" PRIu64, x); + snprintf (buffer, sizeof(buffer), "%llu", x); return buffer; } diff --git a/src/locale_convert.h b/src/locale_convert.h index be99e70f..25f5cfa4 100644 --- a/src/locale_convert.h +++ b/src/locale_convert.h @@ -36,7 +36,6 @@ #include <boost/static_assert.hpp> #include <string> -#include <stdint.h> #include <cstdio> namespace dcp { @@ -53,27 +52,27 @@ locale_convert (Q x, int precision = 16, bool fixed = false) template <> std::string -locale_convert (int16_t x, int, bool); +locale_convert (int x, int, bool); template <> std::string -locale_convert (uint16_t x, int, bool); +locale_convert (unsigned int x, int, bool); template <> std::string -locale_convert (int32_t x, int, bool); +locale_convert (long int x, int, bool); template <> std::string -locale_convert (uint32_t x, int, bool); +locale_convert (unsigned long int x, int, bool); template <> std::string -locale_convert (int64_t x, int, bool); +locale_convert (long long int x, int, bool); template <> std::string -locale_convert (uint64_t x, int, bool); +locale_convert (unsigned long long int x, int, bool); template <> std::string diff --git a/src/raw_convert.cc b/src/raw_convert.cc index c3cce54b..5ee0aed5 100644 --- a/src/raw_convert.cc +++ b/src/raw_convert.cc @@ -59,42 +59,42 @@ make_local (string v) template <> string -dcp::raw_convert (int16_t v, int precision, bool fixed) +dcp::raw_convert (int v, int precision, bool fixed) { return make_raw (locale_convert<string> (v, precision, fixed)); } template <> string -dcp::raw_convert (uint16_t v, int precision, bool fixed) +dcp::raw_convert (unsigned int v, int precision, bool fixed) { return make_raw (locale_convert<string> (v, precision, fixed)); } template <> string -dcp::raw_convert (int32_t v, int precision, bool fixed) +dcp::raw_convert (long int v, int precision, bool fixed) { return make_raw (locale_convert<string> (v, precision, fixed)); } template <> string -dcp::raw_convert (uint32_t v, int precision, bool fixed) +dcp::raw_convert (unsigned long int v, int precision, bool fixed) { return make_raw (locale_convert<string> (v, precision, fixed)); } template <> string -dcp::raw_convert (int64_t v, int precision, bool fixed) +dcp::raw_convert (long long int v, int precision, bool fixed) { return make_raw (locale_convert<string> (v, precision, fixed)); } template <> string -dcp::raw_convert (uint64_t v, int precision, bool fixed) +dcp::raw_convert (unsigned long long v, int precision, bool fixed) { return make_raw (locale_convert<string> (v, precision, fixed)); } diff --git a/src/raw_convert.h b/src/raw_convert.h index 8690d524..901e99dd 100644 --- a/src/raw_convert.h +++ b/src/raw_convert.h @@ -36,7 +36,6 @@ #include <boost/static_assert.hpp> #include <iomanip> -#include <stdint.h> namespace dcp { @@ -55,33 +54,27 @@ raw_convert (Q v, int precision = 16, bool fixed = false) template <> std::string -raw_convert (int16_t v, int, bool); +raw_convert (int v, int, bool); template <> std::string -raw_convert (uint16_t v, int, bool); +raw_convert (unsigned int v, int, bool); template <> std::string -raw_convert (int32_t v, int, bool); +raw_convert (long int v, int, bool); template <> std::string -raw_convert (uint32_t v, int, bool); - -template <> -std::string -raw_convert (int64_t v, int, bool); +raw_convert (unsigned long int v, int, bool); template <> std::string -raw_convert (uint64_t v, int, bool); +raw_convert (long long int v, int, bool); -#ifdef LIBDCP_OSX template <> std::string -raw_convert (unsigned long int v, int, bool); -#endif +raw_convert (unsigned long long int v, int, bool); template <> std::string |
