Wrap the source code at 80 characters.

Turn the "struct extent" compound literal into a local variable ("block
scope, automatic storage duration object"), keeping the same initializer.

Tested with "make check"; "tests/test-extentlist.sh" passes.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172516
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 filters/extentlist/extentlist.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/filters/extentlist/extentlist.c b/filters/extentlist/extentlist.c
index bb5c29d579ef..cc09e2c970d0 100644
--- a/filters/extentlist/extentlist.c
+++ b/filters/extentlist/extentlist.c
@@ -226,15 +226,16 @@ parse_extentlist (void)
    */
   for (i = 0; i < extents.len-1; ++i) {
     end = extents.ptr[i].offset + extents.ptr[i].length;
-    if (end < extents.ptr[i+1].offset)
-      if (extent_list_insert (&extents,
-                              (struct extent){.offset = end,
-                                              .length = 
extents.ptr[i+1].offset - end,
-                                              .type = HOLE},
-                              i+1) == -1) {
+    if (end < extents.ptr[i+1].offset) {
+      struct extent extent = { .offset = end,
+                               .length = extents.ptr[i+1].offset - end,
+                               .type = HOLE };
+
+      if (extent_list_insert (&extents, extent, i+1) == -1) {
         nbdkit_error ("realloc: %m");
         exit (EXIT_FAILURE);
       }
+    }
   }
 
   /* If there's a gap at the end, insert a hole|zero extent. */

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to