wasm: use uintptr_t for uint32_t

This helps get ready for wasm64

Change-Id: I6db5b93c7ca851cab7fc95701b27a20263c8c0bd
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit d3be345a368941cc8e6b13851168d85354cc3e3c)
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Lorn Potter 2022-08-24 10:43:21 +10:00 committed by Mikolaj Boc
parent c5479c9b2c
commit 43500a1e66
2 changed files with 3 additions and 3 deletions

View File

@ -225,7 +225,7 @@ Uint8Array::Uint8Array(const ArrayBuffer &buffer, uint32_t offset, uint32_t leng
// Constructs a Uint8Array which references an area on the heap.
Uint8Array::Uint8Array(const char *buffer, uint32_t size)
:m_uint8Array(Uint8Array::constructor_().new_(Uint8Array::heap().buffer().m_arrayBuffer, uint32_t(buffer), size))
:m_uint8Array(Uint8Array::constructor_().new_(Uint8Array::heap().buffer().m_arrayBuffer, uintptr_t(buffer), size))
{
}

View File

@ -44,7 +44,7 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas)
// Create the canvas (for the correct document) as a child of the container
m_canvas = containerOrCanvas["ownerDocument"].call<emscripten::val>("createElement", std::string("canvas"));
containerOrCanvas.call<void>("appendChild", m_canvas);
std::string screenId = std::string("qtcanvas_") + std::to_string(uint32_t(this));
std::string screenId = std::string("qtcanvas_") + std::to_string(uintptr_t(this));
m_canvas.set("id", screenId);
// Make the canvas occupy 100% of parent
@ -168,7 +168,7 @@ std::string QWasmScreen::canvasSpecialHtmlTargetId() const
{
// Return a globally unique id for the canvas. We can choose any string,
// as long as it starts with a "!".
return std::string("!qtcanvas_") + std::to_string(uint32_t(this));
return std::string("!qtcanvas_") + std::to_string(uintptr_t(this));
}
namespace {