aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2025-02-18 13:07:17 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-02-18 08:43:04 +0100
commit0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9 (patch)
tree6bfcc3c9b1ae10119b3e7edd8af499ee7b9844b6
parentbcc4908c2b4a20c581f2b03fed40da97b804106f (diff)
downloadpasst-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.tar
passt-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.tar.gz
passt-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.tar.bz2
passt-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.tar.lz
passt-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.tar.xz
passt-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.tar.zst
passt-0a51060f7ac3e1e1a9d87ffdb037b9c367a2a4d9.zip
packet: Use flexible array member in struct pool
Currently we have a dummy pkt[1] array, which we alias with an array of a different size via various macros. However, we already require C11 which includes flexible array members, so we can do better. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--packet.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/packet.h b/packet.h
index 3f70e94..85ee550 100644
--- a/packet.h
+++ b/packet.h
@@ -21,7 +21,7 @@ struct pool {
size_t buf_size;
size_t size;
size_t count;
- struct iovec pkt[1];
+ struct iovec pkt[];
};
int vu_packet_check_range(void *buf, size_t offset, size_t len,