Use BAD_VALUE #define
r2002 | dcl | 2007-06-05 13:29:16 +1000 (Tue, 05 Jun 2007) | 2 lines
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user