From ea52ccfcaeb63926b20a47d15d6259ed1cf86cc2 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Tue, 5 Jun 2007 13:29:16 +1000 Subject: [PATCH] Use BAD_VALUE #define r2002 | dcl | 2007-06-05 13:29:16 +1000 (Tue, 05 Jun 2007) | 2 lines --- confvirtualmot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/confvirtualmot.c b/confvirtualmot.c index 610a8481..55c13a73 100644 --- a/confvirtualmot.c +++ b/confvirtualmot.c @@ -19,6 +19,8 @@ #include "confvirtmot.h" #include "confvirtmot.i" +#define BAD_VALUE (-9999.99) + extern char *stptok(char *s, char *t, int len, char *brk); /*--------------------------------------------------------------------------- @@ -366,7 +368,7 @@ static void checkMotorValues(pConfigurableVirtualMotor self, /*-----------------------------------------------------------------------*/ static float ConfGetValue(void *pData, SConnection *pCon){ pConfigurableVirtualMotor self = (pConfigurableVirtualMotor)pData; - float currentValue = -9999.99; + float currentValue = BAD_VALUE; assert(self != NULL); @@ -501,7 +503,6 @@ int ConfigurableVirtualMotorAction(SConnection *pCon, SicsInterp *pSics, pConfigurableVirtualMotor self = NULL; char pBueffel[512]; float value; - int iRet; long lID; pRegisteredInfo pRegInfo = NULL; @@ -561,7 +562,7 @@ int ConfigurableVirtualMotorAction(SConnection *pCon, SicsInterp *pSics, pRegInfo->pName = strdup(argv[0]); pRegInfo->pCon = pCon; value = ConfGetValue(self,pCon); - if(!iRet) + if(value == BAD_VALUE) { sprintf(pBueffel,"Failed to register interest, Reason:Error obtaining current position for %s",argv[0]); SCWrite(pCon,pBueffel,eError);