From b7f8d0e0f123c667fad14e15918e06d3c87bd646 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 17 Apr 2023 15:57:39 +0200 Subject: [PATCH] Increase warning level * Set warning level to /W3 for MSVC to catch more warnings * remove several excluded checks for clang * removed several unused variables * Hide warnings qwt * add missing parentheses in logical expressions * Remove double check on same logical expression --- .../Application/RiaApplication.cpp | 5 + .../Application/Tools/RiaQDateTimeTools.cpp | 2 +- .../Application/Tools/RiaWellLogUnitTools.inl | 3 +- ApplicationLibCode/CMakeLists.txt | 17 +--- .../RicfCommandFileExecutor.cpp | 1 - .../RicfCommandFileExecutor.h | 1 - ApplicationLibCode/Commands/CMakeLists.txt | 14 +-- ...mportEnsembleFractureStatisticsFeature.cpp | 3 +- .../RicExportFractureCompletionsImpl.cpp | 2 - .../RicMswTableFormatterTools.cpp | 7 -- .../RicWellPathExportMswCompletionsImpl.cpp | 10 +- .../RicCreateDepthAdjustedLasFilesFeature.cpp | 2 - .../HoloLensCommands/VdeVizDataExtractor.cpp | 5 +- ...icAppendSummaryCurvesForObjectsFeature.cpp | 3 +- .../RicImportEnsembleSurfaceFeature.cpp | 3 +- .../RicImportEnsembleWellLogsFeature.cpp | 3 +- .../RicNewCustomObjectiveFunctionFeature.cpp | 4 +- .../Commands/RicRecursiveFileSearchDialog.cpp | 11 +-- .../Commands/RicReloadSummaryCaseFeature.cpp | 2 - .../RicNewGridTimeHistoryCurveFeature.cpp | 2 - .../RicNewSummaryEnsembleCurveSetFeature.cpp | 3 +- .../RicSummaryPlotEditorUi.cpp | 2 - .../RicSummaryPlotFeatureImpl.cpp | 1 - .../RicCreateMultipleWellPathLaterals.cpp | 1 - .../FileInterface/RifOpmCommonSummary.cpp | 2 +- .../FileInterface/RifOpmGridTools.cpp | 6 +- .../RifRevealCsvSummaryReader.cpp | 5 +- .../FileInterface/RifSeismicZGYReader.cpp | 2 +- .../FileInterface/RifSurfaceImporter.cpp | 6 +- .../FileInterface/RifWellPathImporter.cpp | 6 +- .../RigFemNativeVisibleCellsStatCalc.h | 2 +- .../RivElementVectorResultPartMgr.cpp | 8 +- .../ModelVisualization/RivReservoirPartMgr.h | 2 - .../RivReservoirViewPartMgr.cpp | 4 +- .../Streamlines/RivStreamlinesPartMgr.h | 1 - .../Flow/RimWellAllocationOverTimePlot.cpp | 4 +- .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 6 +- .../RimIntersectionResultDefinition.cpp | 2 +- .../ProjectDataModel/RimTools.cpp | 2 +- .../Summary/RimSummaryCaseCollection.cpp | 3 +- .../Summary/RimSummaryTable.h | 2 - .../RigDepthResultAccessor.cpp | 6 +- .../RigAccWellFlowCalculator.h | 3 - .../ReservoirDataModel/RigLasFileExporter.cpp | 3 +- .../ReservoirDataModel/RigTexturedSection.cpp | 4 +- .../RigWellPathFormations.h | 8 +- .../AnalysisPlots/RiuGroupedBarChartBuilder.h | 1 - .../RiuCellAndNncPickEventHandler.cpp | 4 +- .../RiuFemTimeHistoryResultAccessor.cpp | 6 +- .../UserInterface/RiuMdiArea.cpp | 4 +- .../RiuSelectionChangedHandler.cpp | 9 +- .../RiuSummaryVectorSelectionUi.cpp | 94 +++++++++---------- CMakeLists.txt | 5 +- .../cafPdmScripting_UnitTests/CMakeLists.txt | 6 ++ .../cafPdmCore_UnitTests/CMakeLists.txt | 8 ++ .../CMakeLists.txt | 7 ++ .../TapCvfSpecialization.h | 6 +- Fwk/VizFwk/LibCore/cvfVector2.cpp | 1 - .../LibCore_UnitTests/cvfObject-Test.cpp | 15 --- .../LibCore_UnitTests/cvfString-Test.cpp | 20 ---- 60 files changed, 155 insertions(+), 225 deletions(-) diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp index 7303c19617..c55939d92b 100644 --- a/ApplicationLibCode/Application/RiaApplication.cpp +++ b/ApplicationLibCode/Application/RiaApplication.cpp @@ -124,6 +124,11 @@ #include "gtest/gtest.h" #endif // USE_UNIT_TESTS +// Required to ignore warning of usused variable when defining caf::PdmMarkdownGenerator +#if defined( __clang__ ) +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + RiaApplication* RiaApplication::s_riaApplication = nullptr; //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp b/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp index 36c4d019de..21338f8424 100644 --- a/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaQDateTimeTools.cpp @@ -539,7 +539,7 @@ std::set RiaQDateTimeTools::createEvenlyDistributedDates( const std:: qint64 timeDiff = std::abs( inputDates[j].toMSecsSinceEpoch() - targetTime ); if ( timeDiff < closestTimeDiff ) { - closestIndex = j; + closestIndex = static_cast( j ); closestTimeDiff = timeDiff; } } diff --git a/ApplicationLibCode/Application/Tools/RiaWellLogUnitTools.inl b/ApplicationLibCode/Application/Tools/RiaWellLogUnitTools.inl index e82367fef6..848a38fa4e 100644 --- a/ApplicationLibCode/Application/Tools/RiaWellLogUnitTools.inl +++ b/ApplicationLibCode/Application/Tools/RiaWellLogUnitTools.inl @@ -278,8 +278,7 @@ bool RiaWellLogUnitTools::convertValues( const std::vector *valuesOut = convertBarToNormalizedByPP( tvdRKBs, valuesIn ); return true; } - else if ( ( stringsMatch( unitsIn, pascalUnitString() ) || - stringsMatch( unitsIn, pascalUnitString() ) && stringsMatch( unitsOut, barUnitString() ) ) ) + else if ( stringsMatch( unitsIn, pascalUnitString() ) && stringsMatch( unitsOut, barUnitString() ) ) { *valuesOut = multiply( valuesIn, 1.0 / pascalPerBar() ); return true; diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt index 9243c99ce1..db154fae86 100644 --- a/ApplicationLibCode/CMakeLists.txt +++ b/ApplicationLibCode/CMakeLists.txt @@ -340,8 +340,7 @@ endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options( - ApplicationLibCode PRIVATE -Wall -Wno-unused-parameter -Wno-reorder - -Wno-parentheses -Wno-switch + ApplicationLibCode PRIVATE -Wall -Wno-reorder -Wno-parentheses -Wno-switch ) endif() @@ -350,22 +349,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options( ApplicationLibCode PRIVATE -Wall - -Wno-unused-parameter -Wno-reorder - -Wno-parentheses -Wno-switch + -Wno-undefined-var-template -Wno-delete-abstract-non-virtual-dtor - -Wno-undefined-var-template - -Wno-invalid-source-encoding - -Wno-enum-compare -Wno-call-to-pure-virtual-from-ctor-dtor - -Wno-unused-variable - -Wno-unused-private-field - -Wno-unused-lambda-capture -Wno-delete-non-abstract-non-virtual-dtor - -Wno-braced-scalar-init - -Wno-tautological-constant-out-of-range-compare - -Wno-undefined-var-template -Wno-ambiguous-reversed-operator ) endif() @@ -388,7 +377,7 @@ if(MSVC) # set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W3 /wd4190 # /wd4100 /wd4127") - set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005 /wd4251") + set(BUILD_FLAGS_FOR_MSVC "/W3 /wd4190 /wd4100 /wd4127") if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14) # The following warning is generated over 800 times from a qwt header only diff --git a/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.cpp b/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.cpp index 7f05be78f6..bfb20b3cb9 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.cpp @@ -46,7 +46,6 @@ void RicfCommandFileExecutor::ExportTypeEnum::setUp() /// //-------------------------------------------------------------------------------------------------- RicfCommandFileExecutor::RicfCommandFileExecutor() - : m_exportDataSourceAsComment( true ) { } diff --git a/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.h b/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.h index c53aa612e9..4bd3c5e7d4 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.h +++ b/ApplicationLibCode/CommandFileInterface/RicfCommandFileExecutor.h @@ -66,5 +66,4 @@ private: std::map m_exportPaths; QString m_lastProjectPath; - bool m_exportDataSourceAsComment; }; diff --git a/ApplicationLibCode/Commands/CMakeLists.txt b/ApplicationLibCode/Commands/CMakeLists.txt index 691badfd00..a8e5cbe5e7 100644 --- a/ApplicationLibCode/Commands/CMakeLists.txt +++ b/ApplicationLibCode/Commands/CMakeLists.txt @@ -73,22 +73,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options( Commands PRIVATE -Wall - -Wno-unused-parameter -Wno-reorder - -Wno-parentheses -Wno-switch + -Wno-undefined-var-template -Wno-delete-abstract-non-virtual-dtor - -Wno-undefined-var-template - -Wno-invalid-source-encoding - -Wno-enum-compare -Wno-call-to-pure-virtual-from-ctor-dtor - -Wno-unused-variable - -Wno-unused-private-field - -Wno-unused-lambda-capture -Wno-delete-non-abstract-non-virtual-dtor - -Wno-braced-scalar-init - -Wno-tautological-constant-out-of-range-compare - -Wno-undefined-var-template -Wno-ambiguous-reversed-operator ) endif() @@ -111,7 +101,7 @@ if(MSVC) # set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W3 /wd4190 # /wd4100 /wd4127") - set(BUILD_FLAGS_FOR_MSVC "/wd4190 /wd4100 /wd4127 /wd4245 /wd4005 /wd4573") + set(BUILD_FLAGS_FOR_MSVC "/W3 /wd4190 /wd4100 /wd4127") if(CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14) # The following warning is generated over 800 times from a qwt header only diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp index 460d776f3e..de2a8c693c 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp @@ -55,8 +55,7 @@ bool RicImportEnsembleFractureStatisticsFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicImportEnsembleFractureStatisticsFeature::onActionTriggered( bool isChecked ) { - RiaGuiApplication* app = RiaGuiApplication::instance(); - QString pathCacheName = "INPUT_FILES"; + QString pathCacheName = "INPUT_FILES"; auto [fileNames, groupByEnsemble] = runRecursiveFileSearchDialog( "Import StimPlan Fractures", pathCacheName ); if ( groupByEnsemble == RiaEnsembleNameTools::EnsembleGroupingMode::NONE ) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp index b6cd2b5f44..b6bc45c2a0 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp @@ -680,8 +680,6 @@ std::vector RicExportFractureCompletionsImpl::computeWellPointsInFra cvf::Vec3d startPos = wellPathCoords.front(); cvf::Vec3d endPos = wellPathCoords.back(); - cvf::Vec3d wellPathTangent = endPos - startPos; - cvf::Plane fracturePlane; auto fractureTransform = fracture->transformMatrix(); fracturePlane.setFromPointAndNormal( fractureTransform.translation(), static_cast( fractureTransform.col( 2 ) ) ); diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicMswTableFormatterTools.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicMswTableFormatterTools.cpp index 04a63c0d20..b07193bbb9 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicMswTableFormatterTools.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicMswTableFormatterTools.cpp @@ -444,8 +444,6 @@ void RicMswTableFormatterTools::generateCompsegHeader( RifTextDataTableFormatter //-------------------------------------------------------------------------------------------------- void RicMswTableFormatterTools::generateWsegvalvTable( RifTextDataTableFormatter& formatter, RicMswExportInfo& exportInfo ) { - bool foundValve = false; - std::map> wsegvalveData; generateWsegvalvTableRecursively( exportInfo.mainBoreBranch(), @@ -729,8 +727,6 @@ void RicMswTableFormatterTools::writeWelsegsSegment( RicMswSegment* std::vector> segments = createSubSegmentMDPairs( startMD, endMD, maxSegmentLength ); CVF_ASSERT( branch->wellPath() ); - auto wellPathGeometry = branch->wellPath()->wellPathGeometry(); - CVF_ASSERT( wellPathGeometry ); double prevOutMD = branch->startMD(); double prevOutTVD = branch->startTVD(); @@ -851,9 +847,6 @@ void RicMswTableFormatterTools::writeValveWelsegsSegment( const RicMswSegment* std::vector> splitSegments = createSubSegmentMDPairs( startMD, endMD, maxSegmentLength ); - auto wellPathGeometry = valve->wellPath()->wellPathGeometry(); - CVF_ASSERT( wellPathGeometry ); - const auto linerDiameter = valve->wellPath()->mswCompletionParameters()->linerDiameter( exportInfo.unitSystem() ); const auto roughnessFactor = valve->wellPath()->mswCompletionParameters()->roughnessFactor( exportInfo.unitSystem() ); diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index aa3d2d1843..239348b8b5 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -761,8 +761,6 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfoForWell( auto cellIntersections = generateCellSegments( eclipseCase, wellPath ); double initialMD = computeIntitialMeasuredDepth( eclipseCase, wellPath, mswParameters, cellIntersections ); - RiaDefines::EclipseUnitSystem unitSystem = eclipseCase->eclipseCaseData()->unitsType(); - bool enableSegmentSplitting = false; generateFishbonesMswExportInfo( eclipseCase, wellPath, initialMD, cellIntersections, enableSegmentSplitting, exportInfo, branch ); } @@ -777,8 +775,7 @@ bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEcl gsl::not_null exportInfo, gsl::not_null branch ) { - auto mswParameters = wellPath->mswCompletionParameters(); - auto fractures = wellPath->fractureCollection()->activeFractures(); + auto fractures = wellPath->fractureCollection()->activeFractures(); std::vector filteredIntersections = filterIntersections( cellIntersections, initialMD, wellPath->wellPathGeometry(), eclipseCase ); @@ -922,8 +919,6 @@ bool RicWellPathExportMswCompletionsImpl::generatePerforationsMswExportInfo( Rim std::vector RicWellPathExportMswCompletionsImpl::generateCellSegments( const RimEclipseCase* eclipseCase, const RimWellPath* wellPath ) { - const RigActiveCellInfo* activeCellInfo = eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ); - auto wellPathGeometry = wellPath->wellPathGeometry(); CVF_ASSERT( wellPathGeometry ); @@ -1186,9 +1181,6 @@ void RicWellPathExportMswCompletionsImpl::createValveCompletions( gsl::not_null< double exportStartTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, exportStartMD ); double exportEndTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, exportEndMD ); - double overlapStartTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, overlapStart ); - double overlapEndTVD = RicMswTableFormatterTools::tvdFromMeasuredDepth( wellPath, overlapEnd ); - if ( segment->startMD() <= valveMD && valveMD < segment->endMD() ) { if ( valve->componentType() == RiaDefines::WellPathComponentType::AICD ) diff --git a/ApplicationLibCode/Commands/ExportCommands/RicCreateDepthAdjustedLasFilesFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicCreateDepthAdjustedLasFilesFeature.cpp index 3cfbfce39c..5cb2437050 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicCreateDepthAdjustedLasFilesFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicCreateDepthAdjustedLasFilesFeature.cpp @@ -74,7 +74,6 @@ void RicCreateDepthAdjustedLasFilesFeature::onActionTriggered( bool isChecked ) { RimCase* selectedCase = featureUi.selectedCase(); RimWellPath* sourceWell = featureUi.sourceWell(); - RimWellLogFile* sourceWellLogFile = featureUi.wellLogFile(); std::vector destinationWells = featureUi.destinationWells().ptrReferencedObjects(); std::vector selectedResultProperties = featureUi.selectedResultProperties(); QString exportFolder = featureUi.exportFolder(); @@ -146,7 +145,6 @@ void RicCreateDepthAdjustedLasFilesFeature::createDepthAdjustedWellLogFileFromGe { if ( sourceWell->wellLogFiles().empty() ) return; - auto* wellLogFileData = sourceWell->wellLogFiles()[0]->wellLogFileData(); RimWellLogPlotCollection* wellLogCollection = RimMainPlotCollection::current()->wellLogPlotCollection(); cvf::ref sourceWellExtractor = wellLogCollection->findOrCreateExtractor( sourceWell, geoMechCase ); if ( sourceWellExtractor.isNull() ) diff --git a/ApplicationLibCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp b/ApplicationLibCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp index 85ce26f040..751ee30c50 100644 --- a/ApplicationLibCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp +++ b/ApplicationLibCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp @@ -415,9 +415,8 @@ QString VdeVizDataExtractor::createModelMetaJsonString( const std::vectorcontentType(); - auto sourcePlots = summaryMultiPlot->summaryPlots(); + auto sourcePlots = summaryMultiPlot->summaryPlots(); std::vector pdmObjects; for ( auto summaryAdrCollection : sumAddressCollections ) diff --git a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp index 4c3c490dcb..6c4268e247 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp @@ -62,8 +62,7 @@ bool RicImportEnsembleSurfaceFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked ) { - RiaApplication* app = RiaApplication::instance(); - QString pathCacheName = "ENSEMBLE_SURFACE_FILES"; + QString pathCacheName = "ENSEMBLE_SURFACE_FILES"; auto [fileNames, groupByEnsemble] = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName ); importEnsembleSurfaceFromFiles( fileNames, groupByEnsemble ); diff --git a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp index 055ffb63aa..a94c02a555 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp @@ -58,8 +58,7 @@ bool RicImportEnsembleWellLogsFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicImportEnsembleWellLogsFeature::onActionTriggered( bool isChecked ) { - RiaApplication* app = RiaApplication::instance(); - QString pathCacheName = "ENSEMBLE_WELL_LOGS_FILES"; + QString pathCacheName = "ENSEMBLE_WELL_LOGS_FILES"; auto [fileNames, groupByEnsemble] = runRecursiveFileSearchDialog( "Import Ensemble Well Logs", pathCacheName ); if ( fileNames.isEmpty() ) return; diff --git a/ApplicationLibCode/Commands/RicNewCustomObjectiveFunctionFeature.cpp b/ApplicationLibCode/Commands/RicNewCustomObjectiveFunctionFeature.cpp index 7bf8a01b8a..f5e3cbf142 100644 --- a/ApplicationLibCode/Commands/RicNewCustomObjectiveFunctionFeature.cpp +++ b/ApplicationLibCode/Commands/RicNewCustomObjectiveFunctionFeature.cpp @@ -51,8 +51,8 @@ void RicNewCustomObjectiveFunctionFeature::onActionTriggered( bool isChecked ) if ( coll.size() == 1 ) { - RimCustomObjectiveFunction* newFunc = coll[0]->addObjectiveFunction(); - RimCustomObjectiveFunctionWeight* newWeight = RimObjectiveFunctionTools::addWeight( newFunc ); + RimCustomObjectiveFunction* newFunc = coll[0]->addObjectiveFunction(); + RimObjectiveFunctionTools::addWeight( newFunc ); coll[0]->updateConnectedEditors(); RiuPlotMainWindowTools::selectAsCurrentItem( newFunc ); RiuPlotMainWindowTools::setExpanded( coll.front() ); diff --git a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp index 8652cedf45..02d1db743f 100644 --- a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp +++ b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp @@ -89,11 +89,8 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea dialog.m_fileFilterField->addItem( fileNameFilter ); dialog.m_pathFilterField->addItem( QDir::toNativeSeparators( pathFilterText ) ); - for ( const auto& s : fileExtensions ) - { - QString joined = fileExtensions.join( '|' ); - dialog.m_fileExtensionsField->setText( joined ); - } + QString joined = fileExtensions.join( '|' ); + dialog.m_fileExtensionsField->setText( joined ); dialog.m_fileFilterField->addItem( fileNameFilter ); @@ -413,8 +410,8 @@ void RicRecursiveFileSearchDialog::updateFileListWidget() std::vector groupedByEnsemble = RiaEnsembleNameTools::groupFilesByEnsemble( m_foundFiles, ensembleGroupingMode() ); for ( const QStringList& groupedFileNames : groupedByEnsemble ) { - QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( groupedFileNames, ensembleGroupingMode() ); - QListWidgetItem* item = new QListWidgetItem( QDir::toNativeSeparators( ensembleName ), m_fileListWidget ); + QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( groupedFileNames, ensembleGroupingMode() ); + new QListWidgetItem( QDir::toNativeSeparators( ensembleName ), m_fileListWidget ); addToFileListWidget( groupedFileNames ); } } diff --git a/ApplicationLibCode/Commands/RicReloadSummaryCaseFeature.cpp b/ApplicationLibCode/Commands/RicReloadSummaryCaseFeature.cpp index 74cc26264a..11aa94740a 100644 --- a/ApplicationLibCode/Commands/RicReloadSummaryCaseFeature.cpp +++ b/ApplicationLibCode/Commands/RicReloadSummaryCaseFeature.cpp @@ -66,8 +66,6 @@ bool RicReloadSummaryCaseFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicReloadSummaryCaseFeature::onActionTriggered( bool isChecked ) { - RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection(); - std::vector caseSelection = selectedSummaryCases(); for ( RimSummaryCase* summaryCase : caseSelection ) { diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp index 1bdf3eadca..26d266d71e 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp @@ -87,8 +87,6 @@ RimSummaryPlot* RicNewGridTimeHistoryCurveFeature::userSelectedSummaryPlot() const QString lastUsedSummaryPlotKey( "lastUsedSummaryPlotKey" ); - RimSummaryMultiPlotCollection* summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection(); - RimSummaryPlot* defaultSelectedPlot = nullptr; { QString lastUsedPlotRef = app->cacheDataObject( lastUsedSummaryPlotKey ).toString(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.cpp index ebe9176ae2..b89ab98050 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicNewSummaryEnsembleCurveSetFeature.cpp @@ -107,8 +107,7 @@ std::vector RicNewSummaryEnsembleCurveSetFeature::addDefau //-------------------------------------------------------------------------------------------------- RimSummaryPlot* RicNewSummaryEnsembleCurveSetFeature::createPlotForCurveSetsAndUpdate( std::vector ensembles ) { - RiaGuiApplication* app = RiaGuiApplication::instance(); - RimProject* proj = app->project(); + RiaGuiApplication* app = RiaGuiApplication::instance(); RiaPreferencesSummary* prefs = RiaPreferencesSummary::current(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp index f0f5ec2d51..5fc03d14fc 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorUi.cpp @@ -852,8 +852,6 @@ void RicSummaryPlotEditorUi::updateAppearanceEditor() //-------------------------------------------------------------------------------------------------- void RicSummaryPlotEditorUi::createNewPlot() { - RimProject* proj = RimProject::current(); - RimSummaryPlot* newSummaryPlot = nullptr; if ( !m_plotContainer ) diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp index e04d52f3ff..5c63d1e433 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp @@ -140,7 +140,6 @@ std::vector openEclipseCasesForCellPlotting( QStringList gridFi { std::vector openedCases; - RiaApplication* app = RiaApplication::instance(); RimEclipseCaseCollection* analysisModels = RimProject::current()->activeOilField()->analysisModels(); for ( const QString& fileName : gridFileNames ) { diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp index 04901d01f4..337b9694c9 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp @@ -152,7 +152,6 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures() RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection(); if ( wellPathCollection ) { - int index = 0; for ( auto measuredDepth : m_ui->locationConfig()->locations() ) { RimModeledWellPath* newModeledWellPath = dynamic_cast( diff --git a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp index 69c2bc04fb..04bf072a77 100644 --- a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp @@ -115,7 +115,7 @@ bool RifOpmCommonEclipseSummary::open( const QString& fileName, bool includeRest RifOpmCommonEclipseSummary::increaseEsmryFileCount(); } - catch ( std::exception& e ) + catch ( std::exception& ) { if ( threadSafeLogger ) { diff --git a/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp b/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp index 2af4c179e5..738abf5711 100644 --- a/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp @@ -151,7 +151,7 @@ void RifOpmGridTools::transferCoordinates( Opm::EclIO::EGrid& opmMainGrid, Opm:: std::vector snapToCoordinatesFromMainGrid; - for ( size_t opmCellIndex = 0; opmCellIndex < cellCount; opmCellIndex++ ) + for ( int opmCellIndex = 0; opmCellIndex < static_cast( cellCount ); opmCellIndex++ ) { opmGrid.getCellCorners( opmCellIndex, opmX, opmY, opmZ ); @@ -223,7 +223,7 @@ void RifOpmGridTools::transferCoordinates( Opm::EclIO::EGrid& opmMainGrid, Opm:: { const auto& pillarCordinates = candidates[closestPillarIndex]; - int layerCount = pillarCordinates.size() / 2; + int layerCount = static_cast( pillarCordinates.size() / 2 ); int layerIndexInMainGridCell = ijkCell[2] % layerCount; int localNodeIndex = opmNodeIndex % 8; @@ -282,7 +282,7 @@ std::map> auto mainGridCellIndex = hostCellGlobalIndices[cIdx]; opmMainGrid.getCellCorners( mainGridCellIndex, opmX, opmY, opmZ ); - auto ijkLocalGrid = opmGrid.ijk_from_global_index( cIdx ); + auto ijkLocalGrid = opmGrid.ijk_from_global_index( static_cast( cIdx ) ); auto layer = ijkLocalGrid[2]; // Four corners for top diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp index b393a17205..458e4fa635 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSummaryReader.cpp @@ -21,9 +21,10 @@ #include "RifCsvUserDataParser.h" #include "RifRevealCsvSectionSummaryReader.h" +#include "RiaTextStringTools.h" + #include #include -#include //-------------------------------------------------------------------------------------------------- /// @@ -55,7 +56,7 @@ std::pair RifRevealCsvSummaryReader::parse( const QString& fileNa // Split files on strange header line (starts with ",Date"). QString fileContents = in.readAll(); - QStringList parts = fileContents.split( ",Date", QString::SkipEmptyParts ); + QStringList parts = RiaTextStringTools::splitSkipEmptyParts( fileContents, ",Date" ); // Parse each section separately bool isFirst = true; diff --git a/ApplicationLibCode/FileInterface/RifSeismicZGYReader.cpp b/ApplicationLibCode/FileInterface/RifSeismicZGYReader.cpp index f73871cb7e..441d139433 100644 --- a/ApplicationLibCode/FileInterface/RifSeismicZGYReader.cpp +++ b/ApplicationLibCode/FileInterface/RifSeismicZGYReader.cpp @@ -57,7 +57,7 @@ bool RifSeismicZGYReader::open( QString filename ) return false; } } - catch ( const std::exception& err ) + catch ( const std::exception& ) { m_reader.reset(); return false; diff --git a/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp b/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp index 340023d8b2..3255117a6a 100644 --- a/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp +++ b/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp @@ -375,9 +375,9 @@ std::pair, std::vector> RifSurfaceImporter::re // Checks if the given vector is a possible new candidate for an axis vector and adds it to the given list // of axesVectorCandidates. Also increases the number of occurrences of vector candidates. - auto maybeInsertAxisVectorCandidate = [epsilon]( const cvf::Vec2d vector, - std::map& axesVectorCandidates, - std::map& axesVectorCandidatesNum ) -> bool + auto maybeInsertAxisVectorCandidate = []( const cvf::Vec2d vector, + std::map& axesVectorCandidates, + std::map& axesVectorCandidatesNum ) -> bool { double length = vector.length(); cvf::Vec2d normalizedVector = vector.getNormalized(); diff --git a/ApplicationLibCode/FileInterface/RifWellPathImporter.cpp b/ApplicationLibCode/FileInterface/RifWellPathImporter.cpp index 4408d85408..b3fbae0329 100644 --- a/ApplicationLibCode/FileInterface/RifWellPathImporter.cpp +++ b/ApplicationLibCode/FileInterface/RifWellPathImporter.cpp @@ -239,7 +239,7 @@ void RifWellPathImporter::readAllAsciiWellData( const QString& filePath ) std::string line; std::getline( stream, line, '\n' ); - // Skip possible comment lines (-- is used in eclipse, so Haakon Høgstøl considered it smart to skip these + // Skip possible comment lines (-- is used in eclipse, so Haakon H�gst�l considered it smart to skip these // here as well) The first "-" is eaten by the stream >> x above if ( line.find( "-" ) == 0 || line.find( "#" ) == 0 ) { @@ -248,8 +248,8 @@ void RifWellPathImporter::readAllAsciiWellData( const QString& filePath ) else { // Find the first and the last position of any quotes (and do not care to match quotes) - size_t quoteStartIdx = line.find_first_of( "'`´’‘" ); - size_t quoteEndIdx = line.find_last_of( "'`´’‘" ); + size_t quoteStartIdx = line.find_first_of( "'`" ); + size_t quoteEndIdx = line.find_last_of( "'`" ); std::string wellName; bool haveAPossibleWellStart = false; diff --git a/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h b/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h index d743e39b43..d477571615 100644 --- a/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h +++ b/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemNativeVisibleCellsStatCalc.h @@ -61,7 +61,7 @@ private: { RigFemPart* part = m_caseData->femParts()->part( pIdx ); int elmCount = part->elementCount(); - auto frames = m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr ); + m_resultsData->findOrLoadScalarResult( pIdx, m_resVarAddr ); auto [stepIdx, frameIdx] = m_resultsData->stepListIndexToTimeStepAndDataFrameIndex( timeStepIndex ); diff --git a/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp index c259e18d07..4d9bab31bf 100644 --- a/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp @@ -152,10 +152,10 @@ void RivElementVectorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::Mode const std::vector& cells = eclipseCase->mainGrid()->globalCellArray(); - auto getFaceCenterAndNormal = [activeCellInfo, cells, arrowScaling, displayCordXf]( size_t globalCellIdx, - cvf::StructGridInterface::FaceType faceType, - cvf::Vec3d& faceCenter, - cvf::Vec3d& faceNormal ) + auto getFaceCenterAndNormal = [cells, arrowScaling, displayCordXf]( size_t globalCellIdx, + cvf::StructGridInterface::FaceType faceType, + cvf::Vec3d& faceCenter, + cvf::Vec3d& faceNormal ) { faceCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].faceCenter( faceType ) ); cvf::Vec3d cellCenter = displayCordXf->transformToDisplayCoord( cells[globalCellIdx].center() ); diff --git a/ApplicationLibCode/ModelVisualization/RivReservoirPartMgr.h b/ApplicationLibCode/ModelVisualization/RivReservoirPartMgr.h index adb37872c5..0af3afd57c 100644 --- a/ApplicationLibCode/ModelVisualization/RivReservoirPartMgr.h +++ b/ApplicationLibCode/ModelVisualization/RivReservoirPartMgr.h @@ -80,6 +80,4 @@ private: cvf::Collection m_allGrids; // Main grid and all LGR's cvf::ref m_elementVectorResultMgr; cvf::ref m_faultsPartMgr; - - RivCellSetEnum m_cellSetType; }; diff --git a/ApplicationLibCode/ModelVisualization/RivReservoirViewPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivReservoirViewPartMgr.cpp index eb88062dd2..211d45c405 100644 --- a/ApplicationLibCode/ModelVisualization/RivReservoirViewPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivReservoirViewPartMgr.cpp @@ -615,8 +615,8 @@ void RivReservoirViewPartMgr::computeNativeVisibility( cvf::UByteArray* size_t reservoirCellIndex = grid->reservoirCellIndex( cellIndex ); bool isCellActive = activeCellInfo->isActive( reservoirCellIndex ); - if ( !invalidCellsIsVisible && cell.isInvalid() || !inactiveCellsIsVisible && !isCellActive || - !activeCellsIsVisible && isCellActive || ( *cellIsInWellStatuses )[cellIndex] ) + if ( ( !invalidCellsIsVisible && cell.isInvalid() ) || ( !inactiveCellsIsVisible && !isCellActive ) || + ( !activeCellsIsVisible && isCellActive ) || ( *cellIsInWellStatuses )[cellIndex] ) { ( *cellVisibility )[cellIndex] = false; } diff --git a/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.h b/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.h index 87f2caf4c3..9482c9664d 100644 --- a/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.h +++ b/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.h @@ -91,5 +91,4 @@ private: caf::PdmPointer m_rimReservoirView; uint m_count; size_t m_currentT; - bool m_showAsVectors; }; diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp index 76bbd20a53..c4d208ede8 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationOverTimePlot.cpp @@ -454,11 +454,11 @@ RigWellAllocationOverTime RimWellAllocationOverTimePlot::createWellAllocationOve } std::map*> tracerFractionCellValues = - RimWellAllocationTools::findOrCreateRelevantTracerCellFractions( simWellData, m_flowDiagSolution, i ); + RimWellAllocationTools::findOrCreateRelevantTracerCellFractions( simWellData, m_flowDiagSolution, static_cast( i ) ); auto simWellBranches = RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineForTimeStep( m_case->eclipseCaseData(), simWellData, - i, + static_cast( i ), branchDetection, true ); diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index 17b2009665..aa6aacc854 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -568,9 +568,9 @@ void RimWellPltPlot::syncCurvesFromUiSelection() : tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE : cvf::Color3f::DARK_GRAY; - if ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( FLOW_PHASE_OIL ) || - tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( FLOW_PHASE_GAS ) || - tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count( FLOW_PHASE_WATER ) ) + if ( ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( FLOW_PHASE_OIL ) ) || + ( tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( FLOW_PHASE_GAS ) ) || + ( tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count( FLOW_PHASE_WATER ) ) ) { FlowPhase flowPhase = FLOW_PHASE_NONE; if ( tracerName == RIG_FLOW_OIL_NAME ) diff --git a/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultDefinition.cpp b/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultDefinition.cpp index d7a657288c..f96c19dde8 100644 --- a/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultDefinition.cpp +++ b/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultDefinition.cpp @@ -428,7 +428,7 @@ void RimIntersectionResultDefinition::defineUiOrdering( QString uiConfigName, ca m_geomResultDefinition->uiOrdering( uiConfigName, uiOrdering ); } - if ( ( eclipseCase && m_eclipseResultDefinition->hasDynamicResult() || m_eclipseResultDefinition->isTernarySaturationSelected() ) || + if ( ( ( eclipseCase && ( m_eclipseResultDefinition->hasDynamicResult() || m_eclipseResultDefinition->isTernarySaturationSelected() ) ) ) || geomCase ) { uiOrdering.add( &m_timeStep ); diff --git a/ApplicationLibCode/ProjectDataModel/RimTools.cpp b/ApplicationLibCode/ProjectDataModel/RimTools.cpp index e7944d0e1c..b74ffe1fcb 100644 --- a/ApplicationLibCode/ProjectDataModel/RimTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimTools.cpp @@ -161,7 +161,7 @@ QString RimTools::relocateFile( const QString& originalFileName, } } - if ( !pathEndsDiffer && firstDiffIdx < fileNamePathElements.size() || firstDiffIdx < oldProjPathElements.size() ) + if ( ( !pathEndsDiffer && firstDiffIdx < fileNamePathElements.size() ) || firstDiffIdx < oldProjPathElements.size() ) { pathEndsDiffer = true; } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp index 98c243567b..95bce6ba3b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp @@ -98,8 +98,7 @@ void RimSummaryCaseCollection::sortByBinnedVariation( std::vector rhs.variationBin; } ); + []( const RigEnsembleParameter& lhs, const RigEnsembleParameter& rhs ) { return lhs.variationBin > rhs.variationBin; } ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h index a1f7a8d90d..dfb3337132 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTable.h @@ -115,6 +115,4 @@ private: caf::PdmField m_axisLabelFontSize; caf::PdmField m_valueLabelFontSize; caf::PdmField m_showValueLabels; - - const int m_initialNumberOfTimeSteps = 10; }; diff --git a/ApplicationLibCode/ReservoirDataModel/ResultAccessors/RigDepthResultAccessor.cpp b/ApplicationLibCode/ReservoirDataModel/ResultAccessors/RigDepthResultAccessor.cpp index df48e6a927..6ab0fd2dce 100644 --- a/ApplicationLibCode/ReservoirDataModel/ResultAccessors/RigDepthResultAccessor.cpp +++ b/ApplicationLibCode/ReservoirDataModel/ResultAccessors/RigDepthResultAccessor.cpp @@ -59,7 +59,7 @@ std::vector RigDepthResultAccessor::resultValues( RigEclipseCaseData* for ( auto k : kvals ) { - int tmpCellIdx = grid->cellIndexFromIJK( i, j, k ); + size_t tmpCellIdx = grid->cellIndexFromIJK( i, j, k ); double tmpVal = 0.0; if ( !activeCellInfo->isActive( tmpCellIdx ) ) @@ -91,7 +91,7 @@ std::vector RigDepthResultAccessor::resultValues( RigEclipseCaseData* std::vector RigDepthResultAccessor::kValues( RigEclipseCaseData* eclipseCaseData, int gridIndex ) { std::vector kvals; - int maxK = eclipseCaseData->grid( gridIndex )->cellCountK(); + int maxK = static_cast( eclipseCaseData->grid( gridIndex )->cellCountK() ); for ( int i = 0; i < maxK; i++ ) { @@ -115,7 +115,7 @@ std::vector RigDepthResultAccessor::depthValues( RigEclipseCaseData* ecl if ( grid->ijkFromCellIndex( startCellIndex, &i, &j, &dummy ) ) { - int maxK = grid->cellCountK(); + int maxK = static_cast( grid->cellCountK() ); for ( int k = 0; k < maxK; k++ ) { diff --git a/ApplicationLibCode/ReservoirDataModel/RigAccWellFlowCalculator.h b/ApplicationLibCode/ReservoirDataModel/RigAccWellFlowCalculator.h index ba975fb04c..e80b6f4dda 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigAccWellFlowCalculator.h +++ b/ApplicationLibCode/ReservoirDataModel/RigAccWellFlowCalculator.h @@ -130,9 +130,6 @@ private: bool m_isProducer; bool m_useTotalWellPhaseRateOnly; - cvf::UByteArray* m_cellVisibilities = nullptr; - RigMainGrid* m_mainGrid = nullptr; - struct BranchFlow { std::vector depthValuesFromTop; diff --git a/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp b/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp index 30d1e4ba5c..f5c74980c1 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigLasFileExporter.cpp @@ -271,8 +271,7 @@ private: double m_rkbDiff; bool m_exportTvdrkb; - RiaDefines::DepthUnitType m_depthUnit; - std::vector m_depthValues; + std::vector m_depthValues; std::vector m_logCurveData; double m_minimumCurveValue; diff --git a/ApplicationLibCode/ReservoirDataModel/RigTexturedSection.cpp b/ApplicationLibCode/ReservoirDataModel/RigTexturedSection.cpp index 2d081606de..8f02b9d0bc 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigTexturedSection.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigTexturedSection.cpp @@ -47,7 +47,7 @@ void RigTexturedSection::setWhatToUpdate( WhatToUpdateEnum updateInfo, int index if ( index < 0 ) { start = 0; - stop = m_sectionParts.size(); + stop = static_cast( m_sectionParts.size() ); } for ( int i = start; i < stop; i++ ) @@ -94,7 +94,7 @@ bool RigTexturedSection::isValid() const //-------------------------------------------------------------------------------------------------- int RigTexturedSection::partsCount() const { - return m_sectionParts.size(); + return static_cast( m_sectionParts.size() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathFormations.h b/ApplicationLibCode/ReservoirDataModel/RigWellPathFormations.h index 2c7a65d773..f045de9b69 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathFormations.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathFormations.h @@ -31,10 +31,10 @@ struct RigWellPathFormation { - double mdTop; - double mdBase; - double tvdTop; - double tvdBase; + double mdTop{ 0.0 }; + double mdBase{ 0.0 }; + double tvdTop{ 0.0 }; + double tvdBase{ 0.0 }; QString formationName; }; diff --git a/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h b/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h index 2455331eb6..9ae721aeb4 100644 --- a/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h +++ b/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.h @@ -86,7 +86,6 @@ private: }; std::multiset m_sortedBarEntries; - Qt::Orientation m_orientation; std::map m_legendColors; bool m_isSortingByMaxValueInGroups; int m_labelPointSize; diff --git a/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp b/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp index b2368b865c..32b0fe0d2d 100644 --- a/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp +++ b/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp @@ -384,7 +384,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve if ( intersectionHit ) selItem = new RiuGeoMechSelectionItem( associatedGridView, geomResDef, - timestepIndex, + static_cast( timestepIndex ), dataFrameIndex, gridIndex, gridLocalCellIndex, @@ -395,7 +395,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve else selItem = new RiuGeoMechSelectionItem( associatedGridView, geomResDef, - timestepIndex, + static_cast( timestepIndex ), dataFrameIndex, gridIndex, gridLocalCellIndex, diff --git a/ApplicationLibCode/UserInterface/RiuFemTimeHistoryResultAccessor.cpp b/ApplicationLibCode/UserInterface/RiuFemTimeHistoryResultAccessor.cpp index 6b37782f8e..aea3124085 100644 --- a/ApplicationLibCode/UserInterface/RiuFemTimeHistoryResultAccessor.cpp +++ b/ApplicationLibCode/UserInterface/RiuFemTimeHistoryResultAccessor.cpp @@ -158,7 +158,11 @@ void RiuFemTimeHistoryResultAccessor::computeTimeHistoryData() const int frameCount = femPartResultsColl->frameCount( stepIdx ); for ( int frameIdx = 0; frameIdx < frameCount; frameIdx++ ) { - RiuGeoMechXfTensorResultAccessor stressXfAccessor( femPartResultsColl, *m_femResultAddress, m_gridIndex, stepIdx, frameIdx ); + RiuGeoMechXfTensorResultAccessor stressXfAccessor( femPartResultsColl, + *m_femResultAddress, + static_cast( m_gridIndex ), + stepIdx, + frameIdx ); float scalarValue = stressXfAccessor.calculateElmNodeValue( m_intersectionTriangle, closestElmNodeResIndex ); m_timeHistoryValues.push_back( scalarValue ); } diff --git a/ApplicationLibCode/UserInterface/RiuMdiArea.cpp b/ApplicationLibCode/UserInterface/RiuMdiArea.cpp index 67e33580d2..4e7742a32a 100644 --- a/ApplicationLibCode/UserInterface/RiuMdiArea.cpp +++ b/ApplicationLibCode/UserInterface/RiuMdiArea.cpp @@ -72,7 +72,7 @@ std::list RiuMdiArea::subWindowListSortedByPosition() // Sort of list so we first sort by window position but retain activation order // for windows with the same position windowList.sort( - [this]( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) + []( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) { if ( lhs->frameGeometry().topLeft().rx() == rhs->frameGeometry().topLeft().rx() ) { @@ -95,7 +95,7 @@ std::list RiuMdiArea::subWindowListSortedByVerticalPosition() } windowList.sort( - [this]( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) + []( QMdiSubWindow* lhs, QMdiSubWindow* rhs ) { if ( lhs->frameGeometry().topLeft().ry() == rhs->frameGeometry().topLeft().ry() ) { diff --git a/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp index 3bef3cc4a6..03ac4784c4 100644 --- a/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -447,14 +447,15 @@ void RiuSelectionChangedHandler::addDepthCurveFromSelectionItem( const RiuSelect std::vector resultValues = RigDepthResultAccessor::resultValues( casedata, eclResDef, - eclipseSelectionItem->m_gridIndex, + static_cast( eclipseSelectionItem->m_gridIndex ), eclipseSelectionItem->m_gridLocalCellIndex, currentTimeStep ); - std::vector kValues = RigDepthResultAccessor::kValues( casedata, eclipseSelectionItem->m_gridIndex ); + std::vector kValues = RigDepthResultAccessor::kValues( casedata, static_cast( eclipseSelectionItem->m_gridIndex ) ); - std::vector depthValues = - RigDepthResultAccessor::depthValues( casedata, eclipseSelectionItem->m_gridLocalCellIndex, eclipseSelectionItem->m_gridIndex ); + std::vector depthValues = RigDepthResultAccessor::depthValues( casedata, + static_cast( eclipseSelectionItem->m_gridLocalCellIndex ), + static_cast( eclipseSelectionItem->m_gridIndex ) ); CVF_ASSERT( kValues.size() == resultValues.size() ); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp index e51748f84e..c1d749daf5 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionUi.cpp @@ -95,67 +95,67 @@ SummaryIdentifierAndField::~SummaryIdentifierAndField() RiuSummaryVectorSelectionUi::RiuSummaryVectorSelectionUi() : m_identifierFieldsMap( { { RifEclipseSummaryAddress::SUMMARY_FIELD, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_AQUIFER, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_AQUIFER_NUMBER ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_NETWORK, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_MISC, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_REGION, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_NUMBER ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_NUMBER ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_REGION_2_REGION, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_2_REGION ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_REGION_2_REGION ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_GROUP, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_GROUP_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_GROUP_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_WELL, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION_LGR, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_WELL_LGR, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_WELL_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_SEGMENT_NUMBER ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_BLOCK, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_BLOCK_LGR, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_LGR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_CELL_IJK ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, { RifEclipseSummaryAddress::SUMMARY_IMPORTED, - { { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ) }, - { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } } }, + { new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_VECTOR_NAME ), + new SummaryIdentifierAndField( RifEclipseSummaryAddress::INPUT_ID ) } }, } ) , m_showIndividualEnsembleCases( true ) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae3154c095..ddaa0c3efa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -437,7 +437,10 @@ endif() add_subdirectory(ThirdParty/qwt) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(qwt PRIVATE -Wno-deprecated-copy) + target_compile_options( + qwt PRIVATE -Wno-deprecated-copy -Wno-deprecated-enum-float-conversion + -Wno-deprecated-enum-enum-conversion + ) elseif(MSVC) target_compile_options(qwt PRIVATE /wd4996 /wd4005) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt index 56c0e0288e..70de4d8296 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt @@ -22,6 +22,12 @@ add_executable( cafPdmScriptingBasicTest.cpp ) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options( + cafPdmScripting_UnitTests PRIVATE -Wno-delete-abstract-non-virtual-dtor + ) +endif() + target_link_libraries( ${PROJECT_NAME} cafPdmScripting ${QT_LIBRARIES} ${THREAD_LIBRARY} ) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt index b4a9a6e850..6ec68fc642 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt @@ -37,6 +37,14 @@ set(PROJECT_FILES # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES}) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + + target_compile_options( + cafPdmCore_UnitTests PRIVATE -Wno-ambiguous-reversed-operator + -Wno-invalid-source-encoding + ) +endif() + source_group("" FILES ${PROJECT_FILES}) if(Qt5Core_FOUND) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt index c069df4217..8ebab1d009 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt @@ -26,6 +26,13 @@ set(PROJECT_FILES cafPdmBasicTest.cpp cafProjectDataModel_UnitTests.cpp # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES} gtest/gtest-all.cpp) +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options( + cafProjectDataModel_UnitTests PRIVATE -Wno-ambiguous-reversed-operator + -Wno-invalid-source-encoding + ) +endif() + target_link_libraries( ${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES} ${THREAD_LIBRARY} ) diff --git a/Fwk/AppFwk/cafTests/cafTestCvfApplication/TapCvfSpecialization.h b/Fwk/AppFwk/cafTests/cafTestCvfApplication/TapCvfSpecialization.h index a800040402..76b602fc83 100644 --- a/Fwk/AppFwk/cafTests/cafTestCvfApplication/TapCvfSpecialization.h +++ b/Fwk/AppFwk/cafTests/cafTestCvfApplication/TapCvfSpecialization.h @@ -30,7 +30,9 @@ public: caf::PdmField> m_vecArrayField; protected: - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ); - void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ); + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + void defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; }; diff --git a/Fwk/VizFwk/LibCore/cvfVector2.cpp b/Fwk/VizFwk/LibCore/cvfVector2.cpp index 2930a25f62..2398662340 100644 --- a/Fwk/VizFwk/LibCore/cvfVector2.cpp +++ b/Fwk/VizFwk/LibCore/cvfVector2.cpp @@ -45,6 +45,5 @@ template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_DOUBLE, UN template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_FLOAT, UNDEFINED_FLOAT); template<> Vector2 const Vector2::UNDEFINED(UNDEFINED_INT, UNDEFINED_INT); - } // namespace cvf diff --git a/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfObject-Test.cpp b/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfObject-Test.cpp index b69ebad347..902e4bebb3 100644 --- a/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfObject-Test.cpp +++ b/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfObject-Test.cpp @@ -113,21 +113,6 @@ TEST(ObjectTest, AddRefAndRelease) } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -#if CVF_ENABLE_TIGHT_ASSERTS == 1 -TEST(ObjectDeathTest, AddRefAndReleaseBehaviorOnNullPointer) -{ - Object* obj = NULL; - - EXPECT_DEATH(obj->addRef(), "Assertion"); - EXPECT_DEATH(obj->refCount(), "Assertion"); - - // Release is OK on NULL pointer - EXPECT_EQ(0, obj->release()); -} -#endif //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfString-Test.cpp b/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfString-Test.cpp index 33194e7e7d..8b2a854814 100644 --- a/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfString-Test.cpp +++ b/Fwk/VizFwk/Tests/LibCore_UnitTests/cvfString-Test.cpp @@ -606,18 +606,10 @@ TEST(StringTest, Number) EXPECT_STREQ("1.234", s1.toAscii().ptr()); EXPECT_STREQ("-123000", s2.toAscii().ptr()); -#ifdef WIN32 - EXPECT_STREQ("5.4e+013", s3.toAscii().ptr()); -#else EXPECT_STREQ("5.4e+13", s3.toAscii().ptr()); -#endif String s4 = String::number(-1.2375e5f, 'e', 2); -#ifdef WIN32 - EXPECT_STREQ("-1.24e+005", s4.toAscii().ptr()); -#else EXPECT_STREQ("-1.24e+05", s4.toAscii().ptr()); -#endif String s5 = String::number(-1.2375e5f, 'f', 2); EXPECT_STREQ("-123750.00", s5.toAscii().ptr()); @@ -633,19 +625,11 @@ TEST(StringTest, Number) EXPECT_STREQ("1.234", s11.toAscii().ptr()); EXPECT_STREQ("-123000", s12.toAscii().ptr()); -#ifdef WIN32 - EXPECT_STREQ("5.4e+013", s13.toAscii().ptr()); -#else EXPECT_STREQ("5.4e+13", s13.toAscii().ptr()); -#endif String s14 = String::number(-1.2375e5, 'e', 2); -#ifdef WIN32 - EXPECT_STREQ("-1.24e+005", s14.toAscii().ptr()); -#else EXPECT_STREQ("-1.24e+05", s14.toAscii().ptr()); -#endif String s15 = String::number(-1.2375e5, 'f', 2); EXPECT_STREQ("-123750.00", s15.toAscii().ptr()); @@ -975,11 +959,7 @@ TEST(StringTest, StringBuilding) s11 += String(dfps); s11 += " (fps)"; -#ifdef WIN32 - EXPECT_STREQ("Framerate: 1.23457e+014 (fps)", s11.toAscii().ptr()); -#else EXPECT_STREQ("Framerate: 1.23457e+14 (fps)", s11.toAscii().ptr()); -#endif String s13 = "Framerate: " + String::number(dfps, 'f', 1) + " (fps)"; EXPECT_STREQ("Framerate: 123456789012345.6 (fps)", s13.toAscii().ptr());