util: fix uninitialized table
authorDylan Noblesmith <nobled@dreamwidth.org>
Sun, 1 Apr 2012 18:35:29 +0000 (18:35 +0000)
committerDylan Noblesmith <nobled@dreamwidth.org>
Fri, 13 Apr 2012 14:25:07 +0000 (14:25 +0000)
commit520521e3809a36201582fa48ee173eba12e97812
tree0d1e3de8f031ffad55c5c1f5a5bae335c2325725
parentccff74971203b533bf16b46b49a9e61753f75e6c
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 <brianp@vmware.com>
src/gallium/auxiliary/util/u_linkage.h
src/gallium/drivers/nvfx/nvfx_fragprog.c