From: Henri Verbeet hverbeet@codeweavers.com
--- libs/vkd3d-shader/dxbc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 63deaaad2..661625273 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -130,13 +130,13 @@ static void skip_dword_unknown(const char **ptr, unsigned int count) } }
-static const char *shader_get_string(const char *data, size_t data_size, DWORD offset) +static const char *shader_get_string(const char *data, size_t data_size, size_t offset) { size_t len, max_len;
if (offset >= data_size) { - WARN("Invalid offset %#x (data size %#lx).\n", offset, (long)data_size); + WARN("Invalid offset %#zx (data size %#zx).\n", offset, data_size); return NULL; }
@@ -399,7 +399,8 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s
for (i = 0; i < count; ++i) { - uint32_t name_offset, mask; + size_t name_offset; + uint32_t mask;
e[i].sort_index = i;
@@ -411,7 +412,7 @@ static int shader_parse_signature(const struct vkd3d_shader_dxbc_section_desc *s name_offset = read_u32(&ptr); if (!(e[i].semantic_name = shader_get_string(data, section->data.size, name_offset))) { - WARN("Invalid name offset %#x (data size %#zx).\n", name_offset, section->data.size); + WARN("Invalid name offset %#zx (data size %#zx).\n", name_offset, section->data.size); vkd3d_free(e); return VKD3D_ERROR_INVALID_ARGUMENT; }
From: Henri Verbeet hverbeet@codeweavers.com
--- libs/vkd3d-shader/dxbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 661625273..5ec1977ca 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -845,7 +845,7 @@ static int shader_parse_root_parameters(struct root_signature_parser_context *co }
static int shader_parse_root_parameters1(struct root_signature_parser_context *context, - uint32_t offset, DWORD count, struct vkd3d_shader_root_parameter1 *parameters) + uint32_t offset, unsigned int count, struct vkd3d_shader_root_parameter1 *parameters) { const char *ptr; unsigned int i;
From: Henri Verbeet hverbeet@codeweavers.com
--- libs/vkd3d-shader/dxbc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 5ec1977ca..ed8a49a0e 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -230,7 +230,7 @@ static int parse_dxbc(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_ chunk_offset = read_u32(&ptr); TRACE("chunk %u at offset %#x\n", i, chunk_offset);
- if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(DWORD), data_size)) + if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(uint32_t), data_size)) { WARN("Invalid chunk offset %#x (data size %zu).\n", chunk_offset, data_size); vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET, @@ -593,7 +593,7 @@ static int shader_parse_descriptor_ranges(struct root_signature_parser_context * const char *ptr; unsigned int i;
- if (!require_space(offset, 5 * count, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 5 * count, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u, count %u).\n", context->data_size, offset, count); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -671,7 +671,7 @@ static int shader_parse_descriptor_table(struct root_signature_parser_context *c unsigned int count; const char *ptr;
- if (!require_space(offset, 2, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 2, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u).\n", context->data_size, offset); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -698,7 +698,7 @@ static int shader_parse_descriptor_table1(struct root_signature_parser_context * unsigned int count; const char *ptr;
- if (!require_space(offset, 2, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 2, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u).\n", context->data_size, offset); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -723,7 +723,7 @@ static int shader_parse_root_constants(struct root_signature_parser_context *con { const char *ptr;
- if (!require_space(offset, 3, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 3, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u).\n", context->data_size, offset); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -745,7 +745,7 @@ static int shader_parse_root_descriptor(struct root_signature_parser_context *co { const char *ptr;
- if (!require_space(offset, 2, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 2, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u).\n", context->data_size, offset); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -777,7 +777,7 @@ static int shader_parse_root_descriptor1(struct root_signature_parser_context *c { const char *ptr;
- if (!require_space(offset, 3, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 3, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u).\n", context->data_size, offset); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -803,7 +803,7 @@ static int shader_parse_root_parameters(struct root_signature_parser_context *co unsigned int i; int ret;
- if (!require_space(offset, 3 * count, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 3 * count, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u, count %u).\n", context->data_size, offset, count); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -851,7 +851,7 @@ static int shader_parse_root_parameters1(struct root_signature_parser_context *c unsigned int i; int ret;
- if (!require_space(offset, 3 * count, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 3 * count, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u, count %u).\n", context->data_size, offset, count); return VKD3D_ERROR_INVALID_ARGUMENT; @@ -898,7 +898,7 @@ static int shader_parse_static_samplers(struct root_signature_parser_context *co const char *ptr; unsigned int i;
- if (!require_space(offset, 13 * count, sizeof(DWORD), context->data_size)) + if (!require_space(offset, 13 * count, sizeof(uint32_t), context->data_size)) { WARN("Invalid data size %#x (offset %u, count %u).\n", context->data_size, offset, count); return VKD3D_ERROR_INVALID_ARGUMENT;