summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-05-17 23:01:29 +0100
committerRobert Bragg <robert@linux.intel.com>2012-08-06 14:27:43 +0100
commitaa749bb1772422ad063ffdba2a4ffc78f9b703a2 (patch)
treeed06139ca3f5a6b821cced46d17c7b9d59599dd2
parent6eb8864866babd26149729eac5e4774328b06b7a (diff)
downloadcogl-aa749bb1772422ad063ffdba2a4ffc78f9b703a2.tar.gz
matrix-stack: Fix the _cogl_matrix_entry_equal function
The _cogl_matrix_entry_equal function has a large switch statement to do the right kind of comparison for the entry. However most of the entries have a return statement that is only conditionally reached. There were no corresponding break statements to the case labels so presumably if the comparison succeeded for the correct entry type it would also flow through and try the comparison for the next type which would be extremely unlikely to pass. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 339db0f9cc3ee2bee4c56f9cb05dcb4ddd6815ed)
-rw-r--r--cogl/cogl-matrix-stack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cogl/cogl-matrix-stack.c b/cogl/cogl-matrix-stack.c
index 32b0cd7a..a8b42e7a 100644
--- a/cogl/cogl-matrix-stack.c
+++ b/cogl/cogl-matrix-stack.c
@@ -863,6 +863,7 @@ _cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
translate0->z != translate1->z)
return FALSE;
}
+ break;
case COGL_MATRIX_OP_ROTATE:
{
CoglMatrixEntryRotate *rotate0 =
@@ -875,6 +876,7 @@ _cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
rotate0->z != rotate1->z)
return FALSE;
}
+ break;
case COGL_MATRIX_OP_SCALE:
{
CoglMatrixEntryScale *scale0 = (CoglMatrixEntryScale *)entry0;
@@ -884,6 +886,7 @@ _cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
scale0->z != scale1->z)
return FALSE;
}
+ break;
case COGL_MATRIX_OP_MULTIPLY:
{
CoglMatrixEntryMultiply *mult0 = (CoglMatrixEntryMultiply *)entry0;
@@ -891,6 +894,7 @@ _cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
if (!cogl_matrix_equal (mult0->matrix, mult1->matrix))
return FALSE;
}
+ break;
case COGL_MATRIX_OP_LOAD:
{
CoglMatrixEntryLoad *load0 = (CoglMatrixEntryLoad *)entry0;