From 06aaf8471b1185e5c132068feb9bede797c5ded0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 28 Jun 2015 15:43:43 +0200 Subject: Fix FTBFS with clang [taken from NetBSD kdeartwork3 patches] (cherry picked from commit 23c3263f1b2b48b729f3877e93abcd9788d7893f) --- tdescreensaver/kdesavers/rotation.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'tdescreensaver/kdesavers/rotation.cpp') diff --git a/tdescreensaver/kdesavers/rotation.cpp b/tdescreensaver/kdesavers/rotation.cpp index 9d9a1442..a00f7bbc 100644 --- a/tdescreensaver/kdesavers/rotation.cpp +++ b/tdescreensaver/kdesavers/rotation.cpp @@ -123,9 +123,9 @@ std::valarray EulerOdeSolver::f( ypr[2] = -(B-A)/C * omega_body[0] * omega_body[1]; // r' // e1', e2', e3' - ypr[std::slice(3,3,1)] = vec3::crossprod(omega, e1); - ypr[std::slice(6,3,1)] = vec3::crossprod(omega, e2); - ypr[std::slice(9,3,1)] = vec3::crossprod(omega, e3); + ypr[std::slice(3,3,1)] = std::valarray(vec3::crossprod(omega, e1)); + ypr[std::slice(6,3,1)] = std::valarray(vec3::crossprod(omega, e2)); + ypr[std::slice(9,3,1)] = std::valarray(vec3::crossprod(omega, e3)); return ypr; } @@ -529,15 +529,17 @@ void KRotationSaver::initData() e3_body.rotate(-m_initEulerTheta*e1_body); // omega_body = L_body * J_body^(-1) vec3 omega_body = e3_body * m_Lz; - omega_body /= J; + std::valarray &omega_body_ = omega_body; + std::valarray &J_ = J; + omega_body_ /= J_; // assemble initial y for solver std::valarray y(12); - y[std::slice(0,3,1)] = omega_body; + y[std::slice(0,3,1)] = std::valarray(omega_body); // 3 basis vectors of body system in fixed coordinates - y[std::slice(3,3,1)] = e1t; - y[std::slice(6,3,1)] = e2t; - y[std::slice(9,3,1)] = e3t; + y[std::slice(3,3,1)] = std::valarray(e1t); + y[std::slice(6,3,1)] = std::valarray(e2t); + y[std::slice(9,3,1)] = std::valarray(e3t); // initial rotation vector omega -- cgit v1.2.1