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>
This commit is contained in:
Aaron Barany
2018-11-30 20:36:00 -08:00
committed by Orgad Shaneh
parent 2e2059e8b5
commit bba377f675

View File

@@ -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;