From d34b441f145063d883f00c73c69dc8785d9a4b94 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 14 Apr 2008 09:46:32 +1000 Subject: [PATCH] fix signed mismatch compiler diagnostic r2427 | dcl | 2008-04-14 09:46:32 +1000 (Mon, 14 Apr 2008) | 2 lines --- conman.c | 4 ++-- network.c | 8 ++++---- site_ansto/safetyplc.c | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/conman.c b/conman.c index 9237f281..c3265e41 100644 --- a/conman.c +++ b/conman.c @@ -578,7 +578,7 @@ int SCWriteInContext(SConnection *pCon, char *pBuffer, int out, commandContext c va_list ap; char buf[256]; char *dyn; - int l; + unsigned int l; int res; va_start(ap, fmt); @@ -1093,7 +1093,7 @@ pDynString SCEndBuffering(SConnection *pCon) compStream.next_out = (Bytef *)outBuf; compStream.avail_in = iDataLen; compStream.avail_out = 65536; - while(compStream.total_in < iDataLen) + while(compStream.total_in < (unsigned) iDataLen) { iRet = deflate(&compStream,Z_NO_FLUSH); if(iRet != Z_OK) diff --git a/network.c b/network.c index ad127726..e04ca4cf 100644 --- a/network.c +++ b/network.c @@ -170,7 +170,7 @@ CreateSocketAdress( int iRet; fd_set lMask; struct timeval tmo = {1,0}; - int iLen, i; + unsigned int iLen, i; struct linger lili; assert(self != NULL); @@ -378,7 +378,7 @@ CreateSocketAdress( { int t; - int len; + unsigned int len; struct sockaddr_in sin; struct hostent *host; @@ -773,7 +773,7 @@ int NETReconnect(mkChannel* self) i = 1; setsockopt(pRes->sockid,SOL_SOCKET,SO_REUSEADDR,&i,sizeof(int)); - assert(pRes->sockid < (sizeof(long)*8)); + assert(pRes->sockid < (int)(sizeof(long)*8)); /* if this fails the masks for select will be to short. */ @@ -855,7 +855,7 @@ int NETReconnect(mkChannel* self) long lMask = 0L; struct timeval tmo ={0,1}; long iRet; - int iLang; + unsigned int iLang; if(!VerifyChannel(self)) { diff --git a/site_ansto/safetyplc.c b/site_ansto/safetyplc.c index 4db7d9b9..efb81717 100644 --- a/site_ansto/safetyplc.c +++ b/site_ansto/safetyplc.c @@ -167,7 +167,7 @@ static void PLC_Notify(void* context, int event) */ static int GetCallback(pAsyncTxn txn) { - int iRet,i; + int iRet; unsigned int iRead; char* resp = txn->inp_buf; int resp_len = txn->inp_idx; @@ -197,6 +197,7 @@ static int GetCallback(pAsyncTxn txn) DMC2280MotionControl = 0; } if (self->oldValue != self->iValue) { + unsigned int i; for (i=0; i < sizeof(plc_parname)/sizeof(plc_parname[0]); i++) { plcVar = (pSicsVariable)FindCommandData(pServ->pSics,plc_parname[i],"SicsVariable"); PLC_GetState(self,plc_parname[i],&plcState); @@ -468,7 +469,8 @@ int SafetyPLCFactory(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]) { pSafetyPLCController pNew = NULL; - int iRet, status, i; + int iRet, status; + unsigned int i; char pError[256]; pSicsVariable plcVar=NULL; PLC_STATUS plcState;