<div dir="ltr">Looks good to me :) Reviewed-by: Plamena Manolova <<a href="mailto:plamena.manolova@intel.com">plamena.manolova@intel.com</a>></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 1:30 AM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
This is C++, so we can mix code and declarations. Doing so allows<br>
constification.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
---<br>
src/mesa/main/uniform_query.<wbr>cpp | 12 ++++--------<br>
1 file changed, 4 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/mesa/main/uniform_query.<wbr>cpp b/src/mesa/main/uniform_query.<wbr>cpp<br>
index d5a2d0f..c2429c1 100644<br>
--- a/src/mesa/main/uniform_query.<wbr>cpp<br>
+++ b/src/mesa/main/uniform_query.<wbr>cpp<br>
@@ -992,10 +992,6 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,<br>
const GLvoid *values, enum glsl_base_type basicType)<br>
{<br>
unsigned offset;<br>
- unsigned vectors;<br>
- unsigned components;<br>
- unsigned elements;<br>
- int size_mul;<br>
struct gl_uniform_storage *const uni =<br>
validate_uniform_parameters(<wbr>ctx, shProg, location, count,<br>
&offset, "glUniformMatrix");<br>
@@ -1009,11 +1005,11 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,<br>
}<br>
<br>
assert(basicType == GLSL_TYPE_FLOAT || basicType == GLSL_TYPE_DOUBLE);<br>
- size_mul = basicType == GLSL_TYPE_DOUBLE ? 2 : 1;<br>
+ const unsigned size_mul = basicType == GLSL_TYPE_DOUBLE ? 2 : 1;<br>
<br>
assert(!uni->type->is_sampler(<wbr>));<br>
- vectors = uni->type->matrix_columns;<br>
- components = uni->type->vector_elements;<br>
+ const unsigned vectors = uni->type->matrix_columns;<br>
+ const unsigned components = uni->type->vector_elements;<br>
<br>
/* Verify that the types are compatible. This is greatly simplified for<br>
* matrices because they can only have a float base type.<br>
@@ -1084,7 +1080,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,<br>
<br>
/* Store the data in the "actual type" backing storage for the uniform.<br>
*/<br>
- elements = components * vectors;<br>
+ const unsigned elements = components * vectors;<br>
<br>
if (!transpose) {<br>
memcpy(&uni->storage[size_mul * elements * offset], values,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>