made code proper to avoid warning/fixed some small potential bugs
This commit is contained in:
@ -71,7 +71,7 @@ static char *invokeMotorScript(pConfigurableVirtualMotor self,
|
|||||||
self->parseOK = 0;
|
self->parseOK = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return Tcl_GetStringResult(pTcl);
|
return (char *)Tcl_GetStringResult(pTcl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1
conman.c
1
conman.c
@ -877,6 +877,7 @@ static void writeToLogFiles(SConnection *self, char *buffer)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
self->write = SCFileWrite;
|
self->write = SCFileWrite;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
int SCWriteUUencoded(SConnection *pCon, char *pName, void *pData,
|
int SCWriteUUencoded(SConnection *pCon, char *pName, void *pData,
|
||||||
|
@ -885,7 +885,7 @@
|
|||||||
SCWrite(pCon,"All done",eStatus);
|
SCWrite(pCon,"All done",eStatus);
|
||||||
iRet = 1;
|
iRet = 1;
|
||||||
}
|
}
|
||||||
else if(iRet = DEVERROR)
|
else if(iRet == DEVERROR)
|
||||||
{
|
{
|
||||||
SCWrite(pCon,"Finished with Problems",eStatus);
|
SCWrite(pCon,"Finished with Problems",eStatus);
|
||||||
iRet = 1;
|
iRet = 1;
|
||||||
|
@ -325,7 +325,7 @@ static int DiffScanTask(void *pData){
|
|||||||
/*
|
/*
|
||||||
print progress
|
print progress
|
||||||
*/
|
*/
|
||||||
snprintf(pBueffel,255,"%5d %12.4f %12.4f RAW: %10d %10d",
|
snprintf(pBueffel,255,"%5d %12.4f %12.4f RAW: %10ld %10ld",
|
||||||
self->scanObject->iCounts -1,
|
self->scanObject->iCounts -1,
|
||||||
fPos, countValue, rawCount,
|
fPos, countValue, rawCount,
|
||||||
rawMon);
|
rawMon);
|
||||||
|
6
drive.c
6
drive.c
@ -377,7 +377,7 @@
|
|||||||
}
|
}
|
||||||
else if(iRet == DEVINT)
|
else if(iRet == DEVINT)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"Driving Interrupted!",argv[0]);
|
sprintf(pBueffel,"Driving Interrupted!");
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
ClearExecutor(GetExecutor());
|
ClearExecutor(GetExecutor());
|
||||||
SetStatus(eOld);
|
SetStatus(eOld);
|
||||||
@ -456,14 +456,14 @@
|
|||||||
iRet = AddCommand(pSics,"drive", DriveWrapper,NULL,NULL);
|
iRet = AddCommand(pSics,"drive", DriveWrapper,NULL,NULL);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: duplicate command drive not created",argv[2]);
|
sprintf(pBueffel,"ERROR: duplicate command drive not created");
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
iRet = AddCommand(pSics,"run", RunWrapper,NULL,NULL);
|
iRet = AddCommand(pSics,"run", RunWrapper,NULL,NULL);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: duplicate command run not created",argv[2]);
|
sprintf(pBueffel,"ERROR: duplicate command run not created");
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1420,6 +1420,7 @@ int RemoveEVController(SConnection *pCon, char *name) {
|
|||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
EVControlFactory implements a SICS command which creates and deletes
|
EVControlFactory implements a SICS command which creates and deletes
|
||||||
|
2
exeman.c
2
exeman.c
@ -540,6 +540,7 @@ static int infoHandler(pExeMan self, SConnection *pCon,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 1; /* statement inserted, guessed return value M.Z. */
|
||||||
} else {
|
} else {
|
||||||
strtolower(argv[2]);
|
strtolower(argv[2]);
|
||||||
if(strcmp(argv[2],"stack") == 0){
|
if(strcmp(argv[2],"stack") == 0){
|
||||||
@ -553,6 +554,7 @@ static int infoHandler(pExeMan self, SConnection *pCon,
|
|||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SCWrite(pCon,"ERROR: subcommand to info unknown",eError);
|
SCWrite(pCon,"ERROR: subcommand to info unknown",eError);
|
||||||
|
return 0; /* statement inserted, guessed return value M.Z. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@
|
|||||||
if(!iRet || !iRet1)
|
if(!iRet || !iRet1)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,
|
sprintf(pBueffel,
|
||||||
"ERROR: duplicate commands peak and center not created",argv[2]);
|
"ERROR: duplicate commands peak and center not created");
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
DeleteFitCenter((void *)self);
|
DeleteFitCenter((void *)self);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -447,7 +447,7 @@ double sign(double a, double b){
|
|||||||
if(b >= .0){
|
if(b >= .0){
|
||||||
return ABS(a);
|
return ABS(a);
|
||||||
} else {
|
} else {
|
||||||
-ABS(a);
|
return -ABS(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
1
help.c
1
help.c
@ -145,4 +145,5 @@ int SicsHelp(SConnection *pCon,SicsInterp *pSics, void *pData,
|
|||||||
}
|
}
|
||||||
printHelpFile(pCon,fd);
|
printHelpFile(pCon,fd);
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1559,6 +1559,7 @@ static int checkHMEnd(pHistMem self, char *text){
|
|||||||
{
|
{
|
||||||
clearTimeBinning(self->pDriv->data);
|
clearTimeBinning(self->pDriv->data);
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/*-------- sum */
|
/*-------- sum */
|
||||||
else if(strcmp(argv[1],"sum") == 0)
|
else if(strcmp(argv[1],"sum") == 0)
|
||||||
|
1
hmdata.c
1
hmdata.c
@ -9,6 +9,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <time.h>
|
||||||
#include "fortify.h"
|
#include "fortify.h"
|
||||||
#include "hmdata.h"
|
#include "hmdata.h"
|
||||||
#include "HistMem.h"
|
#include "HistMem.h"
|
||||||
|
2
lomax.c
2
lomax.c
@ -24,6 +24,8 @@
|
|||||||
#define COGWINDOW 3
|
#define COGWINDOW 3
|
||||||
#define COGCONTOUR 4
|
#define COGCONTOUR 4
|
||||||
|
|
||||||
|
extern float nintf(float f);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
static int testBoundaries(int xsize, int ysize, int window,
|
static int testBoundaries(int xsize, int ysize, int window,
|
||||||
int i, int j)
|
int i, int j)
|
||||||
|
@ -21,7 +21,8 @@ include $(SRC)sllinux_def
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) \
|
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) \
|
||||||
-I$(SRC)psi/hardsup -I$(SRC). \
|
-I$(SRC)psi/hardsup -I$(SRC). \
|
||||||
-fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY)
|
-fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) \
|
||||||
|
-Wall -Wno-unused -Wno-comment -Wno-switch
|
||||||
|
|
||||||
BINTARGET = bin
|
BINTARGET = bin
|
||||||
EXTRA=nintf.o
|
EXTRA=nintf.o
|
||||||
|
@ -331,7 +331,7 @@
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sprintf(pBueffel,"iBot = %d, iTop = %d, lMax = %d",
|
sprintf(pBueffel,"iBot = %d, iTop = %d, lMax = %ld",
|
||||||
iBot, iTop, lMax);
|
iBot, iTop, lMax);
|
||||||
SCWrite(pCon,pBueffel,eWarning);
|
SCWrite(pCon,pBueffel,eWarning);
|
||||||
#endif
|
#endif
|
||||||
|
14
mesure.c
14
mesure.c
@ -32,6 +32,7 @@
|
|||||||
#include "lld.h"
|
#include "lld.h"
|
||||||
|
|
||||||
extern void SNXFormatTime(char *pBueffel, int iLen);
|
extern void SNXFormatTime(char *pBueffel, int iLen);
|
||||||
|
extern float nintf(float f);
|
||||||
#define ANGERR 0.2
|
#define ANGERR 0.2
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -854,7 +855,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
|||||||
/* write it */
|
/* write it */
|
||||||
if(self->fRefl)
|
if(self->fRefl)
|
||||||
{
|
{
|
||||||
fprintf(self->fRefl,"%4d%8.3f%8.3f%8.3f%8.2f%8.2f%8.2f%8.2f%8.0f%8.2f\n",
|
fprintf(self->fRefl,"%4d %7.3f %7.3f %7.3f %7.2f %7.2f %7.2f %7.2f %7.0f %7.2f\n",
|
||||||
self->iCount, fHKL[0],fHKL[1],fHKL[2],
|
self->iCount, fHKL[0],fHKL[1],fHKL[2],
|
||||||
self->fPosition[0], self->fPosition[1],
|
self->fPosition[0], self->fPosition[1],
|
||||||
self->fPosition[2],self->fPosition[3],
|
self->fPosition[2],self->fPosition[3],
|
||||||
@ -862,13 +863,13 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
|||||||
}
|
}
|
||||||
if(self->fHKL)
|
if(self->fHKL)
|
||||||
{
|
{
|
||||||
fprintf(self->fHKL,"%5d%7.2f%7.2f%7.2f%8.2f%8.2f%8.2f%8.2f%8.0f%8.2f\n",
|
fprintf(self->fHKL,"%5d %6.2f %6.2f %6.2f %7.2f %7.2f %7.2f %7.2f %7.0f %7.2f\n",
|
||||||
self->iCount, fHKL[0],fHKL[1],fHKL[2],
|
self->iCount, fHKL[0],fHKL[1],fHKL[2],
|
||||||
self->fPosition[0], self->fPosition[1],
|
self->fPosition[0], self->fPosition[1],
|
||||||
self->fPosition[2],self->fPosition[3],
|
self->fPosition[2],self->fPosition[3],
|
||||||
fSum,fSigma);
|
fSum,fSigma);
|
||||||
}
|
}
|
||||||
sprintf(pBueffel,"%5d%7.2f%7.2f%7.2f%8.2f%8.2f%8.2f%8.2f%8.0f%8.2f\n",
|
sprintf(pBueffel,"%5d %6.2f %6.2f %6.2f %7.2f %7.2f %7.2f %7.2f %7.0f %7.2f\n",
|
||||||
self->iCount, fHKL[0],fHKL[1],fHKL[2],
|
self->iCount, fHKL[0],fHKL[1],fHKL[2],
|
||||||
self->fPosition[0], self->fPosition[1],
|
self->fPosition[0], self->fPosition[1],
|
||||||
self->fPosition[2],self->fPosition[3],
|
self->fPosition[2],self->fPosition[3],
|
||||||
@ -892,13 +893,13 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
|||||||
GetScanVarStep(self->pScanner,0,&fStep);
|
GetScanVarStep(self->pScanner,0,&fStep);
|
||||||
iNP = GetScanNP(self->pScanner);
|
iNP = GetScanNP(self->pScanner);
|
||||||
fPreset = GetScanPreset(self->pScanner);
|
fPreset = GetScanPreset(self->pScanner);
|
||||||
fprintf(self->fRefl,"%3d%8.3f%10.0f%8.3f %s\n",iNP,fStep,
|
fprintf(self->fRefl,"%3d %7.3f %9.0f %7.3f %s\n",iNP,fStep,
|
||||||
fPreset,fTemp,pBueffel);
|
fPreset,fTemp,pBueffel);
|
||||||
for(i = 0; i < iNP; i++)
|
for(i = 0; i < iNP; i++)
|
||||||
{
|
{
|
||||||
for(ii = 0; ii < 10 && i < iNP; ii++)
|
for(ii = 0; ii < 10 && i < iNP; ii++)
|
||||||
{
|
{
|
||||||
fprintf(self->fRefl,"%8d",self->lCounts[i]);
|
fprintf(self->fRefl," %7ld",self->lCounts[i]);
|
||||||
iLF = 1;
|
iLF = 1;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -925,7 +926,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
|||||||
{
|
{
|
||||||
for(ii = 0; ii < 10 && i < iNP; ii++)
|
for(ii = 0; ii < 10 && i < iNP; ii++)
|
||||||
{
|
{
|
||||||
sprintf(pNum,"%7d",self->lCounts[i]);
|
sprintf(pNum," %6ld",self->lCounts[i]);
|
||||||
strcat(pBueffel,pNum);
|
strcat(pBueffel,pNum);
|
||||||
iLF = 1;
|
iLF = 1;
|
||||||
i++;
|
i++;
|
||||||
@ -1375,6 +1376,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
|||||||
else if(strcmp(argv[1],"list") == 0)
|
else if(strcmp(argv[1],"list") == 0)
|
||||||
{
|
{
|
||||||
ListMesure(self,argv[0],pCon);
|
ListMesure(self,argv[0],pCon);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/*------ file */
|
/*------ file */
|
||||||
else if(strcmp(argv[1],"file") == 0)
|
else if(strcmp(argv[1],"file") == 0)
|
||||||
|
1
motreg.c
1
motreg.c
@ -128,6 +128,7 @@ int CheckRegMot(pMotReg self, SConnection *pCon){
|
|||||||
if(stat != HWBusy){
|
if(stat != HWBusy){
|
||||||
self->iActive = 0;
|
self->iActive = 0;
|
||||||
}
|
}
|
||||||
|
return stat;
|
||||||
} else {
|
} else {
|
||||||
return HWIdle;
|
return HWIdle;
|
||||||
}
|
}
|
||||||
|
4
mumo.c
4
mumo.c
@ -451,7 +451,8 @@ static int SaveMumo(void *pData, char *name, FILE *fd)
|
|||||||
{
|
{
|
||||||
SCWrite(pCon,"ERROR: Incomplete command",eError);
|
SCWrite(pCon,"ERROR: Incomplete command",eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
return 1; /* inserted return statement, guessed return value M.Z.*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
@ -618,6 +619,7 @@ static int SaveMumo(void *pData, char *name, FILE *fd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 1; /* inserted return statement, guessed return value M.Z */
|
||||||
}
|
}
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
static int CheckPermission(SConnection *pCon, pMulMot self)
|
static int CheckPermission(SConnection *pCon, pMulMot self)
|
||||||
|
@ -378,7 +378,7 @@ CreateSocketAdress(
|
|||||||
iRet = send(self->sockid,buffer,lLen,0);
|
iRet = send(self->sockid,buffer,lLen,0);
|
||||||
if(iRet != lLen)
|
if(iRet != lLen)
|
||||||
{
|
{
|
||||||
printf("Incomplete send: %d to %d\n",iRet,lLen);
|
printf("Incomplete send: %d to %ld\n",iRet,lLen);
|
||||||
if(iRet < 0)
|
if(iRet < 0)
|
||||||
{
|
{
|
||||||
printf("System error: %s\n",strerror(errno));
|
printf("System error: %s\n",strerror(errno));
|
||||||
|
3
nigpib.c
3
nigpib.c
@ -65,8 +65,9 @@ static int NIread(int devID, void *buffer, int bytesToRead){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
static void NIclear(int devID){
|
static int NIclear(int devID){
|
||||||
ibclr(devID);
|
ibclr(devID);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------*/
|
/*-----------------------------------------------------------------*/
|
||||||
static void NIerror(int code, char *buffer, int maxBuffer){
|
static void NIerror(int code, char *buffer, int maxBuffer){
|
||||||
|
2
nread.c
2
nread.c
@ -40,7 +40,7 @@
|
|||||||
#include "commandlog.h"
|
#include "commandlog.h"
|
||||||
|
|
||||||
extern pServer pServ;
|
extern pServer pServ;
|
||||||
extern VerifyChannel(mkChannel *self); /* defined in network.c */
|
extern int VerifyChannel(mkChannel *self); /* defined in network.c */
|
||||||
#define NRMAGIC 1061996
|
#define NRMAGIC 1061996
|
||||||
/*
|
/*
|
||||||
#define TELNETDEBUG 1
|
#define TELNETDEBUG 1
|
||||||
|
11
nxscript.c
11
nxscript.c
@ -29,6 +29,11 @@
|
|||||||
#include "udpquieck.h"
|
#include "udpquieck.h"
|
||||||
#include "nxdict.h"
|
#include "nxdict.h"
|
||||||
#include "nxscript.h"
|
#include "nxscript.h"
|
||||||
|
|
||||||
|
extern char *trim(char *str);
|
||||||
|
|
||||||
|
/* missing in nxdict.h: */
|
||||||
|
NXstatus NXDdefget(NXdict handle, char *pKey, char *pBuffer, int iBufLen);
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
char *makeFilename(SicsInterp *pSics, SConnection *pCon) {
|
char *makeFilename(SicsInterp *pSics, SConnection *pCon) {
|
||||||
pSicsVariable pPath = NULL, pPref = NULL, pEnd = NULL;
|
pSicsVariable pPath = NULL, pPref = NULL, pEnd = NULL;
|
||||||
@ -659,7 +664,7 @@ static void putArray(SConnection *pCon, SicsInterp *pSics,
|
|||||||
get array length
|
get array length
|
||||||
*/
|
*/
|
||||||
status = Tcl_GetInt(tcl,argv[4],&length);
|
status = Tcl_GetInt(tcl,argv[4],&length);
|
||||||
if(status = TCL_OK){
|
if(status == TCL_OK){
|
||||||
sprintf(buffer,"ERROR: failed to convert %s to integer",argv[4]);
|
sprintf(buffer,"ERROR: failed to convert %s to integer",argv[4]);
|
||||||
SCWrite(pCon,buffer,eError);
|
SCWrite(pCon,buffer,eError);
|
||||||
return;
|
return;
|
||||||
@ -682,10 +687,10 @@ static void putArray(SConnection *pCon, SicsInterp *pSics,
|
|||||||
*/
|
*/
|
||||||
for(i = 0; i < length; i++){
|
for(i = 0; i < length; i++){
|
||||||
sprintf(num,"%d",i);
|
sprintf(num,"%d",i);
|
||||||
varData = Tcl_GetVar2(tcl,argv[3],num,0);
|
varData = (char *)Tcl_GetVar2(tcl,argv[3],num,0);
|
||||||
if(varData != NULL){
|
if(varData != NULL){
|
||||||
status = Tcl_GetDouble(tcl,varData,&dVal);
|
status = Tcl_GetDouble(tcl,varData,&dVal);
|
||||||
if(status = TCL_OK){
|
if(status == TCL_OK){
|
||||||
sprintf(buffer,"ERROR: failed to convert %s to double",
|
sprintf(buffer,"ERROR: failed to convert %s to double",
|
||||||
varData);
|
varData);
|
||||||
SCWrite(pCon,buffer,eError);
|
SCWrite(pCon,buffer,eError);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <time.h>
|
||||||
#include "fortify.h"
|
#include "fortify.h"
|
||||||
#include "sics.h"
|
#include "sics.h"
|
||||||
#include "splitter.h"
|
#include "splitter.h"
|
||||||
|
3
o2t.c
3
o2t.c
@ -143,7 +143,8 @@
|
|||||||
{
|
{
|
||||||
iRet = pDrivInt->SetValue(self->pTheta,pCon, fVal);
|
iRet = pDrivInt->SetValue(self->pTheta,pCon, fVal);
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
return 0; /* inserted statement, guessed return value M.Z. */
|
||||||
}
|
}
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
static int O2TCheckStatus(void *pData, SConnection *pCon)
|
static int O2TCheckStatus(void *pData, SConnection *pCon)
|
||||||
|
9
scan.c
9
scan.c
@ -335,7 +335,7 @@ static void ConfigureScanDict(pStringDict dict)
|
|||||||
pCount = (pCountEntry)pData;
|
pCount = (pCountEntry)pData;
|
||||||
if(pCount != NULL)
|
if(pCount != NULL)
|
||||||
{
|
{
|
||||||
fprintf(fd,"%s storecounts %d %f %d %d %d %d %d %d %d %d %d %d\n",
|
fprintf(fd,"%s storecounts %ld %f %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n",
|
||||||
self->objectName,
|
self->objectName,
|
||||||
pCount->lCount,
|
pCount->lCount,
|
||||||
pCount->fTime,
|
pCount->fTime,
|
||||||
@ -1326,7 +1326,7 @@ int isScanVarSoft(pScanData self){
|
|||||||
strcpy(pPtr,"scan.Counts= {");
|
strcpy(pPtr,"scan.Counts= {");
|
||||||
for(i = 0; i < self->iNP; i++)
|
for(i = 0; i < self->iNP; i++)
|
||||||
{
|
{
|
||||||
sprintf(pItem,"%d ",lData[i]);
|
sprintf(pItem,"%ld ",lData[i]);
|
||||||
strcat(pPtr,pItem);
|
strcat(pPtr,pItem);
|
||||||
}
|
}
|
||||||
strcat(pPtr,"}");
|
strcat(pPtr,"}");
|
||||||
@ -1386,7 +1386,7 @@ int isScanVarSoft(pScanData self){
|
|||||||
} else {
|
} else {
|
||||||
lVal = -9999.99;
|
lVal = -9999.99;
|
||||||
}
|
}
|
||||||
snprintf(pBueffel,255,"%s.scanpoint = {%d %f %d}",
|
snprintf(pBueffel,255,"%s.scanpoint = {%d %f %ld}",
|
||||||
self->objectName,i,fVal,lVal);
|
self->objectName,i,fVal,lVal);
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
}
|
}
|
||||||
@ -2374,5 +2374,6 @@ static int InterpretScanFunctions(pScanData self, SConnection *pCon,
|
|||||||
argv[1], argv[0]);
|
argv[1], argv[0]);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
1
sicvar.c
1
sicvar.c
@ -443,6 +443,7 @@ static int VarSetFromText(pSicsVariable self, SConnection *pCon, char *text)
|
|||||||
{
|
{
|
||||||
return VarSetFloat(self,(float)dVal,SCGetRights(pCon));
|
return VarSetFloat(self,(float)dVal,SCGetRights(pCon));
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------
|
||||||
Variables understands some commands:
|
Variables understands some commands:
|
||||||
|
32
stdscan.c
32
stdscan.c
@ -260,7 +260,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make the data header */
|
/* make the data header */
|
||||||
sprintf(pLine,"%-5s","NP");
|
sprintf(pLine,"%-4s ","NP");
|
||||||
strcpy(pInfo,"Scanning Variables: ");
|
strcpy(pInfo,"Scanning Variables: ");
|
||||||
for(i = 0; i < self->iScanVar;i++)
|
for(i = 0; i < self->iScanVar;i++)
|
||||||
{
|
{
|
||||||
@ -297,7 +297,7 @@
|
|||||||
/* now the scan points */
|
/* now the scan points */
|
||||||
for(i = 0; i < self->iCounts; i++)
|
for(i = 0; i < self->iCounts; i++)
|
||||||
{
|
{
|
||||||
sprintf(pLine,"%-5d",i);
|
sprintf(pLine,"%-4d ",i);
|
||||||
/* print vars */
|
/* print vars */
|
||||||
for(i2 = 0; i2 < self->iScanVar; i2++)
|
for(i2 = 0; i2 < self->iScanVar; i2++)
|
||||||
{
|
{
|
||||||
@ -305,7 +305,7 @@
|
|||||||
pVar = (pVarEntry)pPtr;
|
pVar = (pVarEntry)pPtr;
|
||||||
if(pVar)
|
if(pVar)
|
||||||
{
|
{
|
||||||
sprintf(pItem,"%-10.3f",GetScanVarPos(pVar,i));
|
sprintf(pItem,"%-9.3f ",GetScanVarPos(pVar,i));
|
||||||
strcat(pLine,pItem);
|
strcat(pLine,pItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -314,15 +314,15 @@
|
|||||||
pData = (pCountEntry)pPtr;
|
pData = (pCountEntry)pPtr;
|
||||||
if(pData)
|
if(pData)
|
||||||
{
|
{
|
||||||
sprintf(pItem," %-12ld",pData->lCount);
|
sprintf(pItem," %-11ld ",pData->lCount);
|
||||||
strcat(pLine,pItem);
|
strcat(pLine,pItem);
|
||||||
sprintf(pItem,"%-12ld",pData->Monitors[0]);
|
sprintf(pItem,"%-11ld ",pData->Monitors[0]);
|
||||||
strcat(pLine,pItem);
|
strcat(pLine,pItem);
|
||||||
sprintf(pItem,"%-12ld",pData->Monitors[1]);
|
sprintf(pItem,"%-11ld ",pData->Monitors[1]);
|
||||||
strcat(pLine,pItem);
|
strcat(pLine,pItem);
|
||||||
sprintf(pItem,"%-12ld",pData->Monitors[2]);
|
sprintf(pItem,"%-11ld ",pData->Monitors[2]);
|
||||||
strcat(pLine,pItem);
|
strcat(pLine,pItem);
|
||||||
sprintf(pItem,"%-6.1f",pData->fTime);
|
sprintf(pItem,"%-5.1f ",pData->fTime);
|
||||||
strcat(pLine,pItem);
|
strcat(pLine,pItem);
|
||||||
}
|
}
|
||||||
fprintf(self->fd,"%s\n",pLine);
|
fprintf(self->fd,"%s\n",pLine);
|
||||||
@ -450,8 +450,8 @@
|
|||||||
InitCountEntry(&sCount);
|
InitCountEntry(&sCount);
|
||||||
|
|
||||||
/* prepare output header */
|
/* prepare output header */
|
||||||
sprintf(pHead,"%-5.5s","NP");
|
sprintf(pHead,"%-4.4s ","NP");
|
||||||
sprintf(pStatus,"%-5d",iPoint);
|
sprintf(pStatus,"%-4d ",iPoint);
|
||||||
|
|
||||||
/* loop over all scan variables */
|
/* loop over all scan variables */
|
||||||
status = 1;
|
status = 1;
|
||||||
@ -471,9 +471,9 @@
|
|||||||
fVal = pVar->pInter->GetValue(pVar->pObject,self->pCon);
|
fVal = pVar->pInter->GetValue(pVar->pObject,self->pCon);
|
||||||
}
|
}
|
||||||
AppendScanVar(pVar,fVal);
|
AppendScanVar(pVar,fVal);
|
||||||
sprintf(pItem,"%-10.10s",ScanVarName(pVar));
|
sprintf(pItem,"%-9.9s ",ScanVarName(pVar));
|
||||||
strcat(pHead,pItem);
|
strcat(pHead,pItem);
|
||||||
sprintf(pItem,"%-10.3f",fVal);
|
sprintf(pItem,"%-9.3f ",fVal);
|
||||||
strcat(pStatus,pItem);
|
strcat(pStatus,pItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -486,17 +486,17 @@
|
|||||||
*/
|
*/
|
||||||
strcat(pHead,"Counts ");
|
strcat(pHead,"Counts ");
|
||||||
|
|
||||||
sprintf(pItem,"%-15d",sCount.lCount);
|
sprintf(pItem,"%-14ld ",sCount.lCount);
|
||||||
strcat(pStatus,pItem);
|
strcat(pStatus,pItem);
|
||||||
|
|
||||||
strcat(pHead,"Monitor1 ");
|
strcat(pHead,"Monitor1 ");
|
||||||
sprintf(pItem,"%-12d",sCount.Monitors[0]);
|
sprintf(pItem,"%-11ld ",sCount.Monitors[0]);
|
||||||
strcat(pStatus,pItem);
|
strcat(pStatus,pItem);
|
||||||
strcat(pHead,"Monitor2 ");
|
strcat(pHead,"Monitor2 ");
|
||||||
sprintf(pItem,"%-12d",sCount.Monitors[1]);
|
sprintf(pItem,"%-11ld ",sCount.Monitors[1]);
|
||||||
strcat(pStatus,pItem);
|
strcat(pStatus,pItem);
|
||||||
strcat(pHead,"Monitor3 ");
|
strcat(pHead,"Monitor3 ");
|
||||||
sprintf(pItem,"%-12d",sCount.Monitors[2]);
|
sprintf(pItem,"%-11ld ",sCount.Monitors[2]);
|
||||||
strcat(pStatus,pItem);
|
strcat(pStatus,pItem);
|
||||||
strcat(pHead,"Time ");
|
strcat(pHead,"Time ");
|
||||||
sprintf(pItem,"%-6.1f",sCount.fTime);
|
sprintf(pItem,"%-6.1f",sCount.fTime);
|
||||||
|
2
token.c
2
token.c
@ -56,7 +56,7 @@
|
|||||||
NULL);
|
NULL);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
SCWrite(pCon,"ERROR: token command already exixts???!!",eError);
|
SCWrite(pCon,"ERROR: token command already exists ??? !!",eError);
|
||||||
}
|
}
|
||||||
return iRet;
|
return iRet;
|
||||||
|
|
||||||
|
2
varlog.c
2
varlog.c
@ -450,7 +450,7 @@ static void VarLogDumpFile(pVarLog self, FILE *fd)
|
|||||||
}
|
}
|
||||||
else /* print */
|
else /* print */
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"%s.frequency = %d",pVarName,self->tFrequency);
|
sprintf(pBueffel,"%s.frequency = %d",pVarName,(int)self->tFrequency);
|
||||||
SCWrite(pCon,pBueffel,eValue);
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user