mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 04:43:34 +08:00
Meaningful error codes instead of plain -1
This commit is contained in:
@@ -113,7 +113,7 @@ int DynamicTransferBufferManagerEntry::read(unsigned int offset, uint8_t* data,
|
||||
if (!data)
|
||||
{
|
||||
assert(0);
|
||||
return -1;
|
||||
return -ErrInvalidParam;
|
||||
}
|
||||
if (offset >= max_write_pos_)
|
||||
{
|
||||
@@ -148,7 +148,7 @@ int DynamicTransferBufferManagerEntry::write(unsigned int offset, const uint8_t*
|
||||
if (!data)
|
||||
{
|
||||
assert(0);
|
||||
return -1;
|
||||
return -ErrInvalidParam;
|
||||
}
|
||||
|
||||
if (offset >= max_size_)
|
||||
@@ -190,7 +190,6 @@ int DynamicTransferBufferManagerEntry::write(unsigned int offset, const uint8_t*
|
||||
if (new_block == NULL)
|
||||
{
|
||||
break; // We're in deep shit.
|
||||
|
||||
}
|
||||
// Appending the chain with the new block
|
||||
if (last_written_block != NULL)
|
||||
|
||||
Reference in New Issue
Block a user