[Mesa-dev] [PATCH 9/9] egl-static: fix printf warning

2012-04-01 Thread nobled
Noticed by clang: egl_st.c:57:50: warning: field precision should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat] ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT, ~~^~ NOTE: This is a candidate for

[Mesa-dev] [PATCH 8/9] st/vega: fix uninitialized values

2012-04-01 Thread nobled
C still treats array arguments exactly like pointer arguments. By sheer coincidence, this still worked fine on 64-bit machines where 2 * sizeof(float) == sizeof(void*), but not on 32-bit. Noticed by clang: text.c:76:51: warning: sizeof on array function parameter will return size of 'const VGfloa

[Mesa-dev] [PATCH 7/9] st/vega: silence enum cast warnings

2012-04-01 Thread nobled
clang warns on these: stroker.c:626:19: warning: implicit conversion from enumeration type 'VGPathCommand' to different enumeration type 'VGPathSegment' [-Wconversion] No change in the underlying value. --- src/gallium/state_trackers/vega/stroker.c |9 + 1 files changed, 5 insertions

[Mesa-dev] [PATCH 6/9] i965: fix typo

2012-04-01 Thread nobled
Noticed by clang: brw_wm_surface_state.c:330:30: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] [MESA_FORMAT_Z24_S8] = 0, ^ brw_wm_surface_state.c:326:30: note: previous initialization is here [MESA_FORMAT_Z2

[Mesa-dev] [PATCH 5/9] mesa: fix truncated value warning

2012-04-01 Thread nobled
Silences a clang warning: format_pack.c:2546:30: warning: implicit conversion from 'int' to 'GLubyte' (aka 'unsigned char') changes value from 65535 to 255 [-Wconstant-conversion] d[i] = d[i] ? 0x : 0x0; ~ ^~ --- src/mesa/main/format_pack.c |2

[Mesa-dev] [PATCH 4/9] mesa: delete tautological compare

2012-04-01 Thread nobled
Noticed by clang: main/extensions.c:934:14: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (index < 0) ~ ^ ~ Also don't cast away const needlessly in this function. --- src/mesa/main/extensions.c |5 + 1 files changed, 1 insertion

[Mesa-dev] [PATCH 3/9] egl: fix uninitialized values

2012-04-01 Thread nobled
Noticed by clang: eglimage.c:48:28: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess] memset(attrs, 0, sizeof(attrs)); ~^ NOTE: This is a candidate for the 8.0 bra

[Mesa-dev] [PATCH 2/9] util: fix uninitialized table

2012-04-01 Thread nobled
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;

[Mesa-dev] [PATCH 1/9] util: fix undefined behavior

2012-04-01 Thread nobled
container_of() can legally return anything, even invalid addresses that cause segfaults, when 'sample' is an uninitialized pointer. Bug exposed by clang. NOTE: This is a candidate for the 8.0 branch. --- src/gallium/auxiliary/util/u_double_list.h | 15 ++- 1 files changed, 10 inser