Fix oss-fuzz build failure A warning of a uint64_t -> size_t is causing the build to fail on 32-bit builds Bug: oss-fuzz:45451 Change-Id: Iffaf2818d187b0659c10bd75229bb7c03f4f69df Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/83841 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/sem/bool_type.cc b/src/tint/sem/bool_type.cc index c8027a4..d42f687 100644 --- a/src/tint/sem/bool_type.cc +++ b/src/tint/sem/bool_type.cc
@@ -28,7 +28,7 @@ Bool::~Bool() = default; size_t Bool::Hash() const { - return TypeInfo::Of<Bool>().full_hashcode; + return static_cast<size_t>(TypeInfo::Of<Bool>().full_hashcode); } bool Bool::Equals(const Type& other) const {
diff --git a/src/tint/sem/external_texture_type.cc b/src/tint/sem/external_texture_type.cc index 1abe825..885bbae 100644 --- a/src/tint/sem/external_texture_type.cc +++ b/src/tint/sem/external_texture_type.cc
@@ -28,7 +28,7 @@ ExternalTexture::~ExternalTexture() = default; size_t ExternalTexture::Hash() const { - return TypeInfo::Of<ExternalTexture>().full_hashcode; + return static_cast<size_t>(TypeInfo::Of<ExternalTexture>().full_hashcode); } bool ExternalTexture::Equals(const sem::Type& other) const {
diff --git a/src/tint/sem/f32_type.cc b/src/tint/sem/f32_type.cc index 62b964d..2e666d5 100644 --- a/src/tint/sem/f32_type.cc +++ b/src/tint/sem/f32_type.cc
@@ -28,7 +28,7 @@ F32::~F32() = default; size_t F32::Hash() const { - return TypeInfo::Of<F32>().full_hashcode; + return static_cast<size_t>(TypeInfo::Of<F32>().full_hashcode); } bool F32::Equals(const Type& other) const {
diff --git a/src/tint/sem/i32_type.cc b/src/tint/sem/i32_type.cc index 4631513..47cd5a6 100644 --- a/src/tint/sem/i32_type.cc +++ b/src/tint/sem/i32_type.cc
@@ -28,7 +28,7 @@ I32::~I32() = default; size_t I32::Hash() const { - return TypeInfo::Of<I32>().full_hashcode; + return static_cast<size_t>(TypeInfo::Of<I32>().full_hashcode); } bool I32::Equals(const Type& other) const {
diff --git a/src/tint/sem/u32_type.cc b/src/tint/sem/u32_type.cc index 60bff9d..1580148 100644 --- a/src/tint/sem/u32_type.cc +++ b/src/tint/sem/u32_type.cc
@@ -28,7 +28,7 @@ U32::U32(U32&&) = default; size_t U32::Hash() const { - return TypeInfo::Of<U32>().full_hashcode; + return static_cast<size_t>(TypeInfo::Of<U32>().full_hashcode); } bool U32::Equals(const Type& other) const {
diff --git a/src/tint/sem/void_type.cc b/src/tint/sem/void_type.cc index ff7e79e..e366e81 100644 --- a/src/tint/sem/void_type.cc +++ b/src/tint/sem/void_type.cc
@@ -28,7 +28,7 @@ Void::~Void() = default; size_t Void::Hash() const { - return TypeInfo::Of<Void>().full_hashcode; + return static_cast<size_t>(TypeInfo::Of<Void>().full_hashcode); } bool Void::Equals(const Type& other) const {