tests: Fix a couple of compile warnings

This commit is contained in:
nick
2013-07-23 17:22:23 +01:00
parent 1b0fe24529
commit d18423c153
2 changed files with 17 additions and 16 deletions

View File

@@ -46,7 +46,7 @@ static inline void bit_clear_range(char* b, int from, int len) {
for (; len > 0; len--) { bit_clear(b, from++); }
}
/** Counts the number of contiguous bits in array ''b'', starting at ''from''
/** Counts the number of contiguous bits in array ''b'', starting at ''from''
* up to a maximum number of bits ''len''. Returns the number of contiguous
* bits that are the same as the first one specified.
*/
@@ -58,7 +58,8 @@ static inline int bit_run_count(char* b, int from, int len) {
;
/* FIXME: debug this later */
/*for (; (from+count) % 64 != 0 && len > 0; len--)
/*
for (; (from+count) % 64 != 0 && len > 0; len--)
if (bit_has_value(b, from+count, first_value))
count++;
else
@@ -71,12 +72,12 @@ static inline int bit_run_count(char* b, int from, int len) {
}
for (; len > 0; len--)
if (bit_is_set(b, from+count))
count++;*/
count++;
*/
return count;
}
/** An application of a bitset - a bitset mapping represents a file of ''size''
/** An application of a bitset - a bitset mapping represents a file of ''size''
* broken down into ''resolution''-sized chunks. The bit set is assumed to
* represent one bit per chunk. We also bundle a lock so that the set can be
* written reliably by multiple threads.
@@ -92,7 +93,7 @@ struct bitset_mapping {
* given resolution.
*/
static inline struct bitset_mapping* bitset_alloc(
uint64_t size,
uint64_t size,
int resolution
)
{
@@ -123,8 +124,8 @@ static inline struct bitset_mapping* bitset_alloc(
* file.
*/
static inline void bitset_set_range(
struct bitset_mapping* set,
uint64_t from,
struct bitset_mapping* set,
uint64_t from,
uint64_t len)
{
INT_FIRST_AND_LAST;
@@ -144,12 +145,12 @@ static inline void bitset_set(
/** Clear the bits in a bitset which correspond to the given bytes in the
/** Clear the bits in a bitset which correspond to the given bytes in the
* larger file.
*/
static inline void bitset_clear_range(
struct bitset_mapping* set,
uint64_t from,
struct bitset_mapping* set,
uint64_t from,
uint64_t len)
{
INT_FIRST_AND_LAST;
@@ -172,8 +173,8 @@ static inline void bitset_clear(
* the bit field.
*/
static inline int bitset_run_count(
struct bitset_mapping* set,
uint64_t from,
struct bitset_mapping* set,
uint64_t from,
uint64_t len)
{
/* now fix in case len goes past the end of the memory we have

View File

@@ -2,8 +2,8 @@
#include "bitset.h"
#define assert_bitset_is( map, val ) { \
uint64_t *num = map->bits; \
#define assert_bitset_is( map, val ) {\
uint64_t *num = (uint64_t*) map->bits; \
ck_assert_int_eq( val, *num ); \
}
@@ -181,7 +181,7 @@ START_TEST( test_bitset_run_count )
struct bitset_mapping* map = bitset_alloc( 64, 1 );
uint64_t run;
assert_bitset_is( map, 0x0000000000000000 );
assert_bitset_is( map, 0x0000000000000000 );
bitset_set_range( map, 0, 32 );
assert_bitset_is( map, 0x00000000ffffffff );