diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-12 14:02:09 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-12 14:02:09 +0100 |
| commit | 92e3bafcb82ac8c2ed6782cd1e6e6cf3703cd6ca (patch) | |
| tree | 04139d998a9b8b5f085f39acd4842b7f89a75a09 /src/lib | |
| parent | 5c3cf1204fbb3e5a357eadbca2de0ec18f2d9e12 (diff) | |
Try to fix 32/64-bit int confusion with compose.hpp.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/compose.hpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/lib/compose.hpp b/src/lib/compose.hpp index 85a9e9b0f..425aceabf 100644 --- a/src/lib/compose.hpp +++ b/src/lib/compose.hpp @@ -121,42 +121,50 @@ namespace StringPrivate } template <> - inline void write(std::string& s, const int64_t& obj) + inline void write(std::string& s, const int32_t& obj) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS - __mingw_snprintf(buffer, 64, "%" PRId64, obj); + __mingw_snprintf(buffer, 64, "%" PRId32, obj); #else - snprintf(buffer, 64, "%" PRId64, obj); + snprintf(buffer, 64, "%" PRId32, obj); #endif s += buffer; } template <> - inline void write(std::string& s, const uint64_t& obj) + inline void write(std::string& s, const uint32_t& obj) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS - __mingw_snprintf(buffer, 64, "%" PRIu64, obj); + __mingw_snprintf(buffer, 64, "%" PRIu32, obj); #else - snprintf(buffer, 64, "%" PRIu64, obj); + snprintf(buffer, 64, "%" PRIu32, obj); #endif s += buffer; } template <> - inline void write(std::string& s, const int& obj) + inline void write(std::string& s, const int64_t& obj) { char buffer[64]; - snprintf(buffer, 64, "%d", obj); +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf(buffer, 64, "%" PRId64, obj); +#else + snprintf(buffer, 64, "%" PRId64, obj); +#endif s += buffer; } template <> - inline void write(std::string& s, const unsigned int& obj) + inline void write(std::string& s, const uint64_t& obj) { char buffer[64]; - snprintf(buffer, 64, "%ud", obj); +#ifdef DCPOMATIC_WINDOWS + __mingw_snprintf(buffer, 64, "%" PRIu64, obj); +#else + snprintf(buffer, 64, "%" PRIu64, obj); +#endif s += buffer; } |
