[Mesa-dev] [PATCH 3/6] glsl: always define data_end union as we always use it on line 369

Brian Paul brian.e.paul at gmail.com
Tue Dec 27 08:35:35 PST 2011


On Tue, Dec 27, 2011 at 8:41 AM, Alexander von Gluck
<kallisti5 at unixzen.com> wrote:
>
> ---
>  src/glsl/link_uniforms.cpp |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
> index c7de480..fc1c1f7 100644
> --- a/src/glsl/link_uniforms.cpp
> +++ b/src/glsl/link_uniforms.cpp
> @@ -336,9 +336,7 @@ link_assign_uniform_locations(struct gl_shader_program
> *prog)
>       rzalloc_array(prog, struct gl_uniform_storage, num_user_uniforms);
>    union gl_constant_value *data =
>       rzalloc_array(uniforms, union gl_constant_value, num_data_slots);
> -#ifndef NDEBUG
>    union gl_constant_value *data_end = &data[num_data_slots];
> -#endif
>
>    parcel_out_uniform_storage parcel(prog->UniformHash, uniforms, data);
>

How about moving the assert that uses data_end into the #ifndef NDEBUG
test seen above it?

diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index c7de480..b331db7 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -365,9 +365,9 @@ link_assign_uniform_locations(struct gl_shader_program *prog
    for (unsigned i = 0; i < num_user_uniforms; i++) {
       assert(uniforms[i].storage != NULL);
    }
-#endif

    assert(parcel.values == data_end);
+#endif

    prog->NumUserUniformStorage = num_user_uniforms;
    prog->UniformStorage = uniforms;


-Brian


More information about the mesa-dev mailing list