[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27661] trunk/blender/source/blender/ blenlib: Math Lib: make some more vector functions use const arguments.

Brecht Van Lommel brecht at blender.org
Mon Mar 22 16:55:12 CET 2010


Revision: 27661
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27661
Author:   blendix
Date:     2010-03-22 16:55:12 +0100 (Mon, 22 Mar 2010)

Log Message:
-----------
Math Lib: make some more vector functions use const arguments.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_math_vector.h
    trunk/blender/source/blender/blenlib/intern/math_vector_inline.c

Modified: trunk/blender/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_vector.h	2010-03-22 15:50:16 UTC (rev 27660)
+++ trunk/blender/source/blender/blenlib/BLI_math_vector.h	2010-03-22 15:55:12 UTC (rev 27661)
@@ -44,7 +44,7 @@
 
 MINLINE void copy_v2_v2(float r[2], const float a[2]);
 MINLINE void copy_v3_v3(float r[3], const float a[3]);
-MINLINE void copy_v4_v4(float r[4], float a[4]);
+MINLINE void copy_v4_v4(float r[4], const float a[4]);
 
 MINLINE void swap_v2_v2(float a[2], float b[2]);
 MINLINE void swap_v3_v3(float a[3], float b[3]);
@@ -52,14 +52,14 @@
 
 /********************************* Arithmetic ********************************/
 
-MINLINE void add_v2_v2(float r[2], float a[2]);
-MINLINE void add_v2_v2v2(float r[2], float a[2], float b[2]);
-MINLINE void add_v3_v3(float r[3], float a[3]);
-MINLINE void add_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void add_v2_v2(float r[2], const float a[2]);
+MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2]);
+MINLINE void add_v3_v3(float r[3], const float a[3]);
+MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3]);
 
-MINLINE void sub_v2_v2(float r[2], float a[2]);
-MINLINE void sub_v2_v2v2(float r[2], float a[2], float b[2]);
-MINLINE void sub_v3_v3(float r[3], float a[3]);
+MINLINE void sub_v2_v2(float r[2], const float a[2]);
+MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2]);
+MINLINE void sub_v3_v3(float r[3], const float a[3]);
 MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]);
 
 MINLINE void mul_v2_fl(float r[2], float f);
@@ -67,14 +67,14 @@
 MINLINE void mul_v3_fl(float r[3], float f);
 MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f);
 MINLINE void mul_v2_v2(float r[2], const float a[2]);
-MINLINE void mul_v3_v3(float r[3], float a[3]);
-MINLINE void mul_v3_v3v3(float r[3], float a[3], float b[3]);
+MINLINE void mul_v3_v3(float r[3], const float a[3]);
+MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3]);
 
-MINLINE void madd_v3_v3fl(float r[3], float a[3], float f);
-MINLINE void madd_v3_v3v3(float r[3], float a[3], float b[3]);
-MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], const float f);
-MINLINE void madd_v3_v3v3fl(float r[3], float a[3], float b[3], float f);
-MINLINE void madd_v3_v3v3v3(float r[3], float a[3], float b[3], float c[3]);
+MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f);
+MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3]);
+MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f);
+MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f);
+MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
 
 MINLINE void negate_v3(float r[3]);
 MINLINE void negate_v3_v3(float r[3], const float a[3]);

Modified: trunk/blender/source/blender/blenlib/intern/math_vector_inline.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_vector_inline.c	2010-03-22 15:50:16 UTC (rev 27660)
+++ trunk/blender/source/blender/blenlib/intern/math_vector_inline.c	2010-03-22 15:55:12 UTC (rev 27661)
@@ -66,7 +66,7 @@
 	r[2]= a[2];
 }
 
-MINLINE void copy_v4_v4(float r[4], float a[4])
+MINLINE void copy_v4_v4(float r[4], const float a[4])
 {
 	r[0]= a[0];
 	r[1]= a[1];
@@ -97,45 +97,45 @@
 
 /********************************* Arithmetic ********************************/
 
-MINLINE void add_v2_v2(float *r, float *a)
+MINLINE void add_v2_v2(float *r, const float *a)
 {
 	r[0] += a[0];
 	r[1] += a[1];
 }
 
-MINLINE void add_v2_v2v2(float *r, float *a, float *b)
+MINLINE void add_v2_v2v2(float *r, const float *a, const float *b)
 {
 	r[0]= a[0] + b[0];
 	r[1]= a[1] + b[1];
 }
 
-MINLINE void add_v3_v3(float *r, float *a)
+MINLINE void add_v3_v3(float *r, const float *a)
 {
 	r[0] += a[0];
 	r[1] += a[1];
 	r[2] += a[2];
 }
 
-MINLINE void add_v3_v3v3(float *r, float *a, float *b)
+MINLINE void add_v3_v3v3(float *r, const float *a, const float *b)
 {
 	r[0]= a[0] + b[0];
 	r[1]= a[1] + b[1];
 	r[2]= a[2] + b[2];
 }
 
-MINLINE void sub_v2_v2(float *r, float *a)
+MINLINE void sub_v2_v2(float *r, const float *a)
 {
 	r[0] -= a[0];
 	r[1] -= a[1];
 }
 
-MINLINE void sub_v2_v2v2(float *r, float *a, float *b)
+MINLINE void sub_v2_v2v2(float *r, const float *a, const float *b)
 {
 	r[0]= a[0] - b[0];
 	r[1]= a[1] - b[1];
 }
 
-MINLINE void sub_v3_v3(float *r, float *a)
+MINLINE void sub_v3_v3(float *r, const float *a)
 {
 	r[0] -= a[0];
 	r[1] -= a[1];
@@ -181,48 +181,48 @@
 	r[1] *= a[1];
 }
 
-MINLINE void mul_v3_v3(float r[3], float a[3])
+MINLINE void mul_v3_v3(float r[3], const float a[3])
 {
 	r[0] *= a[0];
 	r[1] *= a[1];
 	r[2] *= a[2];
 }
 
-MINLINE void madd_v3_v3fl(float r[3], float a[3], float f)
+MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
 {
 	r[0] += a[0]*f;
 	r[1] += a[1]*f;
 	r[2] += a[2]*f;
 }
 
-MINLINE void madd_v3_v3v3(float r[3], float a[3], float b[3])
+MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3])
 {
 	r[0] += a[0]*b[0];
 	r[1] += a[1]*b[1];
 	r[2] += a[2]*b[2];
 }
 
-MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], const float f)
+MINLINE void madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
 {
 	r[0] = a[0] + b[0]*f;
 	r[1] = a[1] + b[1]*f;
 }
 
-MINLINE void madd_v3_v3v3fl(float r[3], float a[3], float b[3], float f)
+MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
 {
 	r[0] = a[0] + b[0]*f;
 	r[1] = a[1] + b[1]*f;
 	r[2] = a[2] + b[2]*f;
 }
 
-MINLINE void madd_v3_v3v3v3(float r[3], float a[3], float b[3], float c[3])
+MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
 {
 	r[0] = a[0] + b[0]*c[0];
 	r[1] = a[1] + b[1]*c[1];
 	r[2] = a[2] + b[2]*c[2];
 }
 
-MINLINE void mul_v3_v3v3(float *v, float *v1, float *v2)
+MINLINE void mul_v3_v3v3(float *v, const float *v1, const float *v2)
 {
 	v[0] = v1[0] * v2[0];
 	v[1] = v1[1] * v2[1];





More information about the Bf-blender-cvs mailing list