Skip to content

Commit

Permalink
[bitmap] Fix bitmaps on 64-bit
Browse files Browse the repository at this point in the history
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
Geoff Lywood authored and mcb30 committed May 27, 2010
1 parent 0d10868 commit 83efb3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/bitmap.c
Expand Up @@ -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 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/include/ipxe/bitmap.h
Expand Up @@ -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 {
Expand Down

0 comments on commit 83efb3d

Please sign in to comment.