diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-02 16:12:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-02 16:12:30 +0300 |
commit | 369a5cc29e80d0ac30f9db444f2c0f9c1da32e01 (patch) | |
tree | e6510d985b37ef027e5614da8b5479a2d95c7a92 /source/blender/blenlib | |
parent | 5d7ed88f17c7a253c81ee48c147149d73dd88e6a (diff) |
fix for compiling with the c90 standard, support for non-static variable initializers is a c99 feature.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 20 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 36 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_rotation.c | 8 |
3 files changed, 52 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index c2e765388c8..88ca739a39e 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1651,11 +1651,21 @@ void window_translate_m4(float winmat[][4], float perspmat[][4], float x, float { if(winmat[2][3] == -1.0f) { /* in the case of a win-matrix, this means perspective always */ - float v1[3]= {perspmat[0][0], perspmat[1][0], perspmat[2][0]}; - float v2[3]= {perspmat[0][1], perspmat[1][1], perspmat[2][1]}; - float len1= (1.0f / len_v3(v1)); - float len2= (1.0f / len_v3(v2)); - + float v1[3]; + float v2[3]; + float len1, len2; + + v1[0]= perspmat[0][0]; + v1[1]= perspmat[1][0]; + v1[2]= perspmat[2][0]; + + v2[0]= perspmat[0][1]; + v2[1]= perspmat[1][1]; + v2[2]= perspmat[2][1]; + + len1= (1.0f / len_v3(v1)); + len2= (1.0f / len_v3(v2)); + winmat[2][0] += len1 * winmat[0][0] * x; winmat[2][1] += len2 * winmat[1][1] * y; } diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index aadd08f0c90..58fb3b9b76b 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -609,7 +609,11 @@ void orthogonalize_m3(float mat[][3], int axis) normalize_v3(mat[1]); cross_v3_v3v3(mat[2], mat[0], mat[1]); } else { - float vec[3] = {mat[0][1], mat[0][2], mat[0][0]}; + float vec[3]; + + vec[0]= mat[0][1]; + vec[1]= mat[0][2]; + vec[2]= mat[0][0]; cross_v3_v3v3(mat[2], mat[0], vec); normalize_v3(mat[2]); @@ -625,7 +629,11 @@ void orthogonalize_m3(float mat[][3], int axis) normalize_v3(mat[0]); cross_v3_v3v3(mat[2], mat[0], mat[1]); } else { - float vec[3] = {mat[1][1], mat[1][2], mat[1][0]}; + float vec[3]; + + vec[0]= mat[1][1]; + vec[1]= mat[1][2]; + vec[2]= mat[1][0]; cross_v3_v3v3(mat[0], mat[1], vec); normalize_v3(mat[0]); @@ -641,7 +649,11 @@ void orthogonalize_m3(float mat[][3], int axis) normalize_v3(mat[0]); cross_v3_v3v3(mat[1], mat[2], mat[0]); } else { - float vec[3] = {mat[2][1], mat[2][2], mat[2][0]}; + float vec[3]; + + vec[0]= mat[2][1]; + vec[1]= mat[2][2]; + vec[2]= mat[2][0]; cross_v3_v3v3(mat[0], vec, mat[2]); normalize_v3(mat[0]); @@ -670,7 +682,11 @@ void orthogonalize_m4(float mat[][4], int axis) normalize_v3(mat[1]); cross_v3_v3v3(mat[2], mat[0], mat[1]); } else { - float vec[3] = {mat[0][1], mat[0][2], mat[0][0]}; + float vec[3]; + + vec[0]= mat[0][1]; + vec[1]= mat[0][2]; + vec[2]= mat[0][0]; cross_v3_v3v3(mat[2], mat[0], vec); normalize_v3(mat[2]); @@ -687,7 +703,11 @@ void orthogonalize_m4(float mat[][4], int axis) normalize_v3(mat[0]); cross_v3_v3v3(mat[2], mat[0], mat[1]); } else { - float vec[3] = {mat[1][1], mat[1][2], mat[1][0]}; + float vec[3]; + + vec[0]= mat[1][1]; + vec[1]= mat[1][2]; + vec[2]= mat[1][0]; cross_v3_v3v3(mat[0], mat[1], vec); normalize_v3(mat[0]); @@ -703,7 +723,11 @@ void orthogonalize_m4(float mat[][4], int axis) normalize_v3(mat[0]); cross_v3_v3v3(mat[1], mat[2], mat[0]); } else { - float vec[3] = {mat[2][1], mat[2][2], mat[2][0]}; + float vec[3]; + + vec[0]= mat[2][1]; + vec[1]= mat[2][2]; + vec[2]= mat[2][0]; cross_v3_v3v3(mat[0], vec, mat[2]); normalize_v3(mat[0]); diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index af537af8ccf..2d0e347b2e6 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -121,7 +121,13 @@ void mul_qt_fl(float *q, const float f) void sub_qt_qtqt(float q[4], const float q1[4], const float q2[4]) { - const float nq2[4]= {-q2[0], q2[1], q2[2], q2[3]}; + float nq2[4]; + + nq2[0]= -q2[0]; + nq2[1]= q2[1]; + nq2[2]= q2[2]; + nq2[3]= q2[3]; + mul_qt_qtqt(q, q1, nq2); } |