avoid comparison between signed and unsigned numbers

This commit is contained in:
Jeff Hill
2002-08-22 14:39:46 +00:00
parent 84863a577c
commit ebe7870015
+9 -8
View File
@@ -59,17 +59,18 @@ inline void casPVI::unregisterIO()
//
// casPVI::bestDBRType()
//
inline caStatus casPVI::bestDBRType ( unsigned &dbrType ) // X aCC 361
inline caStatus casPVI::bestDBRType ( unsigned & dbrType ) // X aCC 361
{
aitEnum bestAIT = this->bestExternalType ();
if ( bestAIT < NELEMENTS ( gddAitToDbr ) && bestAIT != aitEnumInvalid ) {
dbrType = gddAitToDbr[bestAIT];
return S_cas_success;
}
else {
if ( bestAIT == aitEnumInvalid || bestAIT < 0 ) {
return S_cas_badType;
}
}
unsigned aitIndex = static_cast < unsigned > ( bestAIT );
if ( aitIndex >= NELEMENTS ( gddAitToDbr ) ) {
return S_cas_badType;
}
dbrType = gddAitToDbr[bestAIT];
return S_cas_success;
}
#include "casChannelIIL.h" // inline func for casChannelI