Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes by clang-tidy #12

Open
wants to merge 1 commit into
base: clang-tidy-headers
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
//##################################################################################################

#include "gtest/gtest.h"
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <string>

//--------------------------------------------------------------------------------------------------
Expand Down
30 changes: 15 additions & 15 deletions AppFwk/cafHexInterpolator/cafHexInterpolator_UnitTest/gtest/gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@
// deprecated; calling a marked function
// should generate a compiler warning

#include <ctype.h> // for isspace, etc
#include <stddef.h> // for ptrdiff_t
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cctype> // for isspace, etc
#include <cstddef> // for ptrdiff_t
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <type_traits>

Expand Down Expand Up @@ -2473,7 +2473,7 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_

#if GTEST_OS_LINUX
# include <stdlib.h>
# include <cstdlib>
# include <sys/types.h>
# include <sys/wait.h>
# include <unistd.h>
Expand All @@ -2483,9 +2483,9 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
# include <stdexcept>
#endif

#include <ctype.h>
#include <float.h>
#include <string.h>
#include <cctype>
#include <cfloat>
#include <cstring>
#include <iomanip>
#include <limits>
#include <map>
Expand Down Expand Up @@ -2801,7 +2801,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
# include <mem.h>
#endif

#include <string.h>
#include <cstring>
#include <string>


Expand Down Expand Up @@ -9256,13 +9256,13 @@ class PolymorphicMatcher {
public:
explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}

virtual void DescribeTo(::std::ostream* os) const { impl_.DescribeTo(os); }
void DescribeTo(::std::ostream* os) const override { impl_.DescribeTo(os); }

virtual void DescribeNegationTo(::std::ostream* os) const {
void DescribeNegationTo(::std::ostream* os) const override {
impl_.DescribeNegationTo(os);
}

virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
bool MatchAndExplain(T x, MatchResultListener* listener) const override {
return impl_.MatchAndExplain(x, listener);
}

Expand Down Expand Up @@ -9531,7 +9531,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046

#endif // GTEST_INCLUDE_GTEST_GTEST_MATCHERS_H_

#include <stdio.h>
#include <cstdio>
#include <memory>

namespace testing {
Expand Down Expand Up @@ -10312,7 +10312,7 @@ TEST_P(DerivedTest, DoesBlah) {
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

#include <ctype.h>
#include <cctype>

#include <cassert>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion AppFwk/cafProjectDataModel/cafFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Factory
}
else
{
return NULL;
return nullptr;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "cafFilePath.h"
#include "cafPdmPointer.h"

#include <assert.h>
#include <cassert>
#include <type_traits>
#include <vector>

Expand Down
8 changes: 4 additions & 4 deletions AppFwk/cafProjectDataModel/cafPdmCore/cafPdmChildField.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PdmFieldXmlCap;
class PdmChildFieldHandle : public PdmFieldHandle
{
public:
virtual void childObjects( std::vector<PdmObjectHandle*>* objects ) = 0;
void childObjects( std::vector<PdmObjectHandle*>* objects ) override = 0;
virtual void setChildObject( PdmObjectHandle* object ) = 0;
};

Expand All @@ -46,7 +46,7 @@ class PdmChildField<DataType*> : public PdmChildFieldHandle
PdmChildField() {}
explicit PdmChildField( const DataTypePtr& fieldValue );
explicit PdmChildField( DataTypeUniquePtr fieldValue );
virtual ~PdmChildField();
~PdmChildField() override;

// Assignment

Expand All @@ -67,9 +67,9 @@ class PdmChildField<DataType*> : public PdmChildFieldHandle
const PdmPointer<DataType>& v() const { return m_fieldValue; }

// Child objects
virtual void childObjects( std::vector<PdmObjectHandle*>* objects ) override;
void childObjects( std::vector<PdmObjectHandle*>* objects ) override;
void setChildObject( PdmObjectHandle* object ) override;
virtual void removeChildObject( PdmObjectHandle* object ) override;
void removeChildObject( PdmObjectHandle* object ) override;

private:
PDM_DISABLE_COPY_AND_ASSIGN( PdmChildField );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Child : public caf::PdmObjectHandle
{
public:
Child();
~Child();
~Child() override;

caf::PdmChildField<TestObj*> m_testObj;
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Parent : public caf::PdmObjectHandle
{
public:
Parent();
~Parent();
~Parent() override;

void doSome();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestObj : public caf::PdmObjectHandle
{
public:
TestObj();
~TestObj();
~TestObj() override;

caf::PdmDataValueField<double> m_position;
};
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
//##################################################################################################

#include "gtest/gtest.h"
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <string>

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@
// deprecated; calling a marked function
// should generate a compiler warning

#include <ctype.h> // for isspace, etc
#include <stddef.h> // for ptrdiff_t
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cctype> // for isspace, etc
#include <cstddef> // for ptrdiff_t
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <type_traits>

Expand Down Expand Up @@ -2473,7 +2473,7 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_

#if GTEST_OS_LINUX
# include <stdlib.h>
# include <cstdlib>
# include <sys/types.h>
# include <sys/wait.h>
# include <unistd.h>
Expand All @@ -2483,9 +2483,9 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
# include <stdexcept>
#endif

#include <ctype.h>
#include <float.h>
#include <string.h>
#include <cctype>
#include <cfloat>
#include <cstring>
#include <iomanip>
#include <limits>
#include <map>
Expand Down Expand Up @@ -2801,7 +2801,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
# include <mem.h>
#endif

#include <string.h>
#include <cstring>
#include <string>


Expand Down Expand Up @@ -9256,13 +9256,13 @@ class PolymorphicMatcher {
public:
explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}

virtual void DescribeTo(::std::ostream* os) const { impl_.DescribeTo(os); }
void DescribeTo(::std::ostream* os) const override { impl_.DescribeTo(os); }

virtual void DescribeNegationTo(::std::ostream* os) const {
void DescribeNegationTo(::std::ostream* os) const override {
impl_.DescribeNegationTo(os);
}

virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
bool MatchAndExplain(T x, MatchResultListener* listener) const override {
return impl_.MatchAndExplain(x, listener);
}

Expand Down Expand Up @@ -9531,7 +9531,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046

#endif // GTEST_INCLUDE_GTEST_GTEST_MATCHERS_H_

#include <stdio.h>
#include <cstdio>
#include <memory>

namespace testing {
Expand Down Expand Up @@ -10312,7 +10312,7 @@ TEST_P(DerivedTest, DoesBlah) {
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

#include <ctype.h>
#include <cctype>

#include <cassert>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion AppFwk/cafProjectDataModel/cafPdmCore/cafPdmFieldHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CapabilityType* PdmFieldHandle::capability()
CapabilityType* capability = dynamic_cast<CapabilityType*>( m_capabilities[i].first );
if ( capability ) return capability;
}
return NULL;
return nullptr;
}

//--------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion AppFwk/cafProjectDataModel/cafPdmCore/cafPdmObjectHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PdmObjectHandle : public SignalObserver, public SignalEmitter
{
public:
PdmObjectHandle();
virtual ~PdmObjectHandle();
~PdmObjectHandle() override;

static QString classKeywordStatic(); // For PdmXmlFieldCap to be able to handle fields of PdmObjectHandle directly
static std::vector<QString> classKeywordAliases();
Expand Down
8 changes: 4 additions & 4 deletions AppFwk/cafProjectDataModel/cafPdmCore/cafPdmProxyValueField.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class PdmProxyValueField : public PdmProxyFieldHandle
typedef DataType FieldDataType;
PdmProxyValueField()
{
m_valueSetter = NULL;
m_valueGetter = NULL;
m_valueSetter = nullptr;
m_valueGetter = nullptr;
}
~PdmProxyValueField() override
{
Expand Down Expand Up @@ -139,7 +139,7 @@ class PdmProxyValueField : public PdmProxyFieldHandle
m_obj = obj;
}

void setValue( const DataType& value ) { ( m_obj->*m_setterMethod )( value ); }
void setValue( const DataType& value ) override { ( m_obj->*m_setterMethod )( value ); }

private:
SetterMethodType m_setterMethod;
Expand All @@ -165,7 +165,7 @@ class PdmProxyValueField : public PdmProxyFieldHandle
m_obj = obj;
}

DataType getValue() const { return ( m_obj->*m_getterMethod )(); }
DataType getValue() const override { return ( m_obj->*m_getterMethod )(); }

private:
GetterMethodType m_getterMethod;
Expand Down
16 changes: 8 additions & 8 deletions AppFwk/cafProjectDataModel/cafPdmCore/cafPdmPtrArrayField.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PdmPtrArrayField<DataType*> : public PdmPtrArrayFieldHandle
: m_isResolved( false )
{
}
virtual ~PdmPtrArrayField();
~PdmPtrArrayField() override;

PdmPtrArrayField& operator()() { return *this; }

Expand All @@ -50,11 +50,11 @@ class PdmPtrArrayField<DataType*> : public PdmPtrArrayFieldHandle

// Reimplementation of PdmPointersFieldHandle methods

virtual size_t size() const { return m_pointers.size(); }
virtual bool empty() const { return m_pointers.empty(); }
virtual void clear();
virtual void insertAt( int indexAfter, PdmObjectHandle* obj );
virtual PdmObjectHandle* at( size_t index );
size_t size() const override { return m_pointers.size(); }
bool empty() const override { return m_pointers.empty(); }
void clear() override;
void insertAt( int indexAfter, PdmObjectHandle* obj ) override;
PdmObjectHandle* at( size_t index ) override;

// std::vector-like access

Expand All @@ -66,7 +66,7 @@ class PdmPtrArrayField<DataType*> : public PdmPtrArrayFieldHandle
void insert( size_t indexAfter, const std::vector<PdmPointer<DataType>>& objects );
size_t count( const DataType* pointer ) const;

void erase( size_t index );
void erase( size_t index ) override;
size_t index( DataType* pointer );
void removePtr( PdmObjectHandle* object );

Expand All @@ -79,7 +79,7 @@ class PdmPtrArrayField<DataType*> : public PdmPtrArrayFieldHandle
std::vector<DataType*> ptrReferencedObjects() const;

// Child objects
virtual void ptrReferencedObjects( std::vector<PdmObjectHandle*>* );
void ptrReferencedObjects( std::vector<PdmObjectHandle*>* ) override;

private: // To be disabled
PDM_DISABLE_COPY_AND_ASSIGN( PdmPtrArrayField );
Expand Down
8 changes: 4 additions & 4 deletions AppFwk/cafProjectDataModel/cafPdmCore/cafPdmPtrField.inl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ template <typename DataType>
caf::PdmPtrField<DataType*>::~PdmPtrField()
{
if ( !m_fieldValue.isNull() ) m_fieldValue.rawPtr()->removeReferencingPtrField( this );
m_fieldValue.setRawPtr( NULL );
m_fieldValue.setRawPtr( nullptr );
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -54,7 +54,7 @@ void PdmPtrField<DataType*>::setValue( const DataTypePtr& fieldValue )

if ( m_fieldValue ) m_fieldValue->removeReferencingPtrField( this );
m_fieldValue = fieldValue;
if ( m_fieldValue != NULL ) m_fieldValue->addReferencingPtrField( this );
if ( m_fieldValue != nullptr ) m_fieldValue->addReferencingPtrField( this );
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -80,7 +80,7 @@ caf::PdmPtrField<DataType*>& PdmPtrField<DataType*>::operator=( const DataTypePt

if ( m_fieldValue ) m_fieldValue->removeReferencingPtrField( this );
m_fieldValue = fieldValue;
if ( m_fieldValue != NULL ) m_fieldValue->addReferencingPtrField( this );
if ( m_fieldValue != nullptr ) m_fieldValue->addReferencingPtrField( this );

return *this;
}
Expand All @@ -95,7 +95,7 @@ caf::PdmPtrField<DataType*>& PdmPtrField<DataType*>::operator=( const FieldDataT

if ( m_fieldValue ) m_fieldValue->removeReferencingPtrField( this );
m_fieldValue = fieldValue;
if ( m_fieldValue != NULL ) m_fieldValue->addReferencingPtrField( this );
if ( m_fieldValue != nullptr ) m_fieldValue->addReferencingPtrField( this );

return *this;
}
Expand Down
2 changes: 1 addition & 1 deletion AppFwk/cafProjectDataModel/cafPdmCore/cafSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Signal : public AbstractSignal
m_emitter->addEmittedSignal( this );
}

virtual ~Signal()
~Signal() override
{
for ( auto observerCallbackPair : m_observerCallbacks )
{
Expand Down
Loading