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

This is to make valgrind happy
This commit is contained in:
koennecke
2005-01-12 08:43:02 +00:00
parent 427855306a
commit 000bb7b4a8
4 changed files with 78 additions and 18 deletions

View File

@ -30,6 +30,7 @@
#include <scan.i>
#include "tas.h"
#include "tasu.h"
#include "../scanvar.h"
#include <evcontroller.h>
#include <splitter.h>
#include <status.h>
@ -233,9 +234,9 @@ static int TASHeader(pScanData self)
pVar = (pVarEntry)pPtr;
if(pVar)
{
strncpy(pWork2,pVar->Name,59);
strncpy(pWork2,ScanVarName(pVar),59);
strtoupper(pWork2);
sprintf(pWork,"D%s=%8.4f, ",pWork2,pVar->fStep);
sprintf(pWork,"D%s=%8.4f, ",pWork2,ScanVarStep(pVar));
strcat(pBueffel,pWork);
}
}
@ -514,9 +515,9 @@ static int TASScanPoint(pScanData self, int iPoint)
pVar = (pVarEntry)pPtr;
if(pVar)
{
if(isTASMotor(pVar->Name) >= 0)
if(isTASMotor(ScanVarName(pVar)) >= 0)
{
pMot = FindMotor(self->pSics,pVar->Name);
pMot = FindMotor(self->pSics,ScanVarName(pVar));
if(pMot)
{
status = MotorGetSoftPosition(pMot,self->pCon,&fVal);
@ -648,13 +649,13 @@ static int TASScanDrive(pScanData self, int iPoint)
if(pVar)
{
/* set variable if QE-variable */
if((iPtr = isTASEnergy(pVar->Name)) >= 0)
if((iPtr = isTASEnergy(ScanVarName(pVar))) >= 0)
{
iTAS = 1;
pTAS->tasPar[EI+iPtr]->fVal =
pVar->fStart + iPoint * pVar->fStep;
ScanVarStart(pVar) + iPoint * ScanVarStep(pVar);
pTAS->tasPar[ETARGET+iPtr]->fVal =
pVar->fStart + iPoint * pVar->fStep;
ScanVarStart(pVar) + iPoint * ScanVarStep(pVar);
tasMask[iPtr] = 1;
}
else
@ -836,7 +837,7 @@ static int TASScanCount(pScanData self, int iPoint)
MotorGetSoftPosition(pMot,self->pCon,&fVal);
}
}
pVar->fData[iPoint] = fVal;
AppendScanVar(pVar,fVal);
}
}
@ -929,7 +930,6 @@ static int AddTASScanVar(pScanData self, SicsInterp *pSics, SConnection *pCon,
pVar.pObject = pData;
pVar.fStart = fStart;
pVar.fStep = fStep;
pVar.fData = NULL;
/* put it away */
DynarPutCopy(self->pScanVar,self->iScanVar,&pVar,sizeof(VarEntry));