[FL-2811] Fix PVS-Studio warnings (#2142)

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
Georgii Surkov
2022-12-26 15:13:30 +03:00
committed by GitHub
parent ad3bff0b67
commit 8582670a34
201 changed files with 719 additions and 743 deletions

View File

@@ -212,7 +212,8 @@ static inline void traceFREE(void* pointer, size_t size) {
MemmgrHeapThreadDict_get(memmgr_heap_thread_dict, (uint32_t)thread_id);
if(alloc_dict) {
// In some cases thread may want to release memory that was not allocated by it
(void)MemmgrHeapAllocDict_erase(*alloc_dict, (uint32_t)pointer);
const bool res = MemmgrHeapAllocDict_erase(*alloc_dict, (uint32_t)pointer);
UNUSED(res);
}
memmgr_heap_thread_trace_depth--;
}
@@ -520,8 +521,8 @@ void vPortFree(void* pv) {
{
furi_assert((size_t)pv >= SRAM_BASE);
furi_assert((size_t)pv < SRAM_BASE + 1024 * 256);
furi_assert(pxLink->xBlockSize >= xHeapStructSize);
furi_assert((pxLink->xBlockSize - xHeapStructSize) < 1024 * 256);
furi_assert((int32_t)(pxLink->xBlockSize - xHeapStructSize) >= 0);
/* Add this block to the list of free blocks. */
xFreeBytesRemaining += pxLink->xBlockSize;