[Libguestfs] [nbdkit PATCH 1/9] common/utils/vector.h: Remove stale reference to `size`

Laszlo Ersek lersek at redhat.com
Fri Mar 3 07:51:37 UTC 2023


From: Nir Soffer <nsoffer at redhat.com>

Original commit message:

Update stale comments to use `len` instead of `size`.

Fixes: commit cc0567e9aed7e6b40a44bf8eac0a262ac7314fec
Signed-off-by: Nir Soffer <nsoffer at redhat.com>

Porting notes:

(1) Libnbd commit cc0567e9aed7 ("common/utils/vector: Rename `size` to
`len`", 2021-10-31) renamed the "size" field of our vector data structure
to "len", but forgot to update the field name in the comments of
"vector.h".

(2) Libnbd commit cc0567e9aed7 was ported to nbdkit as commit 0b0eece73f04
("common/utils/vector: Rename `size` to `len`", 2021-11-07). The port did
*more* than the original: the port also renamed the field in the comments
of "vector.h", plus it clarified the leading comment on name##_reserve().

(3) Libnbd commit 3d6be922e701 ("common/utils/vector.h: Remove stale
reference to `size`", 2021-11-05) fixed up earlier libnbd commit
cc0567e9aed7 by cleaning up the comments, probably striving for synching
libnbd's "vector.h" with nbdkit's. However, this libnbd fixup introduced a
*new* wrapping difference, relative to nbdkit, to the previously mentioned
comment above name##_reserve().

(4) By porting libnbd commit 3d6be922e701 to nbdkit, we can unify the
wrapping of the name##_reserve() comment.

Signed-off-by: Laszlo Ersek <lersek at redhat.com>
(cherry picked from libnbd commit 3d6be922e70153a220c7e5c7ae2425d1ff7197f8)
---
 common/utils/vector.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/utils/vector.h b/common/utils/vector.h
index 29cd0bddfc74..347a85735e81 100644
--- a/common/utils/vector.h
+++ b/common/utils/vector.h
@@ -91,8 +91,8 @@
   typedef struct name name;                                             \
                                                                         \
   /* Reserve n elements at the end of the vector.  Note space is        \
-   * allocated and capacity is increased, but the vector length         \
-   * is not increased and the new elements are not initialized.         \
+   * allocated and capacity is increased, but the vector length is      \
+   * not increased and the new elements are not initialized.            \
    */                                                                   \
   static inline int                                                     \
   name##_reserve (name *v, size_t n)                                    \



More information about the Libguestfs mailing list