summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-04-01 20:29:39 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-04-02 20:10:02 +0000
commit76e18ec5cbcb2ce1f7b106fc27a1bd42d92dccc6 (patch)
tree1c0d1155ddffee6be80a1dcefa6dbf1dd4388f32 /src
parentAdd new lib2geom dependency: "double-conversion" (diff)
downloadinkscape-76e18ec5cbcb2ce1f7b106fc27a1bd42d92dccc6.tar.gz
inkscape-76e18ec5cbcb2ce1f7b106fc27a1bd42d92dccc6.zip
Replace IS_FINITE with std::isfinite (exists since C++11)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-filter-composite.cpp2
-rw-r--r--src/display/nr-filter-gaussian.cpp4
-rw-r--r--src/live_effects/spiro-converters.cpp16
-rw-r--r--src/style-internal.cpp4
-rw-r--r--src/ui/shape-editor-knotholders.cpp2
5 files changed, 14 insertions, 14 deletions
diff --git a/src/display/nr-filter-composite.cpp b/src/display/nr-filter-composite.cpp
index 2feab6560..4bb5685b0 100644
--- a/src/display/nr-filter-composite.cpp
+++ b/src/display/nr-filter-composite.cpp
@@ -166,7 +166,7 @@ void FilterComposite::set_operator(FeCompositeOperator op) {
}
void FilterComposite::set_arithmetic(double k1, double k2, double k3, double k4) {
- if (!IS_FINITE(k1) || !IS_FINITE(k2) || !IS_FINITE(k3) || !IS_FINITE(k4)) {
+ if (!std::isfinite(k1) || !std::isfinite(k2) || !std::isfinite(k3) || !std::isfinite(k4)) {
g_warning("Non-finite parameter for feComposite arithmetic operator");
return;
}
diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp
index d1dd976bb..f145ba56c 100644
--- a/src/display/nr-filter-gaussian.cpp
+++ b/src/display/nr-filter-gaussian.cpp
@@ -730,14 +730,14 @@ double FilterGaussian::complexity(Geom::Affine const &trans)
void FilterGaussian::set_deviation(double deviation)
{
- if(IS_FINITE(deviation) && deviation >= 0) {
+ if(std::isfinite(deviation) && deviation >= 0) {
_deviation_x = _deviation_y = deviation;
}
}
void FilterGaussian::set_deviation(double x, double y)
{
- if(IS_FINITE(x) && x >= 0 && IS_FINITE(y) && y >= 0) {
+ if(std::isfinite(x) && x >= 0 && std::isfinite(y) && y >= 0) {
_deviation_x = x;
_deviation_y = y;
}
diff --git a/src/live_effects/spiro-converters.cpp b/src/live_effects/spiro-converters.cpp
index 556df82b4..411fb659f 100644
--- a/src/live_effects/spiro-converters.cpp
+++ b/src/live_effects/spiro-converters.cpp
@@ -24,7 +24,7 @@ namespace Spiro {
void
ConverterSPCurve::moveto(double x, double y)
{
- if ( IS_FINITE(x) && IS_FINITE(y) ) {
+ if ( std::isfinite(x) && std::isfinite(y) ) {
_curve.moveto(x, y);
} else {
SPIRO_G_MESSAGE("Spiro: moveto not finite");
@@ -34,7 +34,7 @@ ConverterSPCurve::moveto(double x, double y)
void
ConverterSPCurve::lineto(double x, double y, bool close_last)
{
- if ( IS_FINITE(x) && IS_FINITE(y) ) {
+ if ( std::isfinite(x) && std::isfinite(y) ) {
_curve.lineto(x, y);
if (close_last) {
_curve.closepath();
@@ -47,7 +47,7 @@ ConverterSPCurve::lineto(double x, double y, bool close_last)
void
ConverterSPCurve::quadto(double xm, double ym, double x3, double y3, bool close_last)
{
- if ( IS_FINITE(xm) && IS_FINITE(ym) && IS_FINITE(x3) && IS_FINITE(y3) ) {
+ if ( std::isfinite(xm) && std::isfinite(ym) && std::isfinite(x3) && std::isfinite(y3) ) {
_curve.quadto(xm, ym, x3, y3);
if (close_last) {
_curve.closepath();
@@ -60,7 +60,7 @@ ConverterSPCurve::quadto(double xm, double ym, double x3, double y3, bool close_
void
ConverterSPCurve::curveto(double x1, double y1, double x2, double y2, double x3, double y3, bool close_last)
{
- if ( IS_FINITE(x1) && IS_FINITE(y1) && IS_FINITE(x2) && IS_FINITE(y2) ) {
+ if ( std::isfinite(x1) && std::isfinite(y1) && std::isfinite(x2) && std::isfinite(y2) ) {
_curve.curveto(x1, y1, x2, y2, x3, y3);
if (close_last) {
_curve.closepath();
@@ -80,7 +80,7 @@ ConverterPath::ConverterPath(Geom::Path &path)
void
ConverterPath::moveto(double x, double y)
{
- if ( IS_FINITE(x) && IS_FINITE(y) ) {
+ if ( std::isfinite(x) && std::isfinite(y) ) {
_path.start(Geom::Point(x, y));
} else {
SPIRO_G_MESSAGE("spiro moveto not finite");
@@ -90,7 +90,7 @@ ConverterPath::moveto(double x, double y)
void
ConverterPath::lineto(double x, double y, bool close_last)
{
- if ( IS_FINITE(x) && IS_FINITE(y) ) {
+ if ( std::isfinite(x) && std::isfinite(y) ) {
_path.appendNew<Geom::LineSegment>( Geom::Point(x, y) );
_path.close(close_last);
} else {
@@ -101,7 +101,7 @@ ConverterPath::lineto(double x, double y, bool close_last)
void
ConverterPath::quadto(double xm, double ym, double x3, double y3, bool close_last)
{
- if ( IS_FINITE(xm) && IS_FINITE(ym) && IS_FINITE(x3) && IS_FINITE(y3) ) {
+ if ( std::isfinite(xm) && std::isfinite(ym) && std::isfinite(x3) && std::isfinite(y3) ) {
_path.appendNew<Geom::QuadraticBezier>(Geom::Point(xm, ym), Geom::Point(x3, y3));
_path.close(close_last);
} else {
@@ -112,7 +112,7 @@ ConverterPath::quadto(double xm, double ym, double x3, double y3, bool close_las
void
ConverterPath::curveto(double x1, double y1, double x2, double y2, double x3, double y3, bool close_last)
{
- if ( IS_FINITE(x1) && IS_FINITE(y1) && IS_FINITE(x2) && IS_FINITE(y2) ) {
+ if ( std::isfinite(x1) && std::isfinite(y1) && std::isfinite(x2) && std::isfinite(y2) ) {
_path.appendNew<Geom::CubicBezier>(Geom::Point(x1, y1), Geom::Point(x2, y2), Geom::Point(x3, y3));
_path.close(close_last);
} else {
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index a1c2935be..beee8161d 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -234,7 +234,7 @@ SPILength::read( gchar const *str ) {
gchar *e;
/** \todo fixme: Move this to standard place (Lauris) */
value_tmp = g_ascii_strtod(str, &e);
- if ( !IS_FINITE(value_tmp) ) { // fix for bug lp:935157
+ if ( !std::isfinite(value_tmp) ) { // fix for bug lp:935157
return;
}
if ((gchar const *) e != str) {
@@ -383,7 +383,7 @@ SPILength::merge( const SPIBase* const parent ) {
* FIXME: Have separate ex ratio parameter.
* Get x height from libnrtype or pango.
*/
- if (!IS_FINITE(value)) {
+ if (!std::isfinite(value)) {
value = computed;
unit = SP_CSS_UNIT_NONE;
}
diff --git a/src/ui/shape-editor-knotholders.cpp b/src/ui/shape-editor-knotholders.cpp
index 67c109f58..f95afbe05 100644
--- a/src/ui/shape-editor-knotholders.cpp
+++ b/src/ui/shape-editor-knotholders.cpp
@@ -1490,7 +1490,7 @@ SpiralKnotHolderEntityOuter::knot_set(Geom::Point const &p, Geom::Point const &/
spiral->rad = rad_new;
spiral->t0 = pow(r0 / spiral->rad, 1.0/spiral->exp);
}
- if (!IS_FINITE(spiral->t0)) spiral->t0 = 0.0;
+ if (!std::isfinite(spiral->t0)) spiral->t0 = 0.0;
spiral->t0 = CLAMP(spiral->t0, 0.0, 0.999);
}