Fix CVF compile flags on GNUCXX

This commit is contained in:
Gaute Lindkvist
2019-05-28 12:36:33 +02:00
parent 6ba9d42b45
commit a54e3f30c4
5 changed files with 13 additions and 13 deletions

View File

@@ -34,7 +34,7 @@ option(CEE_WARNINGS_AS_ERRORS "Make all warnings into errors" ON)
if (CMAKE_COMPILER_IS_GNUCXX)
# Setup our BASE compile flags
set(CEE_BASE_CXX_FLAGS "-Wall -Wextra -pedantic")
set(CEE_BASE_CXX_FLAGS "-Wall -Wextra -pedantic -std=c++11")
if (CEE_WARNINGS_AS_ERRORS)
set(CEE_BASE_CXX_FLAGS "-Werror ${CEE_BASE_CXX_FLAGS}")

View File

@@ -423,8 +423,8 @@ void OverlayScalarMapperLegend::renderLegend(OpenGLContext* oglContext, OverlayC
for (iPx = 0; iPx < legendHeightPixelCount; iPx++)
{
const Color3ub& clr = m_scalarMapper->mapToColor(m_scalarMapper->domainValue((iPx+0.5)/legendHeightPixelCount));
float y0 = static_cast<float>(layout->legendRect.min().y() + iPx);
float y1 = static_cast<float>(layout->legendRect.min().y() + iPx + 1);
float y0 = layout->legendRect.min().y() + static_cast<float>(iPx);
float y1 = layout->legendRect.min().y() + static_cast<float>(iPx + 1);
// Dynamic coordinates for rectangle
v0[1] = v1[1] = y0;
@@ -575,8 +575,8 @@ void OverlayScalarMapperLegend::renderLegendImmediateMode(OpenGLContext* oglCont
for (iPx = 0; iPx < legendHeightPixelCount; iPx++)
{
const Color3ub& clr = m_scalarMapper->mapToColor(m_scalarMapper->domainValue((iPx+0.5)/legendHeightPixelCount));
float y0 = static_cast<float>(layout->legendRect.min().y() + iPx);
float y1 = static_cast<float>(layout->legendRect.min().y() + iPx + 1);
float y0 = layout->legendRect.min().y() + static_cast<float>(iPx);
float y1 = layout->legendRect.min().y() + static_cast<float>(iPx + 1);
// Dynamic coordinates for rectangle
v0[1] = v1[1] = y0;

View File

@@ -53,9 +53,9 @@ namespace cvf {
/// Configured by specifying a number of level colors and a min/max range.
//==================================================================================================
ScalarMapperContinuousLog::ScalarMapperContinuousLog()
: m_hasNegativeRange(false),
m_logRange(0.0),
m_logRangeMin(0.0)
: m_logRange(0.0)
, m_logRangeMin(0.0)
, m_hasNegativeRange(false)
{
}

View File

@@ -55,8 +55,8 @@ ScalarMapperRangeBased::ScalarMapperRangeBased()
m_rangeMax(cvf::UNDEFINED_DOUBLE),
m_decadeLevelCount(1),
m_levelCount(8),
m_textureSize(2048), // Large enough, I guess and a power of two
m_adjustLevels(true)
m_adjustLevels(true),
m_textureSize(2048) // Large enough, I guess and a power of two
{
m_interpolatedUserGradientColors.resize(m_textureSize);
m_interpolatedUserGradientColors.setAll(Color3ub::WHITE);
@@ -220,7 +220,7 @@ void ScalarMapperRangeBased::majorTickValues( std::vector<double>* domainValues)
domainValues->push_back(domainValue(0));
if (m_levelCount > 1)
{
double stepSizeNorm = 1.0/m_levelCount;
double stepSizeNorm = 1.0/static_cast<double>(m_levelCount);
size_t i;
if (m_adjustLevels) // adjust levels
@@ -254,7 +254,7 @@ void ScalarMapperRangeBased::majorTickValues( std::vector<double>* domainValues)
double prevDomValue = domainValue(0);
for (i = 1; i < m_levelCount; ++i)
{
double newLevel = domainValue(stepSizeNorm*i);
double newLevel = domainValue(stepSizeNorm*static_cast<double>(i));
if (newLevel != prevDomValue) domainValues->push_back(newLevel);

View File

@@ -20,7 +20,7 @@ include_directories(${LibGuiQt_SOURCE_DIR})
include_directories(${LibUtilities_SOURCE_DIR})
include_directories(${SnippetsBasis_SOURCE_DIR})
set(CEE_LIBS SnippetsBasis freetype LibFreeType LibUtilities LibGuiQt LibViewing LibRender LibGeometry LibIo LibCore opengl32)
set(CEE_LIBS SnippetsBasis freetype LibFreeType LibUtilities LibGuiQt LibViewing LibRender LibGeometry LibIo LibCore)
include_directories(${SnippetsModules_SOURCE_DIR})
set(CEE_LIBS LibStructGrid ${CEE_LIBS})