Fix Coverity issue: Initialize FlashIAP non-static member in constructor

pull/11494/head
Hugues Kamba 2019-09-16 19:12:12 +01:00
parent 1780a08d54
commit 8ea9acad8e
3 changed files with 6 additions and 14 deletions

View File

@ -63,8 +63,10 @@ namespace mbed {
*/
class FlashIAP : private NonCopyable<FlashIAP> {
public:
FlashIAP();
~FlashIAP();
constexpr FlashIAP() : _flash(), _page_buf(nullptr)
{
}
/** Initialize a flash IAP device
*

View File

@ -46,16 +46,6 @@ static inline bool is_aligned(uint32_t number, uint32_t alignment)
}
}
FlashIAP::FlashIAP() : _page_buf(nullptr)
{
}
FlashIAP::~FlashIAP()
{
}
int FlashIAP::init()
{
int ret = 0;

View File

@ -172,11 +172,11 @@ protected:
/**
* Disallow construction of NonCopyable objects from outside of its hierarchy.
*/
NonCopyable() { }
NonCopyable() = default;
/**
* Disallow destruction of NonCopyable objects from outside of its hierarchy.
*/
~NonCopyable() { }
~NonCopyable() = default;
#if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0))
/**