[gnome-color-manager] trivial: add gcm_vec3_init() for future code



commit 9408d577f19f3c64a55f6919192bff73efb7681b
Author: Richard Hughes <richard hughsie com>
Date:   Fri Sep 24 23:30:46 2010 +0100

    trivial: add gcm_vec3_init() for future code

 libcolor-glib/gcm-math.c |   19 +++++++++++++++++++
 libcolor-glib/gcm-math.h |    4 ++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/libcolor-glib/gcm-math.c b/libcolor-glib/gcm-math.c
index 3615ecf..25a5c54 100644
--- a/libcolor-glib/gcm-math.c
+++ b/libcolor-glib/gcm-math.c
@@ -48,6 +48,25 @@ gcm_vec3_clear (GcmVec3 *src)
 }
 
 /**
+ * gcm_vec3_init:
+ * @dest: the destination vector
+ * @v0: component value
+ * @v1: component value
+ * @v2: component value
+ *
+ * Initialises a vector.
+ **/
+void
+gcm_vec3_init (GcmVec3 *dest, gdouble v0, gdouble v1, gdouble v2)
+{
+	g_return_if_fail (dest != NULL);
+
+	dest->v0 = v0;
+	dest->v1 = v1;
+	dest->v2 = v2;
+}
+
+/**
  * gcm_vec3_scalar_multiply:
  * @src: the source
  * @value: the scalar multiplier
diff --git a/libcolor-glib/gcm-math.h b/libcolor-glib/gcm-math.h
index f561871..c30ca13 100644
--- a/libcolor-glib/gcm-math.h
+++ b/libcolor-glib/gcm-math.h
@@ -52,6 +52,10 @@ void		 gcm_vec3_scalar_multiply	(const GcmVec3		*src,
 						 GcmVec3		*dest);
 gchar		*gcm_vec3_to_string		(const GcmVec3		*src);
 gdouble		*gcm_vec3_get_data		(const GcmVec3		*src);
+void		 gcm_vec3_init			(GcmVec3		*dest,
+						 gdouble		 v0,
+						 gdouble		 v1,
+						 gdouble		 v2);
 void		 gcm_mat33_clear		(const GcmMat3x3	*src);
 gchar		*gcm_mat33_to_string		(const GcmMat3x3	*src);
 gdouble		*gcm_mat33_get_data		(const GcmMat3x3	*src);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]