[Libguestfs] [nbdkit PATCH 03/10] ocaml: Avoid -Wshadow warnings

Eric Blake eblake at redhat.com
Sun Sep 1 02:29:40 UTC 2019


Reusing 'offset' for a different purpose in the second half of the
function is safe enough without needing a shadow or a separate
variable name.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 plugins/ocaml/ocaml.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c
index c472281f..f2b99276 100644
--- a/plugins/ocaml/ocaml.c
+++ b/plugins/ocaml/ocaml.c
@@ -622,7 +622,7 @@ extents_wrapper (void *h, uint32_t count, uint64_t offset, uint32_t flags,

   /* Convert extents list into calls to nbdkit_add_extent. */
   while (rv != Val_int (0)) {
-    uint64_t offset, length;
+    uint64_t length;
     uint32_t type = 0;

     v = Field (rv, 0);          /* extent struct */
-- 
2.21.0




More information about the Libguestfs mailing list