aboutgitcodebugslistschat
path: root/packet.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-11-29 13:17:10 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-12-02 03:54:42 +0100
commit06559048e76343211618ddea02d6739ca578b775 (patch)
tree6a2dc46dc42e7bd916bd86f701aa491aa898c946 /packet.c
parent4117bd94f967709074ff1f310d7334ab1876ddae (diff)
downloadpasst-06559048e76343211618ddea02d6739ca578b775.tar
passt-06559048e76343211618ddea02d6739ca578b775.tar.gz
passt-06559048e76343211618ddea02d6739ca578b775.tar.bz2
passt-06559048e76343211618ddea02d6739ca578b775.tar.lz
passt-06559048e76343211618ddea02d6739ca578b775.tar.xz
passt-06559048e76343211618ddea02d6739ca578b775.tar.zst
passt-06559048e76343211618ddea02d6739ca578b775.zip
treewide: Use 'z' length modifier for size_t/ssize_t conversions
Types size_t and ssize_t are not necessarily long, it depends on the architecture. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/packet.c b/packet.c
index 9589824..12ac76b 100644
--- a/packet.c
+++ b/packet.c
@@ -36,7 +36,7 @@ void packet_add_do(struct pool *p, size_t len, const char *start,
size_t idx = p->count;
if (idx >= p->size) {
- trace("add packet index %lu to pool with size %lu, %s:%i",
+ trace("add packet index %zu to pool with size %zu, %s:%i",
idx, p->size, func, line);
return;
}
@@ -48,14 +48,14 @@ void packet_add_do(struct pool *p, size_t len, const char *start,
}
if (start + len > p->buf + p->buf_size) {
- trace("add packet start %p, length: %lu, buffer end %p, %s:%i",
+ trace("add packet start %p, length: %zu, buffer end %p, %s:%i",
(void *)start, len, (void *)(p->buf + p->buf_size),
func, line);
return;
}
if (len > UINT16_MAX) {
- trace("add packet length %lu, %s:%i", len, func, line);
+ trace("add packet length %zu, %s:%i", len, func, line);
return;
}
@@ -90,7 +90,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
{
if (idx >= p->size || idx >= p->count) {
if (func) {
- trace("packet %lu from pool size: %lu, count: %lu, "
+ trace("packet %zu from pool size: %zu, count: %zu, "
"%s:%i", idx, p->size, p->count, func, line);
}
return NULL;
@@ -98,7 +98,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (len > UINT16_MAX || len + offset > UINT32_MAX) {
if (func) {
- trace("packet data length %lu, offset %lu, %s:%i",
+ trace("packet data length %zu, offset %zu, %s:%i",
len, offset, func, line);
}
return NULL;
@@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) {
if (func) {
- trace("packet offset plus length %lu from size %lu, "
+ trace("packet offset plus length %lu from size %zu, "
"%s:%i", p->pkt[idx].offset + len + offset,
p->buf_size, func, line);
}
@@ -115,7 +115,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (len + offset > p->pkt[idx].len) {
if (func) {
- trace("data length %lu, offset %lu from length %u, "
+ trace("data length %zu, offset %zu from length %u, "
"%s:%i", len, offset, p->pkt[idx].len,
func, line);
}