static void
get_struct_type_field_and_pointer_sizes(size_t *s_field_size,
- size_t *s_field_ptrs,
- unsigned num_fields)
+ size_t *s_field_ptrs)
{
- *s_field_size = sizeof(glsl_struct_field) * num_fields;
+ *s_field_size = sizeof(glsl_struct_field);
*s_field_ptrs =
sizeof(((glsl_struct_field *)0)->type) +
sizeof(((glsl_struct_field *)0)->name);
blob_write_uint32(blob, type->length);
size_t s_field_size, s_field_ptrs;
- get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs,
- type->length);
+ get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs);
for (unsigned i = 0; i < type->length; i++) {
encode_type_to_blob(blob, type->fields.structure[i].type);
unsigned num_fields = blob_read_uint32(blob);
size_t s_field_size, s_field_ptrs;
- get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs,
- num_fields);
+ get_struct_type_field_and_pointer_sizes(&s_field_size, &s_field_ptrs);
glsl_struct_field *fields =
(glsl_struct_field *) malloc(s_field_size * num_fields);