o Made bit field argument to has_bit const since the function doesn't modify it.master
@@ -25,7 +25,7 @@ clear_bit(uint8_t *bits, unsigned long index) | |||||
} | } | ||||
int | int | ||||
has_bit(uint8_t *bits, unsigned long index) | |||||
has_bit(const uint8_t *bits, unsigned long index) | |||||
{ | { | ||||
return bits[index / 8] & (1 << (7 - index % 8)); | return bits[index / 8] & (1 << (7 - index % 8)); | ||||
} | } | ||||
@@ -131,16 +131,6 @@ canon_path(const char *path, char **res) | |||||
return 0; | return 0; | ||||
} | } | ||||
size_t | |||||
round_to_page(size_t size) | |||||
{ | |||||
size_t psize = getpagesize(); | |||||
size_t rem = size % psize; | |||||
if (rem != 0) | |||||
size += psize - rem; | |||||
return size; | |||||
} | |||||
long | long | ||||
rand_between(long min, long max) | rand_between(long min, long max) | ||||
{ | { | ||||
@@ -11,13 +11,11 @@ int mkdirs(char *path); | |||||
int vopen(int *resfd, int flags, const char *fmt, ...); | int vopen(int *resfd, int flags, const char *fmt, ...); | ||||
void set_bit(uint8_t *bits, unsigned long index); | void set_bit(uint8_t *bits, unsigned long index); | ||||
int has_bit(uint8_t *bits, unsigned long index); | |||||
int has_bit(const uint8_t *bits, unsigned long index); | |||||
void clear_bit(uint8_t *bits, unsigned long index); | void clear_bit(uint8_t *bits, unsigned long index); | ||||
int canon_path(const char *path, char **res); | int canon_path(const char *path, char **res); | ||||
size_t round_to_page(size_t size); | |||||
long rand_between(long min, long max); | long rand_between(long min, long max); | ||||
#endif | #endif |