[gjs/msvc-x64] text-encoding.cpp: Fix builds on 64-bit Windows




commit 2b708f238baa908cfab90eb57fe50d4a1518def3
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Aug 12 15:15:09 2021 +0800

    text-encoding.cpp: Fix builds on 64-bit Windows
    
    The `lu` suffix for the second parameter breaks builds on 64-bit Windows since
    size_t's do not have the same size as a long.  So, static_cast the value instead
    into a size_t.

 gjs/text-encoding.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/text-encoding.cpp b/gjs/text-encoding.cpp
index 641f3ea7..830dda3b 100644
--- a/gjs/text-encoding.cpp
+++ b/gjs/text-encoding.cpp
@@ -101,7 +101,7 @@ static JSString* gjs_lossy_decode_from_uint8array_slow(
     // some dialectal characters are in the supplemental plane
     // Adding a padding of 12 prevents a few dialectal characters
     // from requiring a reallocation.
-    size_t buffer_size = std::max(bytes_len * 2 + 12, 256lu);
+    size_t buffer_size = std::max(bytes_len * 2 + 12, static_cast<size_t>(256u));
 
     // Cast data to correct input types
     const char* input = reinterpret_cast<const char*>(bytes);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]