]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virBitmapNextClearBit: Correct virBitmapNextClearBit function header comment
authorAaron M. Brown <aaronmbr@linux.ibm.com>
Tue, 22 Jul 2025 17:59:49 +0000 (13:59 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 23 Jul 2025 07:12:18 +0000 (09:12 +0200)
This patch corrects the header comment for virBitmapNextClearBIt.
Currently, the header comment reads:

`@pos can be -1 to search for the first set bit.`

However, this statement is false.

We can prove this by referencing the virbitmaptest functions, i.e
virbitmaptest.c:223, in which i = 0

if (virBitmapNextClearBIt(bitmap, -1) != 0)
    return -1

Because this is a zero set, this case would fail if the header statement was true as is.

Signed-off-by: Aaron M. Brown <aaronmbr@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virbitmap.c

index 8a3f33c806020f146d2dc92d93b8363b6a4d72e8..1a3e75671c25545ebe5b74c15ff51bf88c343260 100644 (file)
@@ -948,7 +948,7 @@ virBitmapLastSetBit(virBitmap *bitmap)
  * @pos: the position after which to search for a clear bit
  *
  * Search for the first clear bit after position @pos in bitmap @bitmap.
- * @pos can be -1 to search for the first set bit. Position starts
+ * @pos can be -1 to search for the first clear bit. Position starts
  * at 0.
  *
  * Returns the position of the found bit, or -1 if no bit found.