diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-01-14 11:17:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-16 16:21:15 +0000 |
commit | 515e802ae20c045e5c47b400ee6ef6e92349c978 (patch) | |
tree | f9f4be4c9e360611b5823ef28c2cb293733aee42 /src/gui/painting/qdrawhelper.cpp | |
parent | 3d835eb62e70435fe32318441dc7c10aba3a6fba (diff) |
Use C++ <cmath> instead of <math.h>
Including math.h can pollute the default namespace, and break
some compilers if cmath versions of the method are declared as using.
Switching to C++ math functions also greatly simplifies handling of
float qreal as C++ automatically chooses the right method.
[ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any
sources depending on that indirect inclusion may fail to build.
Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index f461dfef06..84063eb692 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -1684,7 +1684,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c b++; fx += fdx; } - } else if ((fdx < 0 && fdx > -(fixed_scale / 8)) || fabs(data->m22) < (1./8.)) { // scale up more than 8x + } else if ((fdx < 0 && fdx > -(fixed_scale / 8)) || std::abs(data->m22) < (1./8.)) { // scale up more than 8x int y1 = (fy >> 16); int y2; fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2); @@ -1843,7 +1843,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c } } } else { //rotation - if (fabs(data->m11) > 8 || fabs(data->m22) > 8) { + if (std::abs(data->m11) > 8 || std::abs(data->m22) > 8) { //if we are zooming more than 8 times, we use 8bit precision for the position. while (b < end) { int x1 = (fx >> 16); @@ -2196,7 +2196,7 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); - if ((fdx < 0 && fdx > -(fixed_scale / 8)) || fabs(data->m22) < (1./8.)) { // scale up more than 8x + if ((fdx < 0 && fdx > -(fixed_scale / 8)) || std::abs(data->m22) < (1./8.)) { // scale up more than 8x int disty = (fy & 0x0000ffff) >> 8; for (int i = 0; i < len; ++i) { uint tl = buf1[i * 2 + 0]; @@ -2255,7 +2255,7 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper layout->convertToARGB32PM(buf1, buf1, len * 2, layout, clut); layout->convertToARGB32PM(buf2, buf2, len * 2, layout, clut); - if (fabs(data->m11) > 8 || fabs(data->m22) > 8) { + if (std::abs(data->m11) > 8 || std::abs(data->m22) > 8) { //if we are zooming more than 8 times, we use 8bit precision for the position. for (int i = 0; i < len; ++i) { uint tl = buf1[i * 2 + 0]; |