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>
This commit is contained in:
Lorn Potter 2022-08-24 10:43:21 +10:00
parent f832c707ca
commit d3be345a36
2 changed files with 3 additions and 3 deletions

View File

@ -514,7 +514,7 @@ Uint8Array::Uint8Array(const ArrayBuffer &buffer, uint32_t offset, uint32_t leng
// Constructs a Uint8Array which references an area on the heap. // Constructs a Uint8Array which references an area on the heap.
Uint8Array::Uint8Array(const char *buffer, uint32_t size) 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

@ -38,7 +38,7 @@ QWasmScreen::QWasmScreen(const emscripten::val &containerOrCanvas)
// Create the canvas (for the correct document) as a child of the container // Create the canvas (for the correct document) as a child of the container
m_canvas = containerOrCanvas["ownerDocument"].call<emscripten::val>("createElement", std::string("canvas")); m_canvas = containerOrCanvas["ownerDocument"].call<emscripten::val>("createElement", std::string("canvas"));
containerOrCanvas.call<void>("appendChild", m_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); m_canvas.set("id", screenId);
// Make the canvas occupy 100% of parent // Make the canvas occupy 100% of parent
@ -171,7 +171,7 @@ std::string QWasmScreen::canvasSpecialHtmlTargetId() const
{ {
// Return a globally unique id for the canvas. We can choose any string, // Return a globally unique id for the canvas. We can choose any string,
// as long as it starts with a "!". // 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));
} }
bool QWasmScreen::hasSpecialHtmlTargets() const bool QWasmScreen::hasSpecialHtmlTargets() const