mirror of https://github.com/ARMmbed/mbed-os.git
Fix Coverity issues
Issues fixed are related to: * Non-static class member initialization in constructors * Unused function return value * Always false statementspull/11453/head
parent
5e693778f4
commit
e12400932d
|
@ -46,7 +46,7 @@ static inline bool is_aligned(uint32_t number, uint32_t alignment)
|
|||
}
|
||||
}
|
||||
|
||||
FlashIAP::FlashIAP()
|
||||
FlashIAP::FlashIAP() : _page_buf(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
namespace mbed {
|
||||
|
||||
Ticker::Ticker() : TimerEvent(), _function(0), _lock_deepsleep(true)
|
||||
Ticker::Ticker() : TimerEvent(), _delay(0), _function(0), _lock_deepsleep(true)
|
||||
{
|
||||
}
|
||||
|
||||
// When low power ticker is in use, then do not disable deep sleep.
|
||||
Ticker::Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(!data->interface->runs_in_deep_sleep)
|
||||
Ticker::Ticker(const ticker_data_t *data) : TimerEvent(data), _delay(0), _function(0), _lock_deepsleep(!data->interface->runs_in_deep_sleep)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
*/
|
||||
ATCmdParser(FileHandle *fh, const char *output_delimiter = "\r",
|
||||
int buffer_size = 256, int timeout = 8000, bool debug = false)
|
||||
: _fh(fh), _buffer_size(buffer_size), _oob_cb_count(0), _in_prev(0), _oobs(NULL)
|
||||
: _fh(fh), _buffer_size(buffer_size), _oob_cb_count(0), _in_prev(0), _aborted(false), _oobs(NULL)
|
||||
{
|
||||
_buffer = new char[buffer_size];
|
||||
set_timeout(timeout);
|
||||
|
|
|
@ -397,7 +397,7 @@ void ATCmdParser::abort()
|
|||
bool ATCmdParser::process_oob()
|
||||
{
|
||||
int pre_count = _oob_cb_count;
|
||||
recv(NULL);
|
||||
static_cast<void>(recv(NULL));
|
||||
return _oob_cb_count != pre_count;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ SysTimer<US_IN_TICK, IRQ>::SysTimer() :
|
|||
_unacknowledged_ticks(0),
|
||||
_wake_time_set(false),
|
||||
_wake_time_passed(false),
|
||||
_wake_early(false),
|
||||
_ticking(false),
|
||||
_deep_sleep_locked(false)
|
||||
{
|
||||
|
@ -70,6 +71,7 @@ SysTimer<US_IN_TICK, IRQ>::SysTimer(const ticker_data_t *data) :
|
|||
_unacknowledged_ticks(0),
|
||||
_wake_time_set(false),
|
||||
_wake_time_passed(false),
|
||||
_wake_early(false),
|
||||
_ticking(false),
|
||||
_deep_sleep_locked(false)
|
||||
{
|
||||
|
|
|
@ -826,6 +826,7 @@ int _lseek(FILEHANDLE fh, int offset, int whence)
|
|||
off_t off = lseek(fh, offset, whence);
|
||||
// Assuming INT_MAX = LONG_MAX, so we don't care about prototype difference
|
||||
if (off > INT_MAX) {
|
||||
// Be cautious in case off_t is 64-bit
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue