summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-08-01 18:39:21 -0700
committerIan Romanick <[email protected]>2014-08-07 16:17:48 -0700
commit8f81f4e18537fcb7cd1cc5e0dec679d20b7d769c (patch)
treeeaca8ee992fe8679f2e3b5e826a1a760205172de /src/mesa
parent411abcb23751ff57de9843e992647a8e41daab75 (diff)
mesa: Use MAX2 to calculate maximum uniform element
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/uniform_query.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 7b089fa9595..2dc9f273b47 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -282,9 +282,7 @@ validate_uniform_parameters(struct gl_context *ctx,
* If not an array, check that array_index is zero.
* array_index is unsigned so no need to check for less than zero.
*/
- unsigned limit = uni->array_elements;
- if (limit == 0)
- limit = 1;
+ const unsigned limit = MAX2(uni->array_elements, 1);
if (*array_index >= limit) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(location=%d)",
caller, location);