diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-02-28 00:59:19 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-03-09 00:36:06 +0100 |
commit | 83236216c45d0834275afa52d9b5bee54740f124 (patch) | |
tree | ec167b7c907380a630f996b822d4902752deffc2 /udp.c | |
parent | f6b6b66a881fad1d4fcf4ee7f1b606f4bd1bb1b3 (diff) | |
download | passt-83236216c45d0834275afa52d9b5bee54740f124.tar passt-83236216c45d0834275afa52d9b5bee54740f124.tar.gz passt-83236216c45d0834275afa52d9b5bee54740f124.tar.bz2 passt-83236216c45d0834275afa52d9b5bee54740f124.tar.lz passt-83236216c45d0834275afa52d9b5bee54740f124.tar.xz passt-83236216c45d0834275afa52d9b5bee54740f124.tar.zst passt-83236216c45d0834275afa52d9b5bee54740f124.zip |
udp: Fix signedness warning on 32-bits architectures
When a ssize_t is an int:
udp.c: In function ‘udp_sock_handler’:
udp.c:774:23: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘ssize_t’ {aka ‘int’} [-Wsign-compare]
774 | for (i = 0; i < n; i += m) {
| ^
udp.c:781:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘ssize_t’ {aka ‘int’} [-Wsign-compare]
781 | for (m = 1; i + m < n; m++) {
|
Change 'i' and 'm' counters in udp_sock_handler() to signed versions,
to match ssize_t n.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'udp.c')
-rw-r--r-- | udp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -754,7 +754,7 @@ void udp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events, in_port_t dstport = ref.r.p.udp.udp.port; bool v6 = ref.r.p.udp.udp.v6; struct mmsghdr *mmh_recv; - unsigned int i, m; + int i, m; if (!(events & EPOLLIN)) return; |