vcl/source/filter/sgvspln.cxx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-)
New commits: commit 4340cc7a63c3a94a7b95e014a501b44d886e18bb Author: Takeshi Abe <t...@fixedpoint.jp> Date: Wed Nov 4 18:08:54 2015 +0900 vcl: What we want here is exactly std::copysign Change-Id: I888ca84342a6c34b99a1f03d44d686e1f50622f4 Reviewed-on: https://gerrit.libreoffice.org/19778 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthieb...@gmail.com> diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx index cb10ef1..2a32875 100644 --- a/vcl/source/filter/sgvspln.cxx +++ b/vcl/source/filter/sgvspln.cxx @@ -17,12 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <math.h> - #include <tools/poly.hxx> #include <memory> #include <sgvspln.hxx> +#include <cmath> extern "C" { @@ -104,12 +103,6 @@ short basis() /* calculate BASE machine independence */ #endif /*-------------- END of ifdef --------------------*/ -/* defines for function macros: */ - -#define abs(X) ((X) >= 0 ? (X) : -(X)) /* absolute number X */ -#define sign(X, Y) (Y < 0 ? -abs(X) : abs(X)) /* sign of Y times */ - /* abs(X) */ - /*-------------------- END of FILE u_const.h -----------------------*/ /*.HL appendix: C - programs*/ @@ -579,16 +572,16 @@ sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond, case 4: { if (abs(Marg01)>=MAXROOT) { alphX=0.0; - alphY=sign(1.0,y[1]-y[0]); + alphY=std::copysign(1.0,y[1]-y[0]); } else { - alphX=sign(sqrt(1.0/(1.0+Marg01*Marg01)),x[1]-x[0]); + alphX=std::copysign(sqrt(1.0/(1.0+Marg01*Marg01)),x[1]-x[0]); alphY=alphX*Marg01; } if (abs(MargN1)>=MAXROOT) { betX=0.0; - betY=sign(1.0,y[n]-y[n-1]); + betY=std::copysign(1.0,y[n]-y[n-1]); } else { - betX=sign(sqrt(1.0/(1.0+MargN1*MargN1)),x[n]-x[n-1]); + betX=std::copysign(sqrt(1.0/(1.0+MargN1*MargN1)),x[n]-x[n-1]); betY=betX*MargN1; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits