aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/base/bitmap.h
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2020-09-23 17:50:52 +0200
committerMauro Sardara <msardara@cisco.com>2021-03-19 14:15:14 +0100
commita070b0de9f9e9cbca150eea4eda74757ca588bed (patch)
tree9f2a11fa1afcd51b0b14f4b26bebf4deb8289a2f /hicn-light/src/hicn/base/bitmap.h
parent32dccec98e4c7d7e4ce902e19ba8d1b29b823758 (diff)
[HICN-645] Control plane (WIP)
Change-Id: I4be6a40b690b62f22f57de6d8c10b01a1be42a6d Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com> Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com> Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/base/bitmap.h')
-rw-r--r--hicn-light/src/hicn/base/bitmap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/hicn-light/src/hicn/base/bitmap.h b/hicn-light/src/hicn/base/bitmap.h
index 4a78af567..ebc3dddbb 100644
--- a/hicn-light/src/hicn/base/bitmap.h
+++ b/hicn-light/src/hicn/base/bitmap.h
@@ -43,8 +43,8 @@ typedef uint_fast32_t bitmap_t;
* @param[in] max_size Bitmap max_size
*/
#define bitmap_init(bitmap, init_size, max_size) \
- vector_init(bitmap, next_pow2(init_size / BITMAP_WIDTH(bitmap)), \
- max_size == 0 ? 0 : next_pow2(max_size / BITMAP_WIDTH(bitmap)))
+ vector_init(bitmap, next_pow2((init_size) / BITMAP_WIDTH(bitmap)), \
+ max_size == 0 ? 0 : next_pow2((max_size) / BITMAP_WIDTH(bitmap)))
/*
* @brief Ensures a bitmap is sufficiently large to hold an element at the
@@ -156,7 +156,7 @@ bitmap_set_range(bitmap_t * bitmap, off_t from, off_t to)
*/
if ((pos_to != BITMAP_WIDTH(bitmap) - 1) && (offset_to != offset_from)) {
size_t to_start = MAX(from, offset_to * BITMAP_WIDTH(bitmap));
- for (size_t k = to_start; k < to; k++) {
+ for (size_t k = to_start; k < (size_t) to; k++) {
if (bitmap_set(bitmap, k) < 0)
goto END;
}