- A couple of small fixes for memory and initialization problems.

This is to make valgrind happy


SKIPPED:
	psi/amorscan.c
	psi/el734hp.c
	psi/psi.c
	psi/tasscan.c
This commit is contained in:
koennecke
2005-01-12 08:42:39 +00:00
parent 5e05be17e0
commit ef1de4589c
35 changed files with 2659 additions and 1203 deletions

View File

@@ -41,7 +41,7 @@
#include <assert.h>
#include "fortify.h"
#include "sics.h"
#include "motor.h"
/*-------------------------------------------------------------------------*/
pIDrivable CreateDrivableInterface(void)
@@ -108,6 +108,31 @@
{
return (pIDrivable)FindInterface(pObject,DRIVEID);
}
/*-------------------------------------------------------------------------*/
int GetDrivablePosition(void *pObject, SConnection *pCon, float *fPos)
{
pIDrivable pDriv = NULL;
pMotor pMot = NULL;
float value;
pDriv = GetDrivableInterface(pObject);
if(pDriv == NULL)
{
return 0;
}
if(iHasType(pObject,"Motor"))
{
pMot = (pMotor)pObject;
return MotorGetSoftPosition(pMot,pCon,fPos);
}
value = pDriv->GetValue(pObject,pCon);
if(value < 9999.99)
{
return 0;
}
*fPos = value;
return 1;
}
/*--------------------------------------------------------------------------*/
pICountable GetCountableInterface(void *pObject)
{