Skip to content

Commit

Permalink
Fixing max heap failures
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Sep 30, 2024
1 parent eb42699 commit cf02fbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Os/Generic/Types/MaxHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bool MaxHeap::push(FwQueuePriorityType value, FwSizeType id) {
// upwards until we find a parent that has a value
// greater than ours.
FwSizeType i = 0;

Check notice

Code scanning / CodeQL

Use of basic integral type Note

i uses the basic integral type unsigned long rather than a typedef with size and signedness.
for (i = 0; i < maxIter; i++) {
for (i = 0; (i < maxIter) && (index != 0); i++) {
// Get the parent index:
parent = PARENT(index);
// The parent index should ALWAYS be less than the
Expand Down Expand Up @@ -159,7 +159,7 @@ void MaxHeap::heapify() {
const FwSizeType maxIter = this->m_size + 1;

Check notice

Code scanning / CodeQL

Use of basic integral type Note

maxIter uses the basic integral type unsigned long rather than a typedef with size and signedness.
FwSizeType i = 0;

Check notice

Code scanning / CodeQL

Use of basic integral type Note

i uses the basic integral type unsigned long rather than a typedef with size and signedness.

for (i = 0; i < maxIter; i++) {
for (i = 0; (i < maxIter) && (index <= this->m_size); i++) {
// Get the children indexes for this node:
left = LCHILD(index);
right = RCHILD(index);
Expand Down

0 comments on commit cf02fbb

Please sign in to comment.