From ab544c3a0e01e43521203a71d1529d73480efd70 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Wed, 11 Nov 2020 13:16:14 +0100 Subject: [PATCH] asyncsendto.c: use named enum. see #502 --- miniupnpd/asyncsendto.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/miniupnpd/asyncsendto.c b/miniupnpd/asyncsendto.c index 7abef30..b76d0db 100644 --- a/miniupnpd/asyncsendto.c +++ b/miniupnpd/asyncsendto.c @@ -1,7 +1,7 @@ -/* $Id: asyncsendto.c,v 1.11 2019/09/24 11:46:01 nanard Exp $ */ +/* $Id: asyncsendto.c,v 1.12 2020/11/11 12:13:26 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ - * (c) 2006-2019 Thomas Bernard + * (c) 2006-2020 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within the distribution */ @@ -22,6 +22,8 @@ #include "asyncsendto.h" #include "upnputils.h" +enum send_state {ESCHEDULED=1, EWAITREADY=2, ESENDNOW=3} state; + /* state diagram for a packet : * * | @@ -34,7 +36,7 @@ struct scheduled_send { LIST_ENTRY(scheduled_send) entries; struct timeval ts; - enum {ESCHEDULED=1, EWAITREADY=2, ESENDNOW=3} state; + enum send_state state; int sockfd; const void * buf; size_t len; @@ -96,7 +98,7 @@ sendto_schedule2(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr_in6 *src_addr, unsigned int delay) { - enum {ESCHEDULED, EWAITREADY, ESENDNOW} state; + enum send_state state; ssize_t n; size_t alloc_len; struct timeval tv;