Mesa (master): glsl: Fix inverted conditional in error message.

Matt Turner mattst88 at kemper.freedesktop.org
Fri Jul 12 03:58:31 UTC 2013


Module: Mesa
Branch: master
Commit: 46b74ca7bc06ce092136cd313fd963e82be06b00
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=46b74ca7bc06ce092136cd313fd963e82be06b00

Author: Matt Turner <mattst88 at gmail.com>
Date:   Mon Jun 10 13:28:40 2013 -0700

glsl: Fix inverted conditional in error message.

The code float a[2] = float[2]( 3.4, 4.2, 5.0 ); previously generated
this:

   error: array constructor must have at least 2 parameters

when in fact it requires exactly two.

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romainck at intel.com>

---

 src/glsl/ast_function.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 0860238..4b0b873 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -648,7 +648,7 @@ process_array_constructor(exec_list *instructions,
 
       _mesa_glsl_error(loc, state, "array constructor must have %s %u "
 		       "parameter%s",
-		       (constructor_type->length != 0) ? "at least" : "exactly",
+		       (constructor_type->length == 0) ? "at least" : "exactly",
 		       min_param, (min_param <= 1) ? "" : "s");
       return ir_rvalue::error_value(ctx);
    }




More information about the mesa-commit mailing list