From 9e46ba1c45358448496088dba7f3a48f0ae7b992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Mon, 21 Mar 2022 11:12:29 +0100 Subject: [PATCH] windows errors are "long unsigned int" --- comport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/comport.c b/comport.c index c35da48..1d684b6 100644 --- a/comport.c +++ b/comport.c @@ -622,7 +622,7 @@ static HANDLE open_serial(unsigned int com_num, t_comport *x) if (!GetCommTimeouts(fd, &(x->old_timeouts))) { - pd_error(x, "[comport] Couldn't get old timeouts for serial device (%d)", GetLastError()); + pd_error(x, "[comport] Couldn't get old timeouts for serial device (%ld)", GetLastError()); } /* setting new timeouts for read to immediately return */ @@ -634,12 +634,12 @@ static HANDLE open_serial(unsigned int com_num, t_comport *x) if (!SetCommTimeouts(fd, &timeouts)) { - pd_error(x, "Couldn't set timeouts for serial device (%d)", GetLastError()); + pd_error(x, "Couldn't set timeouts for serial device (%ld)", GetLastError()); return INVALID_HANDLE_VALUE; } if (!SetupComm(x->comhandle, 4096L, 4096L))/* try to get big buffers to avoid overruns*/ { - pd_error(x, "[comport] Couldn't do SetupComm (%d)", GetLastError()); + pd_error(x, "[comport] Couldn't do SetupComm (%ld)", GetLastError()); } x->comport = com_num;/* output on next tick */ return fd; @@ -1157,7 +1157,7 @@ static void comport_tick(t_comport *x) fd_set com_rfds; int count = 0; int i; - int whicherr = 0; + long int whicherr = 0; FD_ZERO(&com_rfds); FD_SET(fd,&com_rfds); @@ -1208,7 +1208,7 @@ static void comport_tick(t_comport *x) if(err < 0) { /* if a read error detected */ if(x->rxerrors < 10) /* ten times max */ - pd_error(x, "[comport]: RXERRORS on serial line (%d)\n", whicherr); + pd_error(x, "[comport]: RXERRORS on serial line (%ld)\n", (long int)whicherr); x->rxerrors++; /* remember */ } /* now if anything to send, send the output buffer */