diff --git a/opal/class/opal_bitmap.c b/opal/class/opal_bitmap.c index b57da83a83..6a8895706b 100644 --- a/opal/class/opal_bitmap.c +++ b/opal/class/opal_bitmap.c @@ -180,27 +180,27 @@ opal_bitmap_clear_bit(opal_bitmap_t *bm, int bit) } -int +bool opal_bitmap_is_set_bit(opal_bitmap_t *bm, int bit) { int index, offset; if ((bit < 0) || NULL == bm || (bit >= (bm->array_size * SIZE_OF_CHAR))) { - return OPAL_ERR_BAD_PARAM; + return false; } index = bit / SIZE_OF_CHAR; offset = bit % SIZE_OF_CHAR; if (index >= bm->array_size) { - return OPAL_ERR_BAD_PARAM; + return false; } if (0 != (bm->bitmap[index] & (1 << offset))) { - return (int) true; + return true; } - return (int) false; + return false; } diff --git a/opal/class/opal_bitmap.h b/opal/class/opal_bitmap.h index 21173cfa98..a27a754668 100644 --- a/opal/class/opal_bitmap.h +++ b/opal/class/opal_bitmap.h @@ -114,12 +114,13 @@ OPAL_DECLSPEC int opal_bitmap_clear_bit(opal_bitmap_t *bm, int bit); * * @param bitmap The input bitmap (IN) * @param bit The bit which is to be checked (IN) - * @return OPAL error code if the bit is out of range - * 1 if the bit is set - * 0 if the bit is not set + * @return true if the bit is set + * false if the bit is not set OR the index + * is outside the bounds of the provided + * bitmap * */ -OPAL_DECLSPEC int opal_bitmap_is_set_bit(opal_bitmap_t *bm, int bit); +OPAL_DECLSPEC bool opal_bitmap_is_set_bit(opal_bitmap_t *bm, int bit); /**