2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 01:21:45 +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:
Geoff Lywood 2010-05-27 00:39:17 +01:00 committed by Michael Brown
parent 0d108681ac
commit 83efb3d750
2 changed files with 2 additions and 2 deletions

View File

@ -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 );
}
/**

View File

@ -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 {