summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-11-04 18:08:54 +0900
committerNorbert Thiebaud <nthiebaud@gmail.com>2015-11-04 11:13:53 +0000
commit4340cc7a63c3a94a7b95e014a501b44d886e18bb (patch)
treeeade585095a78e3e88f338798e393342e90dce26
parentdb1bd15cfb3c2b1380a19fd22f153a15493e9871 (diff)
vcl: What we want here is exactly std::copysign
Change-Id: I888ca84342a6c34b99a1f03d44d686e1f50622f4 Reviewed-on: https://gerrit.libreoffice.org/19778 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--vcl/source/filter/sgvspln.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx
index cb10ef1d0411..2a32875ea271 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;
}
}