Skip to content

Commit deff9ab

Browse files
author
Matt Conte
committed
Update tlsf.c
Unsigned fix from Chris McEvoy @ Velan Studios.
1 parent a1f743f commit deff9ab

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tlsf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,12 @@ static void remove_free_block(control_t* control, block_header_t* block, int fl,
590590
/* If the new head is null, clear the bitmap. */
591591
if (next == &control->block_null)
592592
{
593-
control->sl_bitmap[fl] &= ~(1 << sl);
593+
control->sl_bitmap[fl] &= ~(1U << sl);
594594

595595
/* If the second bitmap is now empty, clear the fl bitmap. */
596596
if (!control->sl_bitmap[fl])
597597
{
598-
control->fl_bitmap &= ~(1 << fl);
598+
control->fl_bitmap &= ~(1U << fl);
599599
}
600600
}
601601
}
@@ -618,8 +618,8 @@ static void insert_free_block(control_t* control, block_header_t* block, int fl,
618618
** and second-level bitmaps appropriately.
619619
*/
620620
control->blocks[fl][sl] = block;
621-
control->fl_bitmap |= (1 << fl);
622-
control->sl_bitmap[fl] |= (1 << sl);
621+
control->fl_bitmap |= (1U << fl);
622+
control->sl_bitmap[fl] |= (1U << sl);
623623
}
624624

625625
/* Remove a given block from the free list. */
@@ -853,9 +853,9 @@ int tlsf_check(tlsf_t tlsf)
853853
{
854854
for (j = 0; j < SL_INDEX_COUNT; ++j)
855855
{
856-
const int fl_map = control->fl_bitmap & (1 << i);
856+
const int fl_map = control->fl_bitmap & (1U << i);
857857
const int sl_list = control->sl_bitmap[i];
858-
const int sl_map = sl_list & (1 << j);
858+
const int sl_map = sl_list & (1U << j);
859859
const block_header_t* block = control->blocks[i][j];
860860

861861
/* Check that first- and second-level lists agree. */

0 commit comments

Comments
 (0)