[gjs/mozjs91: 6/17] Typed array functions expect size_t instead of uint32_t




commit bf499e96a863b579202a35e162b0d202597b147f
Author: Evan Welsh <contact evanwelsh com>
Date:   Sat Jul 10 20:23:55 2021 -0700

    Typed array functions expect size_t instead of uint32_t
    
    See https://bugzilla.mozilla.org/show_bug.cgi?id=1674777

 gjs/byteArray.cpp     | 2 +-
 gjs/text-encoding.cpp | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 7bb713dc..05c25034 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -295,7 +295,7 @@ JSObject* gjs_byte_array_from_byte_array(JSContext* cx, GByteArray* array) {
 
 GBytes* gjs_byte_array_get_bytes(JSObject* obj) {
     bool is_shared_memory;
-    uint32_t len;
+    size_t len;
     uint8_t* data;
 
     js::GetUint8ArrayLengthAndData(obj, &len, &is_shared_memory, &data);
diff --git a/gjs/text-encoding.cpp b/gjs/text-encoding.cpp
index 06b8ae71..a47b30d5 100644
--- a/gjs/text-encoding.cpp
+++ b/gjs/text-encoding.cpp
@@ -65,7 +65,7 @@ static const char* UTF16_CODESET = "UTF-16BE";
 }
 
 GJS_JSAPI_RETURN_CONVENTION
-static bool to_string_impl_slow(JSContext* cx, uint8_t* data, uint32_t len,
+static bool to_string_impl_slow(JSContext* cx, uint8_t* data, size_t len,
                                 const char* encoding,
                                 JS::MutableHandleValue rval) {
     size_t bytes_written;
@@ -105,7 +105,7 @@ bool bytearray_to_string(JSContext* context, JS::HandleObject byte_array,
         encoding_is_utf8 = is_utf8_label(encoding);
 
     uint8_t* data;
-    uint32_t len;
+    size_t len;
     bool is_shared_memory;
     js::GetUint8ArrayLengthAndData(byte_array, &len, &is_shared_memory, &data);
 
@@ -132,7 +132,7 @@ bool bytearray_to_string(JSContext* context, JS::HandleObject byte_array,
     }
 
     uint8_t* current_data;
-    uint32_t current_len;
+    size_t current_len;
     bool ignore_val;
 
     // If a garbage collection occurs between when we call


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