forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
2e2059e8b5
commit
bba377f675
@@ -36,6 +36,8 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
|
|
||||||
class SyntaxHighlighterPrivate
|
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
|
// Assign a color gradient. Generate a sufficient number of colors
|
||||||
// by using ceil and looping from 0..step.
|
// by using ceil and looping from 0..step.
|
||||||
const double oneThird = 1.0 / 3.0;
|
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);
|
result.reserve(step * step * step);
|
||||||
const int factor = 255 / step;
|
const int factor = 255 / step;
|
||||||
const int half = factor / 2;
|
const int half = factor / 2;
|
||||||
|
Reference in New Issue
Block a user