mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixes detected by cppcheck (#4974)
* Janitor : Remove obsolete pointer to dialog * Janitor : Remove unused functions * Janitor : Remove unused functions * Janitor : Add explicit to constructors * Janitor : Remove unused variables * Janitor : Remove unused functions related to summary plot templates * clang-tidy : Use nullptr instead of 0 * clang-tidy : Fix usage of virtual and override * Upped to version 2019.08.2-dev.05 * Janitor : Remove unused variables * Janitor : Clean up several cppcheck issues * Janitor : Add cppcheck config files * Janitor : Use const when possible
This commit is contained in:
@@ -260,8 +260,8 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( cvf::P
|
||||
{
|
||||
QStringList fileNames = RicImportGeneralDataFeature::fileNamesFromCaseNames(
|
||||
cvfqt::Utils::toQStringList( o.values() ) );
|
||||
RicImportGeneralDataFeature::OpenCaseResults results =
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( fileNames, true );
|
||||
|
||||
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( fileNames, true );
|
||||
}
|
||||
|
||||
if ( cvf::Option o = progOpt->option( "commandFile" ) )
|
||||
@@ -434,4 +434,4 @@ void RiaConsoleApplication::runIdleProcessing()
|
||||
m_grpcServer->processAllQueuedRequests();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ protected:
|
||||
// Protected implementation specific overrides
|
||||
void invokeProcessEvents( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents ) override;
|
||||
void onProjectOpeningError( const QString& errMsg ) override;
|
||||
void onProjectOpened();
|
||||
void onProjectClosed();
|
||||
void onProjectOpened() override;
|
||||
void onProjectClosed() override;
|
||||
|
||||
private slots:
|
||||
void runIdleProcessing();
|
||||
|
||||
@@ -106,16 +106,6 @@ bool RiaEclipseFileNameTools::isSummarySpecFile( const QString& fileName )
|
||||
return hasMatchingSuffix( fileName, ECLIPSE_SMSPEC );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaEclipseFileNameTools::findBaseName( const QString& inputFilePath ) const
|
||||
{
|
||||
QFileInfo fi( inputFilePath );
|
||||
|
||||
return fi.baseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
static bool isSummarySpecFile( const QString& fileName );
|
||||
|
||||
private:
|
||||
QString findBaseName( const QString& inputFilePath ) const;
|
||||
QString relatedFilePath( EclipseFileType fileType ) const;
|
||||
|
||||
static bool hasMatchingSuffix( const QString& fileName, EclipseFileType fileType );
|
||||
|
||||
@@ -54,7 +54,7 @@ private:
|
||||
class RiaFeatureCommandContextHelper
|
||||
{
|
||||
public:
|
||||
RiaFeatureCommandContextHelper( QObject* externalObject );
|
||||
explicit RiaFeatureCommandContextHelper( QObject* externalObject );
|
||||
~RiaFeatureCommandContextHelper();
|
||||
};
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ protected:
|
||||
void onFileSuccessfullyLoaded( const QString& fileName, RiaDefines::ImportFileType fileType ) override;
|
||||
|
||||
void onProjectBeingOpened() override;
|
||||
void onProjectOpeningError( const QString& errMsg );
|
||||
void onProjectOpeningError( const QString& errMsg ) override;
|
||||
void onProjectOpened() override;
|
||||
void onProjectBeingClosed() override;
|
||||
void onProjectClosed() override;
|
||||
|
||||
@@ -28,7 +28,7 @@ class QStringList;
|
||||
class RiaStringListSerializer
|
||||
{
|
||||
public:
|
||||
RiaStringListSerializer( const QString& key );
|
||||
explicit RiaStringListSerializer( const QString& key );
|
||||
|
||||
void addString( const QString& textString, int maxStringCount );
|
||||
void removeString( const QString& textString );
|
||||
|
||||
@@ -134,8 +134,6 @@ QString RiaFilePathTools::removeDuplicatePathSeparators( const QString& path )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaFilePathTools::rootSearchPathFromSearchFilter( const QString& searchFilter )
|
||||
{
|
||||
std::set<QChar> globStartCharacters = {'*', '?', '['}; // ']' not needed
|
||||
|
||||
QStringList pathPartList = searchFilter.split( SEPARATOR );
|
||||
|
||||
QStringList::iterator pathPartIt = pathPartList.begin();
|
||||
|
||||
@@ -84,7 +84,6 @@ bool RiaGitDiff::executeDiff( const QString& baseFolder )
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray stdErr = proc.readAllStandardError();
|
||||
QByteArray stdOut = proc.readAllStandardOutput();
|
||||
m_diffOutput = stdOut;
|
||||
|
||||
|
||||
@@ -51,12 +51,12 @@ RiaTimeHistoryCurveResampler::RiaTimeHistoryCurveResampler() {}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaTimeHistoryCurveResampler::setCurveData( const std::vector<double>& values, const std::vector<time_t>& timeSteps )
|
||||
{
|
||||
if (values.empty() || timeSteps.empty())
|
||||
if ( values.empty() || timeSteps.empty() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CVF_ASSERT(values.size() == timeSteps.size());
|
||||
CVF_ASSERT( values.size() == timeSteps.size() );
|
||||
|
||||
clearData();
|
||||
m_originalValues = std::make_pair( values, timeSteps );
|
||||
@@ -123,10 +123,10 @@ std::vector<time_t>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaTimeHistoryCurveResampler::computeWeightedMeanValues( DateTimePeriod period )
|
||||
{
|
||||
size_t origDataSize = m_originalValues.second.size();
|
||||
size_t oi = 0;
|
||||
auto& origTimeSteps = m_originalValues.second;
|
||||
auto& origValues = m_originalValues.first;
|
||||
size_t origDataSize = m_originalValues.second.size();
|
||||
size_t oi = 0;
|
||||
const auto& origTimeSteps = m_originalValues.second;
|
||||
const auto& origValues = m_originalValues.first;
|
||||
|
||||
computeResampledTimeSteps( period );
|
||||
|
||||
@@ -191,10 +191,10 @@ void RiaTimeHistoryCurveResampler::computeWeightedMeanValues( DateTimePeriod per
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaTimeHistoryCurveResampler::computePeriodEndValues( DateTimePeriod period )
|
||||
{
|
||||
size_t origDataSize = m_originalValues.second.size();
|
||||
size_t oi = 0;
|
||||
auto& origTimeSteps = m_originalValues.second;
|
||||
auto& origValues = m_originalValues.first;
|
||||
size_t origDataSize = m_originalValues.second.size();
|
||||
size_t oi = 0;
|
||||
const auto& origTimeSteps = m_originalValues.second;
|
||||
const auto& origValues = m_originalValues.first;
|
||||
|
||||
computeResampledTimeSteps( period );
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ void RiaPolyArcLineSampler::sampledPointsAndMDs( double sample
|
||||
m_totalMD = startMD;
|
||||
|
||||
cvf::Vec3d p1 = pointsNoDuplicates[0];
|
||||
cvf::Vec3d p2 = pointsNoDuplicates[1];
|
||||
|
||||
m_points->push_back( p1 );
|
||||
m_meshDs->push_back( m_totalMD );
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RiaWellPlanCalculator.h"
|
||||
#include "RiaArcCurveCalculator.h"
|
||||
#include "RiaOffshoreSphericalCoords.h"
|
||||
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfMatrix4.h"
|
||||
|
||||
@@ -32,7 +33,7 @@ RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& sta
|
||||
{
|
||||
if ( m_lineArcEndPoints.size() < 2 ) return;
|
||||
|
||||
WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
||||
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
RiaOffshoreSphericalCoords startAziIncRad( m_startTangent );
|
||||
segment.inc = cvf::Math::toDegrees( startAziIncRad.inc() );
|
||||
@@ -44,9 +45,6 @@ RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& sta
|
||||
|
||||
m_wpResult.push_back( segment );
|
||||
|
||||
cvf::Vec3d p1 = m_lineArcEndPoints[0];
|
||||
cvf::Vec3d p2 = m_lineArcEndPoints[1];
|
||||
|
||||
cvf::Vec3d t2 = m_startTangent;
|
||||
|
||||
for ( size_t pIdx = 0; pIdx < m_lineArcEndPoints.size() - 1; ++pIdx )
|
||||
@@ -79,7 +77,7 @@ void RiaWellPlanCalculator::addSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent )
|
||||
{
|
||||
WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
||||
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
cvf::Vec3d p1p2 = p2 - p1;
|
||||
double length = p1p2.length();
|
||||
@@ -109,7 +107,7 @@ void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::V
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaWellPlanCalculator::addArcSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent )
|
||||
{
|
||||
WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
||||
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
RiaArcCurveCalculator arcCalc( p1, t1, p2 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user