[Cogl] [PATCH 2/6] Make cogl_matrix_init_from_quaternion take a const quaternion

Neil Roberts neil at linux.intel.com
Thu May 17 15:40:14 PDT 2012


The quaternion is not modified so for consistency with the rest of the
API it should probably be const.
---
 cogl/cogl-matrix.c |    4 ++--
 cogl/cogl-matrix.h |    4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/cogl/cogl-matrix.c b/cogl/cogl-matrix.c
index ee6f343..154203a 100644
--- a/cogl/cogl-matrix.c
+++ b/cogl/cogl-matrix.c
@@ -1711,7 +1711,7 @@ _cogl_matrix_init_from_matrix_without_inverse (CoglMatrix *matrix,
 
 static void
 _cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
-                                   CoglQuaternion *quaternion)
+                                   const CoglQuaternion *quaternion)
 {
   float qnorm = _COGL_QUATERNION_NORM (quaternion);
   float s = (qnorm > 0.0f) ? (2.0f / qnorm) : 0.0f;
@@ -1746,7 +1746,7 @@ _cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
 
 void
 cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
-                                  CoglQuaternion *quaternion)
+                                  const CoglQuaternion *quaternion)
 {
   _cogl_matrix_init_from_quaternion (matrix, quaternion);
 }
diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h
index 3801597..0c3d31c 100644
--- a/cogl/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
@@ -487,12 +487,10 @@ cogl_matrix_get_array (const CoglMatrix *matrix);
  * @quaternion: A #CoglQuaternion
  *
  * Initializes @matrix from a #CoglQuaternion rotation.
- *
- * Return value: a pointer to the float array
  */
 void
 cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
-                                  CoglQuaternion *quaternion);
+                                  const CoglQuaternion *quaternion);
 #endif
 
 /**
-- 
1.7.3.16.g9464b



More information about the Cogl mailing list