diff options
author | dimitri staessens <[email protected]> | 2017-09-23 12:27:23 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2017-09-23 12:32:07 +0200 |
commit | 7ee95a3809aab3152837ceb5ffcd001ee9e83fde (patch) | |
tree | 506d539e05267f1e15d89da3f0a930e92dd879b1 /include | |
parent | 17ab2b6d6bc95337d5fd54e058c0822260dbacf1 (diff) | |
download | ouroboros-7ee95a3809aab3152837ceb5ffcd001ee9e83fde.tar.gz ouroboros-7ee95a3809aab3152837ceb5ffcd001ee9e83fde.zip |
lib: Clean up bitmap implementation
There was a return -1 in the allocate call which is unsafe since -1
may be a valid id in the bitmap. Since it's a data structure for
internal use, I replaced the NULL checks with assertions.
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/bitmap.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/ouroboros/bitmap.h b/include/ouroboros/bitmap.h index a5921fc7..d40bb509 100644 --- a/include/ouroboros/bitmap.h +++ b/include/ouroboros/bitmap.h @@ -32,17 +32,17 @@ struct bmp; struct bmp * bmp_create(size_t bits, ssize_t offset); -void bmp_destroy(struct bmp * b); +void bmp_destroy(struct bmp * bmp); -ssize_t bmp_allocate(struct bmp * instance); +ssize_t bmp_allocate(struct bmp * bmp); -int bmp_release(struct bmp * instance, +int bmp_release(struct bmp * bmp, ssize_t id); -bool bmp_is_id_valid(struct bmp * b, +bool bmp_is_id_valid(struct bmp * bmp, ssize_t id); -bool bmp_is_id_used(struct bmp * b, +bool bmp_is_id_used(struct bmp * bmp, ssize_t id); #endif /* OUROBOROS_BITMAP_H */ |