made code proper to avoid warning/fixed some small potential bugs
This commit is contained in:
32
stdscan.c
32
stdscan.c
@ -260,7 +260,7 @@
|
||||
}
|
||||
|
||||
/* make the data header */
|
||||
sprintf(pLine,"%-5s","NP");
|
||||
sprintf(pLine,"%-4s ","NP");
|
||||
strcpy(pInfo,"Scanning Variables: ");
|
||||
for(i = 0; i < self->iScanVar;i++)
|
||||
{
|
||||
@ -297,7 +297,7 @@
|
||||
/* now the scan points */
|
||||
for(i = 0; i < self->iCounts; i++)
|
||||
{
|
||||
sprintf(pLine,"%-5d",i);
|
||||
sprintf(pLine,"%-4d ",i);
|
||||
/* print vars */
|
||||
for(i2 = 0; i2 < self->iScanVar; i2++)
|
||||
{
|
||||
@ -305,7 +305,7 @@
|
||||
pVar = (pVarEntry)pPtr;
|
||||
if(pVar)
|
||||
{
|
||||
sprintf(pItem,"%-10.3f",GetScanVarPos(pVar,i));
|
||||
sprintf(pItem,"%-9.3f ",GetScanVarPos(pVar,i));
|
||||
strcat(pLine,pItem);
|
||||
}
|
||||
}
|
||||
@ -314,15 +314,15 @@
|
||||
pData = (pCountEntry)pPtr;
|
||||
if(pData)
|
||||
{
|
||||
sprintf(pItem," %-12ld",pData->lCount);
|
||||
sprintf(pItem," %-11ld ",pData->lCount);
|
||||
strcat(pLine,pItem);
|
||||
sprintf(pItem,"%-12ld",pData->Monitors[0]);
|
||||
sprintf(pItem,"%-11ld ",pData->Monitors[0]);
|
||||
strcat(pLine,pItem);
|
||||
sprintf(pItem,"%-12ld",pData->Monitors[1]);
|
||||
sprintf(pItem,"%-11ld ",pData->Monitors[1]);
|
||||
strcat(pLine,pItem);
|
||||
sprintf(pItem,"%-12ld",pData->Monitors[2]);
|
||||
sprintf(pItem,"%-11ld ",pData->Monitors[2]);
|
||||
strcat(pLine,pItem);
|
||||
sprintf(pItem,"%-6.1f",pData->fTime);
|
||||
sprintf(pItem,"%-5.1f ",pData->fTime);
|
||||
strcat(pLine,pItem);
|
||||
}
|
||||
fprintf(self->fd,"%s\n",pLine);
|
||||
@ -450,8 +450,8 @@
|
||||
InitCountEntry(&sCount);
|
||||
|
||||
/* prepare output header */
|
||||
sprintf(pHead,"%-5.5s","NP");
|
||||
sprintf(pStatus,"%-5d",iPoint);
|
||||
sprintf(pHead,"%-4.4s ","NP");
|
||||
sprintf(pStatus,"%-4d ",iPoint);
|
||||
|
||||
/* loop over all scan variables */
|
||||
status = 1;
|
||||
@ -471,9 +471,9 @@
|
||||
fVal = pVar->pInter->GetValue(pVar->pObject,self->pCon);
|
||||
}
|
||||
AppendScanVar(pVar,fVal);
|
||||
sprintf(pItem,"%-10.10s",ScanVarName(pVar));
|
||||
sprintf(pItem,"%-9.9s ",ScanVarName(pVar));
|
||||
strcat(pHead,pItem);
|
||||
sprintf(pItem,"%-10.3f",fVal);
|
||||
sprintf(pItem,"%-9.3f ",fVal);
|
||||
strcat(pStatus,pItem);
|
||||
}
|
||||
}
|
||||
@ -486,17 +486,17 @@
|
||||
*/
|
||||
strcat(pHead,"Counts ");
|
||||
|
||||
sprintf(pItem,"%-15d",sCount.lCount);
|
||||
sprintf(pItem,"%-14ld ",sCount.lCount);
|
||||
strcat(pStatus,pItem);
|
||||
|
||||
strcat(pHead,"Monitor1 ");
|
||||
sprintf(pItem,"%-12d",sCount.Monitors[0]);
|
||||
sprintf(pItem,"%-11ld ",sCount.Monitors[0]);
|
||||
strcat(pStatus,pItem);
|
||||
strcat(pHead,"Monitor2 ");
|
||||
sprintf(pItem,"%-12d",sCount.Monitors[1]);
|
||||
sprintf(pItem,"%-11ld ",sCount.Monitors[1]);
|
||||
strcat(pStatus,pItem);
|
||||
strcat(pHead,"Monitor3 ");
|
||||
sprintf(pItem,"%-12d",sCount.Monitors[2]);
|
||||
sprintf(pItem,"%-11ld ",sCount.Monitors[2]);
|
||||
strcat(pStatus,pItem);
|
||||
strcat(pHead,"Time ");
|
||||
sprintf(pItem,"%-6.1f",sCount.fTime);
|
||||
|
Reference in New Issue
Block a user