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;
|
||||
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;
|
||||
}
|
||||
self->write = SCFileWrite;
|
||||
return 0;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
int SCWriteUUencoded(SConnection *pCon, char *pName, void *pData,
|
||||
|
@ -885,7 +885,7 @@
|
||||
SCWrite(pCon,"All done",eStatus);
|
||||
iRet = 1;
|
||||
}
|
||||
else if(iRet = DEVERROR)
|
||||
else if(iRet == DEVERROR)
|
||||
{
|
||||
SCWrite(pCon,"Finished with Problems",eStatus);
|
||||
iRet = 1;
|
||||
|
@ -325,7 +325,7 @@ static int DiffScanTask(void *pData){
|
||||
/*
|
||||
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,
|
||||
fPos, countValue, rawCount,
|
||||
rawMon);
|
||||
|
6
drive.c
6
drive.c
@ -377,7 +377,7 @@
|
||||
}
|
||||
else if(iRet == DEVINT)
|
||||
{
|
||||
sprintf(pBueffel,"Driving Interrupted!",argv[0]);
|
||||
sprintf(pBueffel,"Driving Interrupted!");
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
ClearExecutor(GetExecutor());
|
||||
SetStatus(eOld);
|
||||
@ -456,14 +456,14 @@
|
||||
iRet = AddCommand(pSics,"drive", DriveWrapper,NULL,NULL);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: duplicate command drive not created",argv[2]);
|
||||
sprintf(pBueffel,"ERROR: duplicate command drive not created");
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
iRet = AddCommand(pSics,"run", RunWrapper,NULL,NULL);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: duplicate command run not created",argv[2]);
|
||||
sprintf(pBueffel,"ERROR: duplicate command run not created");
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1420,6 +1420,7 @@ int RemoveEVController(SConnection *pCon, char *name) {
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*-------------------------------------------------------------------------
|
||||
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; /* statement inserted, guessed return value M.Z. */
|
||||
} else {
|
||||
strtolower(argv[2]);
|
||||
if(strcmp(argv[2],"stack") == 0){
|
||||
@ -553,6 +554,7 @@ static int infoHandler(pExeMan self, SConnection *pCon,
|
||||
return 1;
|
||||
} else {
|
||||
SCWrite(pCon,"ERROR: subcommand to info unknown",eError);
|
||||
return 0; /* statement inserted, guessed return value M.Z. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -407,7 +407,7 @@
|
||||
if(!iRet || !iRet1)
|
||||
{
|
||||
sprintf(pBueffel,
|
||||
"ERROR: duplicate commands peak and center not created",argv[2]);
|
||||
"ERROR: duplicate commands peak and center not created");
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
DeleteFitCenter((void *)self);
|
||||
return 0;
|
||||
|
@ -447,7 +447,7 @@ double sign(double a, double b){
|
||||
if(b >= .0){
|
||||
return ABS(a);
|
||||
} 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);
|
||||
fclose(fd);
|
||||
return 1;
|
||||
}
|
||||
|
@ -1559,6 +1559,7 @@ static int checkHMEnd(pHistMem self, char *text){
|
||||
{
|
||||
clearTimeBinning(self->pDriv->data);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
}
|
||||
/*-------- sum */
|
||||
else if(strcmp(argv[1],"sum") == 0)
|
||||
|
1
hmdata.c
1
hmdata.c
@ -9,6 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include "fortify.h"
|
||||
#include "hmdata.h"
|
||||
#include "HistMem.h"
|
||||
|
2
lomax.c
2
lomax.c
@ -24,6 +24,8 @@
|
||||
#define COGWINDOW 3
|
||||
#define COGCONTOUR 4
|
||||
|
||||
extern float nintf(float f);
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int testBoundaries(int xsize, int ysize, int window,
|
||||
int i, int j)
|
||||
|
@ -21,7 +21,8 @@ include $(SRC)sllinux_def
|
||||
CC = gcc
|
||||
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) \
|
||||
-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
|
||||
EXTRA=nintf.o
|
||||
|
@ -331,7 +331,7 @@
|
||||
return 0;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
sprintf(pBueffel,"iBot = %d, iTop = %d, lMax = %d",
|
||||
sprintf(pBueffel,"iBot = %d, iTop = %d, lMax = %ld",
|
||||
iBot, iTop, lMax);
|
||||
SCWrite(pCon,pBueffel,eWarning);
|
||||
#endif
|
||||
|
14
mesure.c
14
mesure.c
@ -32,6 +32,7 @@
|
||||
#include "lld.h"
|
||||
|
||||
extern void SNXFormatTime(char *pBueffel, int iLen);
|
||||
extern float nintf(float f);
|
||||
#define ANGERR 0.2
|
||||
|
||||
/*
|
||||
@ -854,7 +855,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
/* write it */
|
||||
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->fPosition[0], self->fPosition[1],
|
||||
self->fPosition[2],self->fPosition[3],
|
||||
@ -862,13 +863,13 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
}
|
||||
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->fPosition[0], self->fPosition[1],
|
||||
self->fPosition[2],self->fPosition[3],
|
||||
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->fPosition[0], self->fPosition[1],
|
||||
self->fPosition[2],self->fPosition[3],
|
||||
@ -892,13 +893,13 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
GetScanVarStep(self->pScanner,0,&fStep);
|
||||
iNP = GetScanNP(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);
|
||||
for(i = 0; i < iNP; i++)
|
||||
{
|
||||
for(ii = 0; ii < 10 && i < iNP; ii++)
|
||||
{
|
||||
fprintf(self->fRefl,"%8d",self->lCounts[i]);
|
||||
fprintf(self->fRefl," %7ld",self->lCounts[i]);
|
||||
iLF = 1;
|
||||
i++;
|
||||
}
|
||||
@ -925,7 +926,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
{
|
||||
for(ii = 0; ii < 10 && i < iNP; ii++)
|
||||
{
|
||||
sprintf(pNum,"%7d",self->lCounts[i]);
|
||||
sprintf(pNum," %6ld",self->lCounts[i]);
|
||||
strcat(pBueffel,pNum);
|
||||
iLF = 1;
|
||||
i++;
|
||||
@ -1375,6 +1376,7 @@ static int ScanReflection(pMesure self, float twoTheta, SConnection *pCon)
|
||||
else if(strcmp(argv[1],"list") == 0)
|
||||
{
|
||||
ListMesure(self,argv[0],pCon);
|
||||
return 1;
|
||||
}
|
||||
/*------ file */
|
||||
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){
|
||||
self->iActive = 0;
|
||||
}
|
||||
return stat;
|
||||
} else {
|
||||
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);
|
||||
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 1; /* inserted return statement, guessed return value M.Z */
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
static int CheckPermission(SConnection *pCon, pMulMot self)
|
||||
|
@ -378,7 +378,7 @@ CreateSocketAdress(
|
||||
iRet = send(self->sockid,buffer,lLen,0);
|
||||
if(iRet != lLen)
|
||||
{
|
||||
printf("Incomplete send: %d to %d\n",iRet,lLen);
|
||||
printf("Incomplete send: %d to %ld\n",iRet,lLen);
|
||||
if(iRet < 0)
|
||||
{
|
||||
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);
|
||||
return 1;
|
||||
}
|
||||
/*-----------------------------------------------------------------*/
|
||||
static void NIerror(int code, char *buffer, int maxBuffer){
|
||||
|
2
nread.c
2
nread.c
@ -40,7 +40,7 @@
|
||||
#include "commandlog.h"
|
||||
|
||||
extern pServer pServ;
|
||||
extern VerifyChannel(mkChannel *self); /* defined in network.c */
|
||||
extern int VerifyChannel(mkChannel *self); /* defined in network.c */
|
||||
#define NRMAGIC 1061996
|
||||
/*
|
||||
#define TELNETDEBUG 1
|
||||
|
11
nxscript.c
11
nxscript.c
@ -29,6 +29,11 @@
|
||||
#include "udpquieck.h"
|
||||
#include "nxdict.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) {
|
||||
pSicsVariable pPath = NULL, pPref = NULL, pEnd = NULL;
|
||||
@ -659,7 +664,7 @@ static void putArray(SConnection *pCon, SicsInterp *pSics,
|
||||
get array 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]);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
return;
|
||||
@ -682,10 +687,10 @@ static void putArray(SConnection *pCon, SicsInterp *pSics,
|
||||
*/
|
||||
for(i = 0; i < length; 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){
|
||||
status = Tcl_GetDouble(tcl,varData,&dVal);
|
||||
if(status = TCL_OK){
|
||||
if(status == TCL_OK){
|
||||
sprintf(buffer,"ERROR: failed to convert %s to double",
|
||||
varData);
|
||||
SCWrite(pCon,buffer,eError);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include "fortify.h"
|
||||
#include "sics.h"
|
||||
#include "splitter.h"
|
||||
|
3
o2t.c
3
o2t.c
@ -143,7 +143,8 @@
|
||||
{
|
||||
iRet = pDrivInt->SetValue(self->pTheta,pCon, fVal);
|
||||
return iRet;
|
||||
}
|
||||
}
|
||||
return 0; /* inserted statement, guessed return value M.Z. */
|
||||
}
|
||||
/*-------------------------------------------------------------------------*/
|
||||
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;
|
||||
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,
|
||||
pCount->lCount,
|
||||
pCount->fTime,
|
||||
@ -1326,7 +1326,7 @@ int isScanVarSoft(pScanData self){
|
||||
strcpy(pPtr,"scan.Counts= {");
|
||||
for(i = 0; i < self->iNP; i++)
|
||||
{
|
||||
sprintf(pItem,"%d ",lData[i]);
|
||||
sprintf(pItem,"%ld ",lData[i]);
|
||||
strcat(pPtr,pItem);
|
||||
}
|
||||
strcat(pPtr,"}");
|
||||
@ -1386,7 +1386,7 @@ int isScanVarSoft(pScanData self){
|
||||
} else {
|
||||
lVal = -9999.99;
|
||||
}
|
||||
snprintf(pBueffel,255,"%s.scanpoint = {%d %f %d}",
|
||||
snprintf(pBueffel,255,"%s.scanpoint = {%d %f %ld}",
|
||||
self->objectName,i,fVal,lVal);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
}
|
||||
@ -2374,5 +2374,6 @@ static int InterpretScanFunctions(pScanData self, SConnection *pCon,
|
||||
argv[1], argv[0]);
|
||||
SCWrite(pCon,pBueffel,eError);
|
||||
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 0;
|
||||
}
|
||||
/*--------------------------------------------------------------------------
|
||||
Variables understands some commands:
|
||||
|
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);
|
||||
|
2
token.c
2
token.c
@ -56,7 +56,7 @@
|
||||
NULL);
|
||||
if(!iRet)
|
||||
{
|
||||
SCWrite(pCon,"ERROR: token command already exixts???!!",eError);
|
||||
SCWrite(pCon,"ERROR: token command already exists ??? !!",eError);
|
||||
}
|
||||
return iRet;
|
||||
|
||||
|
Reference in New Issue
Block a user