aboutsummaryrefslogtreecommitdiffstats
path: root/vppinfra
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-06-30 01:02:17 +0200
committerDamjan Marion <damarion@cisco.com>2016-06-30 01:02:17 +0200
commitec175104cf5b09a91f2f9c7a36c6ca0703979eeb (patch)
tree86cf6fcacad881b24bdb92e98a8293bfd23348ba /vppinfra
parent33879c95b865d62b07f8390692dc3c7294a57375 (diff)
Fix clang build
Change-Id: I678d7e0a7c91c7daf9feb3ec23a633b96fab56a7 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vppinfra')
-rw-r--r--vppinfra/vppinfra/bitmap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/vppinfra/vppinfra/bitmap.h b/vppinfra/vppinfra/bitmap.h
index a89aa399e2f..35de1b4819f 100644
--- a/vppinfra/vppinfra/bitmap.h
+++ b/vppinfra/vppinfra/bitmap.h
@@ -347,14 +347,14 @@ always_inline uword clib_bitmap_last_set (uword * ai)
{
uword i;
- for (i = vec_len (ai) - 1; i >= 0 ; i--)
+ for (i = vec_len (ai); i > 0 ; i--)
{
- uword x = ai[i];
+ uword x = ai[i - 1];
if (x != 0)
{
uword first_bit;
count_leading_zeros (first_bit, x);
- return (i + 1) * BITS (ai[0]) - first_bit - 1;
+ return (i) * BITS (ai[0]) - first_bit - 1;
}
}
return ~0;