diff options
author | Marek Olšák <[email protected]> | 2019-11-04 21:29:56 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-11-21 18:49:57 -0500 |
commit | 0b1452ffddb52cd6ff119fea341d01d0181950ed (patch) | |
tree | b40272495c70cb7cae18fac40055fc707d7e14c7 /src/compiler | |
parent | ff71fae4403269c6ecd99cf15fa03a7a54355626 (diff) |
nir/serialize: do ctx = {0} instead of manual initializations
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_serialize.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_serialize.c b/src/compiler/nir/nir_serialize.c index b8422209e7d..8a09299fa0e 100644 --- a/src/compiler/nir/nir_serialize.c +++ b/src/compiler/nir/nir_serialize.c @@ -1145,9 +1145,8 @@ read_function(read_ctx *ctx) void nir_serialize(struct blob *blob, const nir_shader *nir, bool strip) { - write_ctx ctx; + write_ctx ctx = {0}; ctx.remap_table = _mesa_pointer_hash_table_create(NULL); - ctx.next_idx = 0; ctx.blob = blob; ctx.nir = nir; ctx.strip = strip; @@ -1207,12 +1206,11 @@ nir_deserialize(void *mem_ctx, const struct nir_shader_compiler_options *options, struct blob_reader *blob) { - read_ctx ctx; + read_ctx ctx = {0}; ctx.blob = blob; list_inithead(&ctx.phi_srcs); ctx.idx_table_len = blob_read_uint32(blob); ctx.idx_table = calloc(ctx.idx_table_len, sizeof(uintptr_t)); - ctx.next_idx = 0; uint32_t strings = blob_read_uint32(blob); char *name = (strings & 0x1) ? blob_read_string(blob) : NULL; |