diff options
author | Aaron Barany <akb825@gmail.com> | 2018-11-30 20:36:00 -0800 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2018-12-01 17:49:23 +0000 |
commit | bba377f675d71e4a259bdf374da1cf659eda1ddc (patch) | |
tree | a25047ae7c8f07a0929b6fa944ca716142e1e36c /src/plugins/texteditor/syntaxhighlighter.cpp | |
parent | 2e2059e8b52fb53b0ce34a12ce7a7da08423aac9 (diff) |
Fix build on Linux (GCC 8.2)
#include <cmath> in syntaxhighlighter.cpp to have access to math functions.
Use std:: namespace for math functions due to including the C++ header
wrapper.
Change-Id: I978cb4c54e29be38d4973f5a9cd1cede1bb49483
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/texteditor/syntaxhighlighter.cpp')
-rw-r--r-- | src/plugins/texteditor/syntaxhighlighter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index 76008dc973..791b2e4a68 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -36,6 +36,8 @@ #include <QPointer> #include <qtimer.h> +#include <cmath> + namespace TextEditor { class SyntaxHighlighterPrivate @@ -734,7 +736,7 @@ QList<QColor> SyntaxHighlighter::generateColors(int n, const QColor &background) // Assign a color gradient. Generate a sufficient number of colors // by using ceil and looping from 0..step. const double oneThird = 1.0 / 3.0; - const int step = qRound(ceil(pow(double(n), oneThird))); + const int step = qRound(std::ceil(std::pow(double(n), oneThird))); result.reserve(step * step * step); const int factor = 255 / step; const int half = factor / 2; |