Remove "set-but-unused" variables (generates warnings on gcc 7).

This commit is contained in:
Kristian Bendiksen 2020-05-18 15:45:49 +02:00
parent 59621e38f7
commit 2f4ee076de
18 changed files with 9 additions and 54 deletions

View File

@ -809,7 +809,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWelspeclToFile(
{
const auto wellPath =
RicWellPathExportCompletionsFileTools::findWellPathFromExportName( completion.wellName() );
auto item = wellPathToLgrNameMap.find( wellPath );
wellPathToLgrNameMap[wellPath].insert( completionsForLgr.first );
}
}

View File

@ -248,9 +248,7 @@ VdeArrayDataPacket
const char* payloadPtr = rawPacketBuffer + VDE_HEADER_SIZE;
const size_t payloadSizeInBytes = bufferSize - VDE_HEADER_SIZE;
const size_t payloadSizeInBytesFromPacketFields = elementCount * sizeOfElement( elementType );
assert( payloadSizeInBytes == payloadSizeInBytesFromPacketFields );
assert( payloadSizeInBytes == elementCount * sizeOfElement( elementType ) );
VdeArrayDataPacket packet;
packet.assign( packetId, elementType, elementCount, imageWidth, imageHeight, imageCompCount, payloadPtr, payloadSizeInBytes );
@ -284,8 +282,7 @@ bool VdeArrayDataPacket::assign( int arrayId,
bufferWriter.setUint16( VDE_BYTEOFFSET_IMAGE_WIDTH, imageWidth );
bufferWriter.setUint16( VDE_BYTEOFFSET_IMAGE_HEIGHT, imageHeight );
const size_t calcArraySizeInBytes = elementCount * sizeOfElement( elementType );
assert( arrayDataSizeInBytes == calcArraySizeInBytes );
assert( arrayDataSizeInBytes == elementCount * sizeOfElement( elementType ) );
std::copy( arrayDataPtr, arrayDataPtr + arrayDataSizeInBytes, m_packetBytes.begin() + VDE_HEADER_SIZE );
assert( m_packetBytes.size() == totalSizeBytes );

View File

@ -347,7 +347,6 @@ void Riv3dWellLogCurveGeometryGenerator::createNewVerticesAlongSegment( const cv
const std::vector<cvf::Vec3d>& drawSurfaceVertices,
std::vector<cvf::Vec3d>* extraVertices )
{
cvf::Vec3d fullSegmentVector = ptEnd - ptStart;
extraVertices->push_back( ptStart );
// Find segments that intersects the triangle edges

View File

@ -93,8 +93,6 @@ void RivContourMapProjectionPartMgr::appendPickPointVisToModel( cvf::ModelBasicL
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::Vec2fArray> RivContourMapProjectionPartMgr::createTextureCoords( const std::vector<double>& values ) const
{
cvf::Vec2ui patchSize = m_contourMapProjection->numberOfVerticesIJ();
cvf::ref<cvf::Vec2fArray> textureCoords = new cvf::Vec2fArray( values.size() );
#pragma omp parallel for

View File

@ -67,8 +67,6 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo
cvf::ref<RivReachCircleAnnotationSourceInfo> sourceInfo = new RivReachCircleAnnotationSourceInfo( rimAnnotation );
Vec3d centerPositionInDomain = rimAnnotation->centerPoint();
auto lineColor = rimAnnotation->appearance()->color();
auto isDashedLine = rimAnnotation->appearance()->isDashed();
auto lineThickness = rimAnnotation->appearance()->thickness();

View File

@ -103,9 +103,8 @@ void RivWellPathSourceInfo::normalizedIntersection( size_t triangleIn
cvf::Vec3d segmentStart = rigWellPath->m_wellPathPoints[segIndex];
cvf::Vec3d segmentEnd = rigWellPath->m_wellPathPoints[segIndex + 1];
double norm = 0.0;
cvf::Vec3d pointOnLine =
cvf::GeometryTools::projectPointOnLine( segmentStart, segmentEnd, globalIntersectionInDomain, &norm );
double norm = 0.0;
cvf::GeometryTools::projectPointOnLine( segmentStart, segmentEnd, globalIntersectionInDomain, &norm );
norm = cvf::Math::clamp( norm, 0.0, 1.0 );
*firstSegmentIndex = segIndex;

View File

@ -147,10 +147,6 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
MeshLinesAccumulator meshAcc( m_hexGrid.p() );
cvf::BoundingBox gridBBox = m_hexGrid->boundingBox();
std::vector<size_t> cellDummy;
m_hexGrid->findIntersectingCells( cvf::BoundingBox( cvf::Vec3d::ZERO, cvf::Vec3d::ZERO ), &cellDummy );
m_usedSurfaceData = m_surfaceInView->surface()->surfaceData();
const std::vector<cvf::Vec3d>& nativeVertices = m_usedSurfaceData->vertices();

View File

@ -120,7 +120,6 @@ void RimFormationNames::updateConnectedViews()
std::vector<RimCase*> objects;
this->objectsWithReferringPtrFieldsOfType( objects );
bool updatedTracks = false;
for ( RimCase* caseObj : objects )
{
if ( caseObj )
@ -135,7 +134,6 @@ void RimFormationNames::updateConnectedViews()
if ( track->formationNamesCase() == caseObj )
{
track->loadDataAndUpdate();
updatedTracks = true;
}
}
}

View File

@ -375,8 +375,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
RiaDefines::DepthTypeEnum depthType = RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH;
DerivedMDSource derivedMDSource = NO_SOURCE;
DerivedMDSource derivedMDSource = NO_SOURCE;
if ( isCurveVisible() )
{
@ -384,8 +383,6 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
firstAncestorOrThisOfType( wellLogPlot );
CVF_ASSERT( wellLogPlot );
depthType = wellLogPlot->depthType();
RimWellRftPlot* rftPlot = dynamic_cast<RimWellRftPlot*>( wellLogPlot );
bool showErrorBarsInObservedData = rftPlot ? rftPlot->showErrorBarsForObservedData() : false;
m_showErrorBars = showErrorBarsInObservedData;

View File

@ -2484,11 +2484,6 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot()
RimDepthTrackPlot* plot = nullptr;
firstAncestorOrThisOfTypeAsserted( plot );
RimMainPlotCollection* mainPlotCollection;
this->firstAncestorOrThisOfTypeAsserted( mainPlotCollection );
RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection();
RigEclipseWellLogExtractor* eclWellLogExtractor =
RiaExtractionTools::wellLogExtractorEclipseCase( m_formationWellPathForSourceCase,
dynamic_cast<RimEclipseCase*>( m_formationCase() ) );

View File

@ -83,7 +83,6 @@ double RigGeoMechBoreHoleStressCalculator::solveBisection( double minPw, double
minPw = largestNegativeValue.first;
double minPwFuncVal = largestNegativeValue.second;
maxPw = smallestPositiveValue.first;
double maxPwFuncVal = smallestPositiveValue.second;
double range = std::abs( maxPw - minPw );
@ -94,8 +93,7 @@ double RigGeoMechBoreHoleStressCalculator::solveBisection( double minPw, double
double midPwFuncVal = ( this->*fn )( midPw, &theta );
if ( midPwFuncVal * minPwFuncVal < 0.0 )
{
maxPw = midPw;
maxPwFuncVal = midPwFuncVal;
maxPw = midPw;
}
else
{

View File

@ -126,7 +126,6 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe
for ( const auto& mapElement : tofToCellIndicesMap )
{
const double tofValue = mapElement.first;
const std::vector<size_t>& cellIndicesArr = mapElement.second;
for ( size_t cellIndex : cellIndicesArr )

View File

@ -278,8 +278,6 @@ double RigWellPathGeometryTools::solveForX( const QwtSpline& spline, double minX
double c = b - ( b - a ) / phi;
double d = a + ( b - a ) / phi;
double fa = spline.value( a ) - y;
double fb = spline.value( b ) - y;
double fc = spline.value( c ) - y;
double fd = spline.value( d ) - y;
@ -293,7 +291,6 @@ double RigWellPathGeometryTools::solveForX( const QwtSpline& spline, double minX
if ( std::fabs( fc ) < std::fabs( fd ) )
{
b = d;
fb = fd;
d = c;
fd = fc;
c = b - ( b - a ) / phi;
@ -302,7 +299,6 @@ double RigWellPathGeometryTools::solveForX( const QwtSpline& spline, double minX
else
{
a = c;
fa = fc;
c = d;
fc = fd;
d = a + ( b - a ) / phi;

View File

@ -200,12 +200,6 @@ TEST( RifEclipseInputFileToolsTest, EquilData )
&isStopParsingKeywordDetected,
includeStatementAbsolutePathPrefix );
EXPECT_EQ( (int)10, keywordContent.size() );
for ( const auto& s : keywordContent )
{
RigEquil equilRec = RigEquil::parseString( s );
// qDebug() << s;
}
}
}

View File

@ -65,7 +65,6 @@ TEST( RigCellGeometryTools, calculateCellVolumeTest )
corner.x() += 0.5 * bbox.extent().x();
tetrahedronBBox.add( corner );
}
overlapVertices;
RigCellGeometryTools::estimateHexOverlapWithBoundingBox( cornerVertices,
tetrahedronBBox,
&overlapVertices,

View File

@ -97,5 +97,5 @@ TEST( RigHexIntersectionTools, DISABLED_planeHexCellIntersectionPerformanceTest
qDebug() << "Time rim elapsed: " << timeLocal.elapsed();
}
qDebug() << "Time total elapsed: " << timeTotal.elapsed();
qDebug() << "Time total elapsed: " << timeTotal.elapsed() << " intersected: " << static_cast<int>( isCellIntersected );
}

View File

@ -867,10 +867,8 @@ void RiuQwtPlotWidget::recalculateAxisExtents( QwtPlot::Axis axis )
//--------------------------------------------------------------------------------------------------
caf::UiStyleSheet RiuQwtPlotWidget::createPlotStyleSheet() const
{
QColor backgroundColor = QColor( "white" );
QColor highlightColor = QApplication::palette().highlight().color();
QColor blendedHighlightColor = RiaColorTools::blendQColors( highlightColor, backgroundColor, 1, 20 );
QColor nearlyBackgroundColor = RiaColorTools::blendQColors( highlightColor, backgroundColor, 1, 40 );
QColor backgroundColor = QColor( "white" );
QColor highlightColor = QApplication::palette().highlight().color();
caf::UiStyleSheet styleSheet;
styleSheet.set( "background-color", backgroundColor.name() );

View File

@ -56,7 +56,6 @@ double RiuQwtScalePicker::axisValueAtPosition( const QwtScaleWidget* scale, cons
// translate the position in a value on the scale
double value = 0.0;
int axis = -1;
const QwtScaleDraw* sd = scale->scaleDraw();
switch ( scale->alignment() )
@ -64,25 +63,21 @@ double RiuQwtScalePicker::axisValueAtPosition( const QwtScaleWidget* scale, cons
case QwtScaleDraw::LeftScale:
{
value = sd->scaleMap().invTransform( pos.y() );
axis = QwtPlot::yLeft;
break;
}
case QwtScaleDraw::RightScale:
{
value = sd->scaleMap().invTransform( pos.y() );
axis = QwtPlot::yRight;
break;
}
case QwtScaleDraw::BottomScale:
{
value = sd->scaleMap().invTransform( pos.x() );
axis = QwtPlot::xBottom;
break;
}
case QwtScaleDraw::TopScale:
{
value = sd->scaleMap().invTransform( pos.x() );
axis = QwtPlot::xTop;
break;
}
}