diff options
author | Gabor Kelemen <kelemen.gabor2@nisz.hu> | 2020-04-19 20:36:58 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-04-22 15:36:50 +0200 |
commit | e12fa18c69cbe1f441e972f3519d33638f15658e (patch) | |
tree | 323c049c122220ad5dc91fc6d1c3dfe613793ff9 /include | |
parent | 0b48cee16d459d27ebd090d008ec9398c86fc581 (diff) |
tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/
Turns out we can save about 500Mb of preprocessor input if we use
rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper
rtl::math::approxEqual from rtl/math.hxx
and manage the fallout accordingly.
Before:
bin/includebloat.awk | head
sum total bytes included (excluding system headers): 19017296671
After:
$ bin/includebloat.awk | head
sum total bytes included (excluding system headers): 18535432672
Change-Id: I1691171f3a309405a7099882ad9989d147f59118
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/IwyuFilter_include.yaml | 3 | ||||
-rw-r--r-- | include/basegfx/numeric/ftools.hxx | 6 | ||||
-rw-r--r-- | include/basegfx/tuple/b2dtuple.hxx | 4 | ||||
-rw-r--r-- | include/basegfx/tuple/b3dtuple.hxx | 6 | ||||
-rw-r--r-- | include/tools/color.hxx | 1 | ||||
-rw-r--r-- | include/vcl/edit.hxx | 1 | ||||
-rw-r--r-- | include/xmloff/XMLBase64ImportContext.hxx | 1 |
7 files changed, 15 insertions, 7 deletions
diff --git a/include/IwyuFilter_include.yaml b/include/IwyuFilter_include.yaml index d2a5838c2b7e..6ed80bd73cf8 100644 --- a/include/IwyuFilter_include.yaml +++ b/include/IwyuFilter_include.yaml @@ -216,6 +216,9 @@ blacklist: include/sot/exchange.hxx: # Used in a macro #define - com/sun/star/datatransfer/dnd/DNDConstants.hpp + include/tools/color.hxx: + # OSL_BIGENDIAN is being checked + - osl/endian.h include/tools/debug.hxx: # Used behind #ifndef - tools/toolsdllapi.h diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx index a272cb76b22c..78f4eb1e722f 100644 --- a/include/basegfx/numeric/ftools.hxx +++ b/include/basegfx/numeric/ftools.hxx @@ -19,7 +19,9 @@ #pragma once -#include <rtl/math.hxx> +#include <rtl/math.h> +#include <cmath> +#include <math.h> #include <basegfx/basegfxdllapi.h> #include <limits> #include <algorithm> @@ -194,7 +196,7 @@ namespace basegfx static bool equal(const double& rfValA, const double& rfValB) { // changed to approxEqual usage for better numerical correctness - return rtl::math::approxEqual(rfValA, rfValB); + return rtl_math_approxEqual(rfValA, rfValB); } static bool equal(const double& rfValA, const double& rfValB, const double& rfSmallValue) diff --git a/include/basegfx/tuple/b2dtuple.hxx b/include/basegfx/tuple/b2dtuple.hxx index d26310de9975..efe44f5863f3 100644 --- a/include/basegfx/tuple/b2dtuple.hxx +++ b/include/basegfx/tuple/b2dtuple.hxx @@ -229,8 +229,8 @@ namespace basegfx inline B2DTuple average(const B2DTuple& rOld1, const B2DTuple& rOld2) { return B2DTuple( - rtl::math::approxEqual(rOld1.getX(), rOld2.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5, - rtl::math::approxEqual(rOld1.getY(), rOld2.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5); + rtl_math_approxEqual(rOld1.getX(), rOld2.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5, + rtl_math_approxEqual(rOld1.getY(), rOld2.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5); } inline B2DTuple operator+(const B2DTuple& rTupA, const B2DTuple& rTupB) diff --git a/include/basegfx/tuple/b3dtuple.hxx b/include/basegfx/tuple/b3dtuple.hxx index 9237517beb0f..08f46c0cdbfb 100644 --- a/include/basegfx/tuple/b3dtuple.hxx +++ b/include/basegfx/tuple/b3dtuple.hxx @@ -286,9 +286,9 @@ namespace basegfx inline B3DTuple average(const B3DTuple& rOld1, const B3DTuple& rOld2) { return B3DTuple( - rtl::math::approxEqual(rOld1.getX(), rOld2.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5, - rtl::math::approxEqual(rOld1.getY(), rOld2.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5, - rtl::math::approxEqual(rOld1.getZ(), rOld2.getZ()) ? rOld1.getZ() : (rOld1.getZ() + rOld2.getZ()) * 0.5); + rtl_math_approxEqual(rOld1.getX(), rOld2.getX()) ? rOld1.getX() : (rOld1.getX() + rOld2.getX()) * 0.5, + rtl_math_approxEqual(rOld1.getY(), rOld2.getY()) ? rOld1.getY() : (rOld1.getY() + rOld2.getY()) * 0.5, + rtl_math_approxEqual(rOld1.getZ(), rOld2.getZ()) ? rOld1.getZ() : (rOld1.getZ() + rOld2.getZ()) * 0.5); } inline B3DTuple operator+(const B3DTuple& rTupA, const B3DTuple& rTupB) diff --git a/include/tools/color.hxx b/include/tools/color.hxx index b5555c4cfccd..f66d49b51442 100644 --- a/include/tools/color.hxx +++ b/include/tools/color.hxx @@ -23,6 +23,7 @@ #include <tools/toolsdllapi.h> #include <com/sun/star/uno/Any.hxx> #include <basegfx/color/bcolor.hxx> +#include <osl/endian.h> namespace color { diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index 1f59b7382a77..66304d33f74e 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -25,6 +25,7 @@ #include <memory> +#include <rtl/ustrbuf.hxx> #include <o3tl/deleter.hxx> #include <tools/solar.h> #include <vcl/dllapi.h> diff --git a/include/xmloff/XMLBase64ImportContext.hxx b/include/xmloff/XMLBase64ImportContext.hxx index 8169b64281eb..9ec437ea0784 100644 --- a/include/xmloff/XMLBase64ImportContext.hxx +++ b/include/xmloff/XMLBase64ImportContext.hxx @@ -21,6 +21,7 @@ #define INCLUDED_XMLOFF_XMLBASE64IMPORTCONTEXT_HXX #include <sal/config.h> +#include <rtl/ustrbuf.hxx> #include <xmloff/dllapi.h> #include <xmloff/xmlictxt.hxx> |