From 905ca4b7ac2aa78dd0fbb83736b2ed2580cf2999 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 12 Nov 2019 18:15:32 -0800 Subject: [PATCH] quiet some warnings --- modules/ca/src/client/udpiiu.cpp | 7 ++----- modules/database/src/ioc/rsrv/caserverio.c | 2 +- modules/database/src/ioc/rsrv/caservertask.c | 2 +- modules/libcom/src/error/errSymLib.c | 2 +- modules/libcom/src/fdmgr/fdManager.cpp | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/ca/src/client/udpiiu.cpp b/modules/ca/src/client/udpiiu.cpp index c378881f7..fe15f1b69 100644 --- a/modules/ca/src/client/udpiiu.cpp +++ b/modules/ca/src/client/udpiiu.cpp @@ -1162,7 +1162,7 @@ void udpiiu :: show ( unsigned level ) const } } if ( level > 2u ) { - ::printf ("\tsocket identifier %d\n", this->sock ); + ::printf ("\tsocket identifier %d\n", int(this->sock) ); ::printf ("\tbytes in xmit buffer %u\n", this->nBytesInXmitBuf ); ::printf ("\tshut down command bool %u\n", this->shutdownCmd ); ::printf ( "\trecv thread exit signal:\n" ); @@ -1195,10 +1195,7 @@ bool udpiiu::wakeupMsg () // send a wakeup msg so the UDP recv thread will exit int status = sendto ( this->sock, reinterpret_cast < char * > ( &msg ), sizeof (msg), 0, &addr.sa, sizeof ( addr.sa ) ); - if ( status == sizeof (msg) ) { - return true; - } - return false; + return status == sizeof (msg); } void udpiiu::beaconAnomalyNotify ( diff --git a/modules/database/src/ioc/rsrv/caserverio.c b/modules/database/src/ioc/rsrv/caserverio.c index 20a1c1c5b..afce46e25 100644 --- a/modules/database/src/ioc/rsrv/caserverio.c +++ b/modules/database/src/ioc/rsrv/caserverio.c @@ -56,7 +56,7 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed ) if ( pclient->disconnect ) { if ( CASDEBUG > 2 ) { errlogPrintf ( "CAS: msg Discard for sock %d addr %x\n", - pclient->sock, (unsigned) pclient->addr.sin_addr.s_addr ); + (int)pclient->sock, (unsigned) pclient->addr.sin_addr.s_addr ); } pclient->send.stk = 0u; if(lock_needed) diff --git a/modules/database/src/ioc/rsrv/caservertask.c b/modules/database/src/ioc/rsrv/caservertask.c index c51a06db6..629b7b0b5 100644 --- a/modules/database/src/ioc/rsrv/caservertask.c +++ b/modules/database/src/ioc/rsrv/caservertask.c @@ -335,7 +335,7 @@ void rsrv_build_addr_lists(void) char sockErrBuf[64]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - errlogPrintf("rsrv: failed to set mcast ttl %d\n", ttl); + errlogPrintf("rsrv: failed to set mcast ttl %d\n", (int)ttl); } } #endif diff --git a/modules/libcom/src/error/errSymLib.c b/modules/libcom/src/error/errSymLib.c index b220f2bc0..8f59718c8 100644 --- a/modules/libcom/src/error/errSymLib.c +++ b/modules/libcom/src/error/errSymLib.c @@ -192,7 +192,7 @@ void errSymLookup(long status, char * pBuf, size_t bufLength) { const char* msg = errSymLookupInternal(status); if(msg) { - strncpy(pBuf, msg, bufLength); + strncpy(pBuf, msg, bufLength-1); pBuf[bufLength-1] = '\0'; return; } diff --git a/modules/libcom/src/fdmgr/fdManager.cpp b/modules/libcom/src/fdmgr/fdManager.cpp index f43fab25d..3bbc64876 100644 --- a/modules/libcom/src/fdmgr/fdManager.cpp +++ b/modules/libcom/src/fdmgr/fdManager.cpp @@ -249,7 +249,7 @@ void fdRegId::show ( unsigned level ) const static_cast ( this ) ); if ( level > 1u ) { printf ( "\tfd = %d, type = %d\n", - this->fd, this->type ); + int(this->fd), this->type ); } }