[cogl] matrix-stack: Fix the _cogl_matrix_entry_equal function
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] matrix-stack: Fix the _cogl_matrix_entry_equal function
- Date: Fri, 18 May 2012 14:42:05 +0000 (UTC)
commit 339db0f9cc3ee2bee4c56f9cb05dcb4ddd6815ed
Author: Neil Roberts <neil linux intel com>
Date: Thu May 17 23:01:29 2012 +0100
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>
cogl/cogl-matrix-stack.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-matrix-stack.c b/cogl/cogl-matrix-stack.c
index 32b0cd7..a8b42e7 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]