diff options
author | Dylan Noblesmith <[email protected]> | 2012-04-01 18:35:29 +0000 |
---|---|---|
committer | Dylan Noblesmith <[email protected]> | 2012-04-13 14:25:07 +0000 |
commit | 520521e3809a36201582fa48ee173eba12e97812 (patch) | |
tree | 0d1e3de8f031ffad55c5c1f5a5bae335c2325725 /src/gallium/drivers/nvfx | |
parent | ccff74971203b533bf16b46b49a9e61753f75e6c (diff) |
util: fix uninitialized table
Most of the 256 values in the 'generic_to_slot' table were supposed to
be initialized with the default value 0xff, but were left at zero
(from CALLOC_STRUCT()) instead.
Noticed by clang:
u_linkage.h:60:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination;
did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
memset(table, 0xff, sizeof(table));
~~~~~ ^~~~~
Also fix a signed/unsigned comparison and a comment typo here.
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nvfx')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_fragprog.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_fragprog.c b/src/gallium/drivers/nvfx/nvfx_fragprog.c index dbd7c773465..0babcbb9978 100644 --- a/src/gallium/drivers/nvfx/nvfx_fragprog.c +++ b/src/gallium/drivers/nvfx/nvfx_fragprog.c @@ -977,7 +977,8 @@ nvfx_fragprog_prepare(struct nvfx_context* nvfx, struct nvfx_fpc *fpc) if(fpc->fp->num_slots > num_texcoords) return FALSE; util_semantic_layout_from_set(fpc->fp->slot_to_generic, &set, 0, num_texcoords); - util_semantic_table_from_layout(fpc->generic_to_slot, fpc->fp->slot_to_generic, 0, num_texcoords); + util_semantic_table_from_layout(fpc->generic_to_slot, sizeof fpc->generic_to_slot, + fpc->fp->slot_to_generic, 0, num_texcoords); memset(fpc->fp->slot_to_fp_input, 0xff, sizeof(fpc->fp->slot_to_fp_input)); |