From 1096b345984c799aed3a0349c9f420585f129427 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Mon, 16 Sep 2024 22:20:09 -0700 Subject: [PATCH] Use UINT32_MAX/UINT64_MAX for constants --- gen/gen.go | 4 ++-- webgpu.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gen/gen.go b/gen/gen.go index 0aff1dda..9993d17a 100644 --- a/gen/gen.go +++ b/gen/gen.go @@ -85,9 +85,9 @@ func (g *Generator) CValue(s string) (string, error) { case "usize_max": return "SIZE_MAX", nil case "uint32_max": - return "0xffffffffUL", nil + return "UINT32_MAX", nil case "uint64_max": - return "0xffffffffffffffffULL", nil + return "UINT64_MAX", nil default: var num string var base int diff --git a/webgpu.h b/webgpu.h index 496d3aed..267a3dd2 100644 --- a/webgpu.h +++ b/webgpu.h @@ -62,15 +62,15 @@ * * @{ */ -#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) -#define WGPU_DEPTH_SLICE_UNDEFINED (0xffffffffUL) -#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) -#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL) -#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL) -#define WGPU_QUERY_SET_INDEX_UNDEFINED (0xffffffffUL) +#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (UINT32_MAX) +#define WGPU_COPY_STRIDE_UNDEFINED (UINT32_MAX) +#define WGPU_DEPTH_SLICE_UNDEFINED (UINT32_MAX) +#define WGPU_LIMIT_U32_UNDEFINED (UINT32_MAX) +#define WGPU_LIMIT_U64_UNDEFINED (UINT64_MAX) +#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (UINT32_MAX) +#define WGPU_QUERY_SET_INDEX_UNDEFINED (UINT32_MAX) #define WGPU_WHOLE_MAP_SIZE (SIZE_MAX) -#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) +#define WGPU_WHOLE_SIZE (UINT64_MAX) /** @} */