#endif
}
#endif
-
+
value->width = strlen (label->label);
value->s = xmemdup0 (label->label, value->width);
}
spv_legacy_data_decode (const uint8_t *in, size_t size, struct spv_data *out)
{
char *error = NULL;
- memset (out, 0, sizeof *out);
+ *out = (struct spv_data) SPV_DATA_INITIALIZER;
struct spvbin_input input;
spvbin_input_init (&input, in, size);
goto error;
}
- out->sources = xcalloc (lb->n_sources, sizeof *out->sources);
+ out->sources = XCALLOC (lb->n_sources, struct spv_data_source);
out->n_sources = lb->n_sources;
for (size_t i = 0; i < lb->n_sources; i++)
source->n_values = md->n_values;
source->vars = xcalloc (md->n_variables, sizeof *source->vars);
- size_t end;
+ size_t end = -1;
error = decode_data (in, size, md->data_offset, source, &end);
if (error)
goto error;
error:
spv_data_uninit (out);
- memset (out, 0, sizeof *out);
+ *out = (struct spv_data) SPV_DATA_INITIALIZER;
spvob_free_legacy_binary (lb);
return error;
}