Merge pull request #11494 from hugueskamba/hk-fix-coverity-iotcore-1334

Fix Coverity issue: Initialize FlashIAP non-static member in constructor
pull/11561/head
Martin Kojtal 2019-09-24 14:58:29 +02:00 committed by GitHub
commit 07ebd92f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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))
/**