From 99f52369599d74bb9983e6479991a82073eb15c7 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Thu, 8 Oct 2020 20:26:17 +0200 Subject: [PATCH] Compile issues for 64bits int under i386 --- GlmToolkit.cpp | 7 +++++-- ImGuiToolkit.cpp | 6 +++--- tinyxml2Toolkit.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/GlmToolkit.cpp b/GlmToolkit.cpp index 5cc57a4..fdb10d3 100644 --- a/GlmToolkit.cpp +++ b/GlmToolkit.cpp @@ -8,10 +8,13 @@ #include #include + + uint64_t GlmToolkit::uniqueId() { - auto duration = std::chrono::high_resolution_clock::now().time_since_epoch(); // 18446744073709551615 - return std::chrono::duration_cast(duration).count() % 1000000000000000000LL; + auto duration = std::chrono::high_resolution_clock::now().time_since_epoch(); + // 64-bit int 18446744073709551615UL + return std::chrono::duration_cast(duration).count() % 1000000000000000000UL; } glm::mat4 GlmToolkit::transform(glm::vec3 translation, glm::vec3 rotation, glm::vec3 scale) diff --git a/ImGuiToolkit.cpp b/ImGuiToolkit.cpp index 91ec4dc..904af78 100644 --- a/ImGuiToolkit.cpp +++ b/ImGuiToolkit.cpp @@ -13,9 +13,9 @@ #endif #include "imgui_internal.h" -#define MILISECOND 1000000L -#define SECOND 1000000000L -#define MINUTE 60000000000L +#define MILISECOND 1000000UL +#define SECOND 1000000000UL +#define MINUTE 60000000000UL #include "Resource.h" #include "FileDialog.h" diff --git a/tinyxml2Toolkit.cpp b/tinyxml2Toolkit.cpp index 192b719..fa1dff8 100644 --- a/tinyxml2Toolkit.cpp +++ b/tinyxml2Toolkit.cpp @@ -123,12 +123,12 @@ XMLElement *tinyxml2::XMLElementEncodeArray(XMLDocument *doc, void *array, unsig newelement->SetAttribute("zbytes", (uint) compressed_size); // encode the compressed array - encoded_array = g_base64_encode( (guchar *) compressed_array, compressed_size); + encoded_array = g_base64_encode( (guchar *) compressed_array, (gsize) compressed_size); } // failed compression else { // encode the raw array - encoded_array = g_base64_encode( (guchar *) array, (uLong) arraysize); + encoded_array = g_base64_encode( (guchar *) array, (gsize) arraysize); } // save the encoded string as text @@ -156,7 +156,7 @@ bool tinyxml2::XMLElementDecodeArray(XMLElement *elem, void *array, unsigned int return ret; // read and decode the text field in - uLong decoded_size = 0; + gsize decoded_size = 0; guchar *decoded_array = g_base64_decode(elem->GetText(), &decoded_size); // if data is z-compressed (zbytes size is indicated) @@ -164,7 +164,7 @@ bool tinyxml2::XMLElementDecodeArray(XMLElement *elem, void *array, unsigned int elem->QueryUnsignedAttribute("zbytes", &zbytes); if ( zbytes > 0) { // sanity check 1: decoded data size must match the buffer size - if ( decoded_array && zbytes == decoded_size ) { + if ( decoded_array && zbytes == (uint) decoded_size ) { // allocate a temporary array for decompressing data uLong uncompressed_size = arraysize;