These compound literals are hard to break down to short lines without
making them look ugly (the type names would have to stand alone on a
line); let's use normal local variables instead.
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2172516
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
examples/strict-structured-reads.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c
index 1c9664260654..a2596713f3cd 100644
--- a/examples/strict-structured-reads.c
+++ b/examples/strict-structured-reads.c
@@ -222,6 +222,11 @@ main (int argc, char *argv[])
struct data *d = malloc (sizeof *d);
struct range *r = malloc (sizeof *r);
uint64_t offset;
+ nbd_chunk_callback chunk_callback = { .callback = read_chunk,
+ .user_data = d };
+ nbd_completion_callback completion_callback = { .callback = read_verify,
+ .user_data = d,
+ .free = free };
assert (d && r);
offset = rand () % (exportsize - maxsize);
@@ -230,10 +235,8 @@ main (int argc, char *argv[])
*r = (struct range) { .first = offset, .last = offset + maxsize, };
*d = (struct data) { .offset = offset, .count = maxsize, .flags = flags,
.remaining = r, };
- if (nbd_aio_pread_structured (nbd, buf, sizeof buf, offset,
- (nbd_chunk_callback) { .callback = read_chunk,
.user_data = d },
- (nbd_completion_callback) { .callback = read_verify,
.user_data = d, .free = free },
- flags) == -1) {
+ if (nbd_aio_pread_structured (nbd, buf, sizeof buf, offset, chunk_callback,
+ completion_callback, flags) == -1) {
fprintf (stderr, "%s\n", nbd_get_error ());
exit (EXIT_FAILURE);
}