mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-25 19:08:35 +00:00
[bitmap] Fix bitmaps on 64-bit
Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
0d108681ac
commit
83efb3d750
@ -76,7 +76,7 @@ int bitmap_test ( struct bitmap *bitmap, unsigned int bit ) {
|
||||
|
||||
if ( bit >= bitmap->length )
|
||||
return 0;
|
||||
return ( bitmap->blocks[index] & mask );
|
||||
return ( ( bitmap->blocks[index] & mask ) != 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,7 @@ typedef unsigned long bitmap_block_t;
|
||||
* @v bit Bit index
|
||||
* @ret mask Block mask
|
||||
*/
|
||||
#define BITMAP_MASK( bit ) ( 1 << ( (bit) % BITMAP_BLKSIZE ) )
|
||||
#define BITMAP_MASK( bit ) ( 1UL << ( (bit) % BITMAP_BLKSIZE ) )
|
||||
|
||||
/** A bitmap */
|
||||
struct bitmap {
|
||||
|
Loading…
Reference in New Issue
Block a user