- cleaned up makefiles

- polished code to avoid warnings
This commit is contained in:
zolliker
2005-03-08 11:12:23 +00:00
parent 350c410bdf
commit 94075f06c7
60 changed files with 189 additions and 286 deletions

View File

@ -31,6 +31,7 @@
{ {
return WriteAmorScan(self->pFile,self->pCon,self); return WriteAmorScan(self->pFile,self->pCon,self);
} }
return 1; /* guessed return value M.Z. */
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static int AmorCollect(pScanData self, int iP) static int AmorCollect(pScanData self, int iP)
@ -60,9 +61,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",pVar->Name); sprintf(pItem," %-9.9s",pVar->Name);
strcat(pHead,pItem); strcat(pHead,pItem);
sprintf(pItem,"%-10.3f",fVal); sprintf(pItem," %-9.3f",fVal);
strcat(pStatus,pItem); strcat(pStatus,pItem);
} }
} }
@ -83,7 +84,7 @@
/* counter1 */ /* counter1 */
strcat(pHead,"Counter1 "); strcat(pHead,"Counter1 ");
sCount.lCount = GetCounts((pCounter)self->pCounterData,self->pCon); sCount.lCount = GetCounts((pCounter)self->pCounterData,self->pCon);
sprintf(pItem,"%-15d",sCount.lCount); sprintf(pItem," %-14ld",sCount.lCount);
strcat(pStatus,pItem); strcat(pStatus,pItem);
/* /*
@ -96,7 +97,7 @@
strcat(pHead,"Counter2 "); strcat(pHead,"Counter2 ");
sCount.Monitors[0] = GetMonitor((pCounter)self->pCounterData, sCount.Monitors[0] = GetMonitor((pCounter)self->pCounterData,
1,self->pCon); 1,self->pCon);
sprintf(pItem,"%-15d",sCount.Monitors[0]); sprintf(pItem," %-14ld",sCount.Monitors[0]);
strcat(pStatus,pItem); strcat(pStatus,pItem);
/* monitors */ /* monitors */
@ -109,13 +110,13 @@
sCount.fTime = GetCountTime((pCounter)self->pCounterData, sCount.fTime = GetCountTime((pCounter)self->pCounterData,
self->pCon); self->pCon);
strcat(pHead,"Monitor1 "); strcat(pHead,"Monitor1 ");
sprintf(pItem,"%-12d",sCount.Monitors[3]); sprintf(pItem," %-11ld",sCount.Monitors[3]);
strcat(pStatus,pItem); strcat(pStatus,pItem);
strcat(pHead,"Monitor2 "); strcat(pHead,"Monitor2 ");
sprintf(pItem,"%-12d",sCount.Monitors[4]); sprintf(pItem," %-11ld",sCount.Monitors[4]);
strcat(pStatus,pItem); strcat(pStatus,pItem);
strcat(pHead,"Time "); strcat(pHead,"Time ");
sprintf(pItem,"%-6.1f",sCount.fTime); sprintf(pItem," %-5.1f",sCount.fTime);
strcat(pStatus,pItem); strcat(pStatus,pItem);
/* write progress */ /* write progress */

View File

@ -187,6 +187,7 @@
SCWriteUUencoded(pCon,pBueffel,iData,(ud.iNP*2+1)*sizeof(int)); SCWriteUUencoded(pCon,pBueffel,iData,(ud.iNP*2+1)*sizeof(int));
iRet = LLDnodePtr2Next(self->iUserList); iRet = LLDnodePtr2Next(self->iUserList);
} }
return 0;
} }
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
static int LoadCallback(int iEvent, void *pEvent, void *pUser) static int LoadCallback(int iEvent, void *pEvent, void *pUser)

View File

@ -491,8 +491,7 @@
{"load",1,{FUPATEXT}}, {"load",1,{FUPATEXT}},
{"subst",2,{FUPATEXT,FUPATEXT}}, {"subst",2,{FUPATEXT,FUPATEXT}},
{"print",0,{0,0}}, {"print",0,{0,0}},
{"run",0,{0,0}}, {"run",0,{0,0}}
NULL
}; };
assert(pCon); assert(pCon);

View File

@ -45,7 +45,7 @@ typedef struct __VelSelDriv *pVelSelDriv;
/*--------- special Dornier conditions*/ /*--------- special Dornier conditions*/
#define STARTED -88 #define STARTED -88
#define HALTREQ -77 #define HALTREQ -77
#define INVALIDSTATUS -7000 /* INVALIDSTATUS is defined in velodorn.h */
#define TARGETREJECTED -7001 #define TARGETREJECTED -7001
#define NOSTATUS -7002 #define NOSTATUS -7002

1
ecb.c
View File

@ -358,6 +358,7 @@ int ECBAction(SConnection *pCon, SicsInterp *pSics, void *pData,
}else if(strcmp(argv[1],"toint")== 0){ }else if(strcmp(argv[1],"toint")== 0){
sprintf(pBuffer,"%d",argv[2][0]); sprintf(pBuffer,"%d",argv[2][0]);
SCWrite(pCon,pBuffer,eValue); SCWrite(pCon,pBuffer,eValue);
return 1;
} else { } else {
SCWrite(pCon,"ERROR: ECB does not understand keyword", eError); SCWrite(pCon,"ERROR: ECB does not understand keyword", eError);
return 0; return 0;

View File

@ -526,39 +526,39 @@ static int downloadECBParam(pECBMotDriv self){
We assume that all parameters have useful values. It is the task of We assume that all parameters have useful values. It is the task of
SetDriverPar to ensure just that! SetDriverPar to ensure just that!
*/ */
if(status = loadAcceleration(self) <= 0){ if((status = loadAcceleration(self) <= 0)){
return 0; return 0;
} }
if(status = loadSpeed(self,ObVal(self->driverPar,STARTSPEED),6) <= 0){ if((status = loadSpeed(self,ObVal(self->driverPar,STARTSPEED),6) <= 0)){
return 0; return 0;
} }
if(status = loadSpeed(self,ObVal(self->driverPar,MAXSPEED),5) <= 0){ if((status = loadSpeed(self,ObVal(self->driverPar,MAXSPEED),5) <= 0)){
return 0; return 0;
} }
if(status = loadSpeed(self,ObVal(self->driverPar,SLOWAUTO),4) <= 0){ if((status = loadSpeed(self,ObVal(self->driverPar,SLOWAUTO),4) <= 0)){
return 0; return 0;
} }
if(status = loadSpeed(self,ObVal(self->driverPar,SLOWMAN),10) <= 0){ if((status = loadSpeed(self,ObVal(self->driverPar,SLOWMAN),10) <= 0)){
return 0; return 0;
} }
if(status = loadDelay(self) <= 0){ if((status = loadDelay(self) <= 0)){
return 0; return 0;
} }
if(status = loadMulti(self) <= 0){ if((status = loadMulti(self) <= 0)){
return 0; return 0;
} }
if(status = ecbLoadEncoder(self->ecb) <= 0){ if((status = ecbLoadEncoder(self->ecb) <= 0)){
return 0; return 0;
} }
if(status = loadOffset(self,ObVal(self->driverPar,OFFSET)) <= 0){ if((status = loadOffset(self,ObVal(self->driverPar,OFFSET)) <= 0)){
return 0; return 0;
} }
@ -572,7 +572,7 @@ static int downloadECBParam(pECBMotDriv self){
self->driverPar[MULT].fVal = .0; self->driverPar[MULT].fVal = .0;
} }
if(status = loadGearing(self) <= 0){ if((status = loadGearing(self) <= 0)){
return 0; return 0;
} }

View File

@ -11,11 +11,13 @@
#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 <string.h> #include <string.h>
#include <sics.h> #include <sics.h>
#include <rs232controller.h> #include <rs232controller.h>
#include <countdriv.h> #include <countdriv.h>
#include <splitter.h>
#define MONTHRESH 20 #define MONTHRESH 20
@ -501,6 +503,7 @@ static int EL737FixIt(struct __COUNTER *self, int iCode){
break; break;
case TOMANYCOUNTS: case TOMANYCOUNTS:
case SYSERROR: case SYSERROR:
return COTERM; /* guessed return value M.Z. */
break; break;
default: default:
/* /*

View File

@ -16,7 +16,7 @@
#include <sics.h> #include <sics.h>
#include <rs232controller.h> #include <rs232controller.h>
#include <countdriv.h> #include <countdriv.h>
#include <splitter.h>
#define STATSEND 0 #define STATSEND 0
#define STATRECEIVE 2 #define STATRECEIVE 2

43
eve.c
View File

@ -172,24 +172,6 @@ void EveMakePar(Eve *eve) {
} }
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
EvePar *EveThisPar(EveParArg *arg, char *name, int flags) {
Eve *eve = arg->evc->pDriv->pPrivate;
EvePar *par;
if (!eve->par) return NULL;
assert(arg->idx < eve->npar);
par = eve->par + arg->idx;
if (par->name == NULL) {
par->name = name;
if (flags & EVE_LOGPAR) { /* first time: default logger */
EveSwitchLog(eve, par, 1);
}
} else {
assert(par->name == name);
}
return par;
}
/*--------------------------------------------------------------------------*/
void EveLog(Eve *eve) { void EveLog(Eve *eve) {
EveParArg arg; EveParArg arg;
@ -232,6 +214,24 @@ int EveSwitchLog(Eve *eve, EvePar *par, int on) {
} }
return 1; return 1;
} }
/*--------------------------------------------------------------------------*/
EvePar *EveThisPar(EveParArg *arg, char *name, int flags) {
Eve *eve = arg->evc->pDriv->pPrivate;
EvePar *par;
if (!eve->par) return NULL;
assert(arg->idx < eve->npar);
par = eve->par + arg->idx;
if (par->name == NULL) {
par->name = name;
if (flags & EVE_LOGPAR) { /* first time: default logger */
EveSwitchLog(eve, par, 1);
}
} else {
assert(par->name == name);
}
return par;
}
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
ArgOp EveOp(EveParArg *arg, char *name, char **fmt, int access, int flags) { ArgOp EveOp(EveParArg *arg, char *name, char **fmt, int access, int flags) {
static char buf[80]; static char buf[80];
@ -381,6 +381,7 @@ void EveOut(EveParArg *arg, char *name, char *buf) {
case saveAction: case saveAction:
fprintf(arg->fil, "%s %s %s\n", arg->evc->pName, name, buf); fprintf(arg->fil, "%s %s %s\n", arg->evc->pName, name, buf);
break; break;
default: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -408,6 +409,7 @@ void EveFloatPar(EveParArg *arg, char *name, float *value, char *fmt,
snprintf(buf, sizeof buf, fmt, *value); snprintf(buf, sizeof buf, fmt, *value);
EveOut(arg, name, buf); EveOut(arg, name, buf);
break; break;
case noOp: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -434,6 +436,7 @@ void EveIntPar(EveParArg *arg, char *name, int *value, int access, int flags) {
snprintf(buf, sizeof buf, "%d", *value); snprintf(buf, sizeof buf, "%d", *value);
EveOut(arg, name, buf); EveOut(arg, name, buf);
break; break;
case noOp: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -454,6 +457,7 @@ void EveStrPar(EveParArg *arg, char *name, char **value, int maxsize, int access
if (*value == NULL) value = &empty; if (*value == NULL) value = &empty;
EveOut(arg, name, *value); EveOut(arg, name, *value);
break; break;
case noOp: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -482,6 +486,7 @@ void EveObPar(EveParArg *arg, int index, char *fmt, int flags) {
snprintf(buf, sizeof buf, fmt, arg->evc->pParam[index].fVal); snprintf(buf, sizeof buf, fmt, arg->evc->pParam[index].fVal);
EveOut(arg, name, buf); EveOut(arg, name, buf);
break; break;
case noOp: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -511,6 +516,7 @@ void EveObParEnum(EveParArg *arg, int index, char *list[], int flags) {
snprintf(buf, sizeof buf, fmt, i, EveInt2Text(list, i)); snprintf(buf, sizeof buf, fmt, i, EveInt2Text(list, i));
EveOut(arg, name, buf); EveOut(arg, name, buf);
break; break;
case noOp: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -537,6 +543,7 @@ void EveEnumPar(EveParArg *arg, char *name, int *value, char *list[], int access
snprintf(buf, sizeof buf, fmt, *value, EveInt2Text(list, *value)); snprintf(buf, sizeof buf, fmt, *value, EveInt2Text(list, *value));
EveOut(arg, name, buf); EveOut(arg, name, buf);
break; break;
case noOp: break;
} }
} }
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/

View File

@ -90,14 +90,14 @@
iRet = Tcl_GetInt(pSics->pTcl,argv[1],&iStart); iRet = Tcl_GetInt(pSics->pTcl,argv[1],&iStart);
if(iRet != TCL_OK) if(iRet != TCL_OK)
{ {
sprintf(pBueffel,"ERROR: cannot convert %d to integer",argv[1]); sprintf(pBueffel,"ERROR: cannot convert %s to integer",argv[1]);
SCWrite(pCon,pBueffel,eError); SCWrite(pCon,pBueffel,eError);
return 0; return 0;
} }
iRet = Tcl_GetInt(pSics->pTcl,argv[2],&iEnd); iRet = Tcl_GetInt(pSics->pTcl,argv[2],&iEnd);
if(iRet != TCL_OK) if(iRet != TCL_OK)
{ {
sprintf(pBueffel,"ERROR: cannot convert %d to integer",argv[2]); sprintf(pBueffel,"ERROR: cannot convert %s to integer",argv[2]);
SCWrite(pCon,pBueffel,eError); SCWrite(pCon,pBueffel,eError);
return 0; return 0;
} }
@ -109,7 +109,7 @@
iRet = Tcl_GetInt(pSics->pTcl,argv[3],&iBank); iRet = Tcl_GetInt(pSics->pTcl,argv[3],&iBank);
if(iRet != TCL_OK) if(iRet != TCL_OK)
{ {
sprintf(pBueffel,"ERROR: cannot convert %d to integer",argv[3]); sprintf(pBueffel,"ERROR: cannot convert %s to integer",argv[3]);
SCWrite(pCon,pBueffel,eError); SCWrite(pCon,pBueffel,eError);
return 0; return 0;
} }
@ -286,7 +286,7 @@
iRet = Tcl_GetInt(pSics->pTcl,argv[1],&iBank); iRet = Tcl_GetInt(pSics->pTcl,argv[1],&iBank);
if(iRet != TCL_OK) if(iRet != TCL_OK)
{ {
sprintf(pBueffel,"ERROR: cannot convert %d to integer",argv[1]); sprintf(pBueffel,"ERROR: cannot convert %s to integer",argv[1]);
SCWrite(pCon,pBueffel,eError); SCWrite(pCon,pBueffel,eError);
return 0; return 0;
} }
@ -554,4 +554,5 @@ HistInt *CheckBank(pFocusAverager self, SConnection *pCon,
mergData = getFMBankPointer(4); mergData = getFMBankPointer(4);
return mergData; return mergData;
} }
return NULL; /* inserted statement, guessed return value M.Z */
} }

View File

@ -414,7 +414,7 @@
/* close everything */ /* close everything */
NXclose(&pFile); NXclose(&pFile);
NXDclose(pDict,NULL); NXDclose(pDict,NULL);
return 0;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void FoUpdate(pFoWrite self, SConnection *pCon) static void FoUpdate(pFoWrite self, SConnection *pCon)

View File

@ -336,7 +336,7 @@
{ {
fSet = fVal; fSet = fVal;
iSet = (int)(fSet*self->fMult); iSet = (int)(fSet*self->fMult);
sprintf(pCommand,"T%05.5d\r\n",iSet); sprintf(pCommand,"T%5.5d\r\n",iSet);
} }
/* try three times: send, read, test, if OK return, else /* try three times: send, read, test, if OK return, else

View File

@ -8,9 +8,6 @@
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .o .SUFFIXES: .c .o
VPATH=$(SRC)
ROOT=../..
OBJ= el734_utility.o asynsrv_utility.o stredit.o \ OBJ= el734_utility.o asynsrv_utility.o stredit.o \
strjoin.o failinet.o geterrno.o el737_utility.o sinqhm.o serialsinq.o \ strjoin.o failinet.o geterrno.o el737_utility.o sinqhm.o serialsinq.o \
itc4util.o dillutil.o table.o el755_utility.o el755_errorlog.o \ itc4util.o dillutil.o table.o el755_utility.o el755_errorlog.o \

View File

@ -1,15 +1,6 @@
# Forwards the execution to a version specific makefile.
# SICS_VERSION must be defined, else usage is printed
# M. Zolliker 03.2005 # M. Zolliker 03.2005
VERS_UNDEFINED= default:
VERS_UNDEFINED$(SICS_VERSION)=version_undefined
INCL_MF=makefile_$(SICS_VERSION)
-include $(INCL_MF)
version_undefined:
@ echo "" @ echo ""
@ echo "Usage:" @ echo "Usage:"
@ echo "" @ echo ""
@ -18,17 +9,4 @@ version_undefined:
@ echo ' where makefile_xxx is one of' @ echo ' where makefile_xxx is one of'
@ echo "" @ echo ""
@ ls -1 makefile_* | pr -t -o 4 @ ls -1 makefile_* | pr -t -o 4
@ echo ""
@ echo "Or, more convenient, define the following in the login script"
@ echo ""
@ echo " setenv SICS_VERSION version_xxx (assume we are using tcsh)"
@ echo ""
@ echo " where version_xxx is one of"
@ echo ""
@ ls -1 makefile_* | cut -b 10-99 | pr -t -o 4
@ echo ""
@ echo "and then use simply"
@ echo ""
@ echo " make [target]"
@ echo ""

View File

@ -9,6 +9,6 @@
include ../../alpha_def include ../../alpha_def
CC = cc CC = cc
CFLAGS = -std1 -g $(DFORTIFY) -I$(SRC). CFLAGS = -std1 -g $(DFORTIFY) -I.
include make_gen include make_gen

View File

@ -6,9 +6,9 @@
# Markus Zolliker, March 2003 # Markus Zolliker, March 2003
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
include ../../$(SRC)linux_def include ../../linux_def
CC = gcc CC = gcc
CFLAGS = -g -DLINUX $(DFORTIFY) -I$(SRC). CFLAGS = -g -DLINUX $(DFORTIFY) -I. -Wall -Wno-unused
include $(SRC)make_gen include make_gen

View File

@ -194,7 +194,7 @@
case '\015': *pntr++ = '\\'; *pntr++ = 'r'; break; case '\015': *pntr++ = '\\'; *pntr++ = 'r'; break;
default: default:
if ((in < ' ') || (in > '~')) { if ((in < ' ') || (in > '~')) {
pntr += sprintf (pntr, "\\%03.3o", in); pntr += sprintf (pntr, "\\%3.3o", in);
}else { }else {
*pntr++ = in; *pntr++ = in;
} }

View File

@ -43,6 +43,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
@ -371,11 +372,11 @@
info_ptr->msg_id++; /* Set up an incrementing message id */ info_ptr->msg_id++; /* Set up an incrementing message id */
if (info_ptr->msg_id > 9999) info_ptr->msg_id = 1; if (info_ptr->msg_id > 9999) info_ptr->msg_id = 1;
sprintf (info_ptr->to_host.msg_id, "%04.4d", info_ptr->msg_id); sprintf (info_ptr->to_host.msg_id, "%4.4d", info_ptr->msg_id);
memcpy (info_ptr->to_host.c_pcol_lvl, RS__PROTOCOL_ID_V01B, memcpy (info_ptr->to_host.c_pcol_lvl, RS__PROTOCOL_ID_V01B,
sizeof (info_ptr->to_host.c_pcol_lvl)); sizeof (info_ptr->to_host.c_pcol_lvl));
sprintf (info_ptr->to_host.serial_port, "%04.4d", info_ptr->chan); sprintf (info_ptr->to_host.serial_port, "%4.4d", info_ptr->chan);
sprintf (info_ptr->to_host.tmo, "%04d", info_ptr->tmo); sprintf (info_ptr->to_host.tmo, "%04d", info_ptr->tmo);
strncpy(info_ptr->sAsync.eot,info_ptr->pTerms,4); strncpy(info_ptr->sAsync.eot,info_ptr->pTerms,4);
@ -407,20 +408,20 @@
{ {
c_len = strlen (txt_ptr); c_len = strlen (txt_ptr);
} }
sprintf (text, "%04.4d", c_len); sprintf (text, "%4.4d", c_len);
memcpy (cmnd_lst_ptr, text, 4); memcpy (cmnd_lst_ptr, text, 4);
cmnd_lst_ptr = cmnd_lst_ptr + c_len + 4; cmnd_lst_ptr = cmnd_lst_ptr + c_len + 4;
ncmnds++; ncmnds++;
bytes_left = bytes_left - size; bytes_left = bytes_left - size;
} }
sprintf (text, "%04.4d", ncmnds); sprintf (text, "%4.4d", ncmnds);
memcpy (info_ptr->to_host.n_cmnds, memcpy (info_ptr->to_host.n_cmnds,
text, sizeof (info_ptr->to_host.n_cmnds)); text, sizeof (info_ptr->to_host.n_cmnds));
size = cmnd_lst_ptr - info_ptr->to_host.msg_id; size = cmnd_lst_ptr - info_ptr->to_host.msg_id;
size = (size + 3) & (~3); /* Round up to multiple of 4 */ size = (size + 3) & (~3); /* Round up to multiple of 4 */
sprintf (text, "%04.4d", size); sprintf (text, "%4.4d", size);
memcpy (info_ptr->to_host.msg_size, text, 4); memcpy (info_ptr->to_host.msg_size, text, 4);
status = send (info_ptr->skt, (char *) &info_ptr->to_host, size+4, 0); status = send (info_ptr->skt, (char *) &info_ptr->to_host, size+4, 0);

View File

@ -10,6 +10,7 @@ Markus Zolliker, Sept 2004
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <sys/time.h> #include <sys/time.h>
#include <math.h>
#include <tcl.h> #include <tcl.h>
#include <fortify.h> #include <fortify.h>
#include <sics.h> #include <sics.h>

View File

@ -12,6 +12,7 @@ Markus Zolliker, Sept 2004
#include <assert.h> #include <assert.h>
#include <fortify.h> #include <fortify.h>
#include <errno.h> #include <errno.h>
#include "splitter.h"
#include "sics.h" #include "sics.h"
#include "logger.h" #include "logger.h"

View File

@ -6,9 +6,6 @@
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .o .f .SUFFIXES: .c .o .f
VPATH=$(SRC)
ROOT=..
OBJ=psi.o buffer.o ruli.o dmc.o nxsans.o nextrics.o sps.o pimotor.o \ OBJ=psi.o buffer.o ruli.o dmc.o nxsans.o nextrics.o sps.o pimotor.o \
pipiezo.o sanswave.o faverage.o fowrite.o amor2t.o nxamor.o \ pipiezo.o sanswave.o faverage.o fowrite.o amor2t.o nxamor.o \
amorstat.o tasinit.o tasdrive.o tasutil.o tasscan.o swmotor.o \ amorstat.o tasinit.o tasdrive.o tasutil.o tasscan.o swmotor.o \

View File

@ -1,15 +1,6 @@
# Forwards the execution to a version specific makefile.
# SICS_VERSION must be defined, else usage is printed
# M. Zolliker 03.2005 # M. Zolliker 03.2005
VERS_UNDEFINED= default:
VERS_UNDEFINED$(SICS_VERSION)=version_undefined
INCL_MF=makefile_$(SICS_VERSION)
-include $(INCL_MF)
version_undefined:
@ echo "" @ echo ""
@ echo "Usage:" @ echo "Usage:"
@ echo "" @ echo ""
@ -18,17 +9,4 @@ version_undefined:
@ echo ' where makefile_xxx is one of' @ echo ' where makefile_xxx is one of'
@ echo "" @ echo ""
@ ls -1 makefile_* | pr -t -o 4 @ ls -1 makefile_* | pr -t -o 4
@ echo ""
@ echo "Or, more convenient, define the following in the login script"
@ echo ""
@ echo " setenv SICS_VERSION version_xxx (assume we are using tcsh)"
@ echo ""
@ echo " where version_xxx is one of"
@ echo ""
@ ls -1 makefile_* | cut -b 10-99 | pr -t -o 4
@ echo ""
@ echo "and then use simply"
@ echo ""
@ echo " make [target]"
@ echo ""

View File

@ -7,7 +7,7 @@
include ../alpha_def include ../alpha_def
CC = cc CC = cc
CFLAGS = -std1 -g $(DFORTIFY) -I$(SRC).. -I$(HDFROOT)/include -DHDF5 \ CFLAGS = -std1 -g $(DFORTIFY) -I.. -I$(HDFROOT)/include -DHDF5 \
-I$(SRC)hardsup -Ihardsup
include make_gen include make_gen

View File

@ -6,13 +6,14 @@
# Markus Zolliker, March 2003 # Markus Zolliker, March 2003
#========================================================================== #==========================================================================
include ../$(SRC)linux_def include ../linux_def
CC = gcc CC = gcc
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -I$(SRC)hardsup \ CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -Ihardsup \
-I../$(SRC) -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) -I.. -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) \
-Wall -Wno-unused -Wno-comment -Wno-switch
EXTRA=nintf.o EXTRA=nintf.o
include $(SRC)make_gen include make_gen

View File

@ -119,7 +119,7 @@ void OiSet(Eve *eve, char *cmd, double val, int dig) {
if (eve->syntax == 0) { if (eve->syntax == 0) {
for (;dig>0;dig--) val=val*10; for (;dig>0;dig--) val=val*10;
snprintf(buf, sizeof(buf), "%s%05d", cmd, val); snprintf(buf, sizeof(buf), "%s%05d", cmd, (int)val);
} else { } else {
snprintf(buf, sizeof(buf), "%s%f", cmd, val); snprintf(buf, sizeof(buf), "%s%f", cmd, val);
} }

1
psi.c
View File

@ -113,6 +113,7 @@ static void RemovePsiCommands(SicsInterp *pSics){
MotorDriver *CreateEL734(SConnection *pCon, int argc, char *argv[]); MotorDriver *CreateEL734(SConnection *pCon, int argc, char *argv[]);
MotorDriver *CreateEL734DC(SConnection *pCon, int argc, char *argv[]); MotorDriver *CreateEL734DC(SConnection *pCon, int argc, char *argv[]);
MotorDriver *CreateEL734HP(SConnection *pCon, int argc, char *argv[]); MotorDriver *CreateEL734HP(SConnection *pCon, int argc, char *argv[]);
MotorDriver *MakePiPiezo(Tcl_Interp *pTcl,char *pArray);
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
static pMotor CreatePsiMotor(SConnection *pCon, int argc, char *argv[]){ static pMotor CreatePsiMotor(SConnection *pCon, int argc, char *argv[]){
MotorDriver *pDriver = NULL; MotorDriver *pDriver = NULL;

View File

@ -121,7 +121,7 @@ static int RemHandle(RemServer *remserver) {
for (remob = remserver->objList; remob != NULL; remob = remob->next) { for (remob = remserver->objList; remob != NULL; remob = remob->next) {
par=StartsWith(line, remob->name); par=StartsWith(line, remob->name);
if (par != NULL) { if (par != NULL) {
if (str = StartsWith(par, "finished")) { if ((str = StartsWith(par, "finished"))) {
if (*str == '\0') { if (*str == '\0') {
remob->status = HWIdle; remob->status = HWIdle;
} else { } else {
@ -130,7 +130,7 @@ static int RemHandle(RemServer *remserver) {
line[0]='\0'; line[0]='\0';
return 1; return 1;
} }
if (str = StartsWith(par, "started")) { if ((str = StartsWith(par, "started"))) {
remob->status = HWBusy; remob->status = HWBusy;
line[0]='\0'; line[0]='\0';
return 1; return 1;
@ -405,7 +405,7 @@ static long RemobRun(void *self, SConnection *pCon, float fNew) {
if (remserver->matchMap & 1) { /* already running, stop first */ if (remserver->matchMap & 1) { /* already running, stop first */
remob->status = HWBusy; remob->status = HWBusy;
snprintf(sBuf, sizeof(sBuf), "stopexe %s", remob->name, fNew); snprintf(sBuf, sizeof(sBuf), "stopexe %s", remob->name);
iRet = RemTransact(remserver, pCon, sBuf, ">", NULL); iRet = RemTransact(remserver, pCon, sBuf, ">", NULL);
if (iRet <= 0) return 0; if (iRet <= 0) return 0;
while (remob->status == HWBusy) { while (remob->status == HWBusy) {
@ -777,8 +777,9 @@ int RemobCreate(SConnection *pCon, SicsInterp *pSics, void *pData,
} }
return 1; return 1;
} }
snprintf(buf, sizeof(buf),"ERROR: illegal arguments for command remob",argv[1]); snprintf(buf, sizeof(buf),"ERROR: illegal arguments for command remob");
SCWrite(pCon,buf,eError); SCWrite(pCon,buf,eError);
return 0;
} }

1
ruli.c
View File

@ -257,7 +257,6 @@
{"list",0,{0,0}}, {"list",0,{0,0}},
{"run",0,{0,0}}, {"run",0,{0,0}},
{"batch",0,{0,0}}, {"batch",0,{0,0}},
NULL
}; };
assert(pCon); assert(pCon);

View File

@ -31,7 +31,7 @@ extern int getSRO(SConnection *pCon, float *fVal); /* tasutil.c */
As variables may be accessed in storage order, it is necessary to As variables may be accessed in storage order, it is necessary to
know the order of the motors know the order of the motors
*/ */
extern char *tasMotorOrder[] = { "a1", char *tasMotorOrder[] = { "a1",
"a2", "a2",
"a3", "a3",
"a4", "a4",
@ -70,7 +70,7 @@ extern char *tasMotorOrder[] = { "a1",
has to match the order defined in tas.h through the defines. Otherwise has to match the order defined in tas.h through the defines. Otherwise
quite weird things may happen at runtime. quite weird things may happen at runtime.
*/ */
extern char *tasVariableOrder[] = { char *tasVariableOrder[] = {
"wav", "wav",
"dm", "dm",
"da", "da",

View File

@ -552,7 +552,7 @@ static int TASScanPoint(pScanData self, int iPoint)
m3 = GetMonitor(self->pCounterData,3,self->pCon); m3 = GetMonitor(self->pCounterData,3,self->pCon);
cnts = GetCounts(self->pCounterData,self->pCon); cnts = GetCounts(self->pCounterData,self->pCon);
fVal = GetCountTime(self->pCounterData, self->pCon); fVal = GetCountTime(self->pCounterData, self->pCon);
sprintf(pWork,"%8d %8d %9.2f %8d %8d ",m1,m2,fVal, cnts, m3); sprintf(pWork,"%8ld %8ld %9.2f %8ld %8ld ",m1,m2,fVal, cnts, m3);
strcat(pBueffel,pWork); strcat(pBueffel,pWork);
/* /*
@ -1517,7 +1517,7 @@ int TASScan(SConnection *pCon, SicsInterp *pSics, void *pData,
SCWrite(pCon," ",eWarning); SCWrite(pCon," ",eWarning);
SCWrite(pCon," ",eWarning); SCWrite(pCon," ",eWarning);
sprintf(pLine, sprintf(pLine,
" %12s %6s HKLE: %6.2f%6.2f%6.2f%9.4f%7.3f%7.3f%7.3f", " %12s %6s HKLE: %5.2f %5.2f %5.2f %8.4f %6.3f %6.3f %6.3f %6.3f",
pTAS->tasPar[TIT]->text, pTAS->tasPar[TIT]->text,
pTAS->tasPar[USR]->text, pTAS->tasPar[USR]->text,
pTAS->tasPar[QH]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQH]->fVal, pTAS->tasPar[QH]->fVal - (pTAS->pScan->iNP/2)*pTAS->tasPar[DQH]->fVal,

View File

@ -96,7 +96,7 @@ isTASEnergy finds out if a variable is a TAS energy variable. This would
require a TAS calculation to take place. If the test is positive then the require a TAS calculation to take place. If the test is positive then the
index of the Variable is returned, else -1 is returned. index of the Variable is returned, else -1 is returned.
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
isTASEnergy(char *val) int isTASEnergy(char *val)
{ {
int iPtr; int iPtr;
@ -207,6 +207,7 @@ static int printError(int ier, SConnection *pCon)
return 0; return 0;
break; break;
default: default:
return 0;
break; break;
} }
} }

View File

@ -102,7 +102,6 @@ int CocInitClient(CocConn *conn, char *host, int port, char *magic, int bufsize,
int CocSendMagic(CocConn *conn, char *magic) { int CocSendMagic(CocConn *conn, char *magic) {
char *err; char *err;
int siz, n;
StrClear(&conn->resbuf); /* use return buffer for command in order to preserve command buffer */ StrClear(&conn->resbuf); /* use return buffer for command in order to preserve command buffer */
ERR_I(StrPut(&conn->resbuf, "", COC_MAGIC)); ERR_I(StrPut(&conn->resbuf, "", COC_MAGIC));
@ -133,8 +132,8 @@ int CocCheck(CocConn *conn) {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
int CocTryCmd(CocConn *conn) { int CocTryCmd(CocConn *conn) {
int iret=-1, siz; int iret=-1;
int j;
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
if (conn->fd<0) { if (conn->fd<0) {
ERR_I(iret=CocConnect(conn)); /* was CocOpen earlier */ ERR_I(iret=CocConnect(conn)); /* was CocOpen earlier */
@ -221,7 +220,6 @@ int CocPushArg(CocConn *conn, const char *name, void *value, int type, int size)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
int CocPutStr(CocConn *conn, const char *name, const char *value) { int CocPutStr(CocConn *conn, const char *name, const char *value) {
StrBuf *buf;
ERR_I(CocPushArg(conn, name, NULL, ARG_CHAR, 0)); ERR_I(CocPushArg(conn, name, NULL, ARG_CHAR, 0));
ERR_I(StrPut(&conn->cmdbuf, value, COC_SEP)); ERR_I(StrPut(&conn->cmdbuf, value, COC_SEP));
@ -378,7 +376,6 @@ static int interrupt, logFd=0;
void CocIntSignal(int sig) { void CocIntSignal(int sig) {
char buf[4]; char buf[4];
int siz;
if (logFd) { if (logFd) {
interrupt=2; interrupt=2;
@ -396,10 +393,10 @@ int CocWatchLog(CocConn *conn, char *loglist) {
char cbuf[1024]; char cbuf[1024];
StrBuf *buf; StrBuf *buf;
int fd, iret; int fd, iret;
int i, siz, n;
static int init=1;
#if __VMS #if __VMS
static int init=1;
if (init) { if (init) {
init=0; init=0;
DECC$CRTL_INIT(); DECC$CRTL_INIT();
@ -450,7 +447,6 @@ int CocShowLog(CocConn *conn, char *loglist, int start, int lines) {
char cbuf[1024]; char cbuf[1024];
StrBuf *buf; StrBuf *buf;
int fd, iret; int fd, iret;
int i, siz, n;
fd=conn->fd; fd=conn->fd;
CocReset(conn); CocReset(conn);
@ -517,7 +513,6 @@ int CocGetN(CocConn *conn, const char *name, char *value, int reslen) {
} }
int CocSetGetN(CocConn *conn, const char *name, const char *cmd, char *value, int reslen) { int CocSetGetN(CocConn *conn, const char *name, const char *cmd, char *value, int reslen) {
int iret;
assert(conn!=NULL); assert(conn!=NULL);
CocReset(conn); CocReset(conn);

View File

@ -110,7 +110,7 @@ void logfileStamp(char *text) {
} }
if (text==NULL) { if (text==NULL) {
if (stamp>lastStamp+1) { if (stamp>lastStamp+1) {
fprintf(fil, "---\t%02d:%02d:%02d\n", stamp / 60, stamp % 60, time % 60, text); fprintf(fil, "---\t%02d:%02d:%02d\n", stamp / 60, stamp % 60, time % 60);
} }
} else { } else {
fprintf(fil, "\t%02d:%02d:%02d%s", stamp / 60, stamp % 60, time % 60, text); fprintf(fil, "\t%02d:%02d:%02d%s", stamp / 60, stamp % 60, time % 60, text);
@ -196,7 +196,7 @@ void logfileWrite0(int mask) {
if (dirty) logfileStamp(NULL); /* there was something written since last time */ if (dirty) logfileStamp(NULL); /* there was something written since last time */
s=ebuf; s=ebuf;
if (writeAll || *s!='\0' && wrtMask & logMask) { if (writeAll || (*s!='\0' && (wrtMask & logMask))) {
next=strchr(s, '\1'); next=strchr(s, '\1');
while (next!=NULL) { while (next!=NULL) {
*next='\0'; *next='\0';

View File

@ -142,8 +142,6 @@ void *CocChrPtr(char *ptr) { return(ptr); }
void *CocDefVar(const char *name, void *var, int type, int size, int access) { void *CocDefVar(const char *name, void *var, int type, int size, int access) {
CocVar *p; CocVar *p;
const char *f;
void *adr;
assert(varListHandle!=NULL); assert(varListHandle!=NULL);
p=CocFindVar1(name); p=CocFindVar1(name);
@ -177,7 +175,7 @@ int *CocSizePtr(void) {
} }
void CocDefVarS(const char *name, const char *tname, void *var, int type) { void CocDefVarS(const char *name, const char *tname, void *var, int type) {
CocVar *p, *t; CocVar *p;
assert(type==COC_PTR || type==COC_STRUCT); assert(type==COC_PTR || type==COC_STRUCT);
p=CocDefVar(name, var, type, 0, COC_RDONLY); p=CocDefVar(name, var, type, 0, COC_RDONLY);
@ -188,7 +186,6 @@ char err_name[64];
int CocGetThisVar(CocVar *var, void *base, StrBuf *buf, int separator) { int CocGetThisVar(CocVar *var, void *base, StrBuf *buf, int separator) {
void *adr; void *adr;
int iret;
if (base==NULL) { if (base==NULL) {
adr=var->var; adr=var->var;
@ -215,7 +212,6 @@ int CocGetThisVar(CocVar *var, void *base, StrBuf *buf, int separator) {
int CocPutThisVar(CocVar *var, void *base, StrBuf *buf, int separator) { int CocPutThisVar(CocVar *var, void *base, StrBuf *buf, int separator) {
void *adr; void *adr;
int iret;
if (base==NULL) { if (base==NULL) {
adr=var->var; adr=var->var;
@ -333,7 +329,6 @@ void CocToClients(int mask, char *str) {
int CocInitServer(void *(*setDataRtn)(void *), int port) { int CocInitServer(void *(*setDataRtn)(void *), int port) {
int i; int i;
struct sockaddr_in sadr; struct sockaddr_in sadr;
char *err;
setData=setDataRtn; setData=setDataRtn;
/* /*
@ -494,9 +489,9 @@ int CocHandle1Request(int tmo_msec, int fd) {
struct timeval tmo={0,1}; struct timeval tmo={0,1};
CocClient *cl, *cl0; CocClient *cl, *cl0;
CocVar *var; CocVar *var;
int i, lmask, newfd, n, iret; int i, lmask, newfd, iret;
socklen_type cadrlen; socklen_type cadrlen;
char *err, *cmd, *arg, *varname; char *err, *varname;
void *base; void *base;
rmask=mask; rmask=mask;

View File

@ -59,8 +59,8 @@ void CocDefVarS(const char *name, const char *tname, void *var, int type);
#define CocDefFlt(V,A) CocDefVar(#V,CocFltPtr(&V),COC_FLT,0,A) #define CocDefFlt(V,A) CocDefVar(#V,CocFltPtr(&V),COC_FLT,0,A)
#define CocDefStr(V,A) CocDefVar(#V,CocChrPtr(V),COC_CHAR,sizeof(V),A) #define CocDefStr(V,A) CocDefVar(#V,CocChrPtr(V),COC_CHAR,sizeof(V),A)
#define CocDefArr(V,A) CocDefVar(#V,CocFltPtr(V),COC_ARRAY,sizeof(V)/sizeof(float),A) #define CocDefArr(V,A) CocDefVar(#V,CocFltPtr(V),COC_ARRAY,sizeof(V)/sizeof(float),A)
#define CocDefPtr(V,S) CocDefVarS(#V,#S,&V,(V!=(S *)NULL,0,COC_PTR)); #define CocDefPtr(V,S) CocDefVarS(#V,#S,&V,((V!=(S *)NULL)*COC_PTR));
#define CocDefStruct(V,S) CocDefVarS(#V,#S,&V,(&V!=(S *)NULL,0,COC_STRUCT)); #define CocDefStruct(V,S) CocDefVarS(#V,#S,&V,((&V!=(S *)NULL)*COC_STRUCT));
#define CocIntFld(S,V,A) CocDefVar(#S":"#V,CocIntPtr(&((S *)NULL)->V),COC_INT,0,A); #define CocIntFld(S,V,A) CocDefVar(#S":"#V,CocIntPtr(&((S *)NULL)->V),COC_INT,0,A);
#define CocFltFld(S,V,A) CocDefVar(#S":"#V,CocFltPtr(&((S *)NULL)->V),COC_FLT,0,A); #define CocFltFld(S,V,A) CocDefVar(#S":"#V,CocFltPtr(&((S *)NULL)->V),COC_FLT,0,A);
#define CocStrFld(S,V,A) CocDefVar(#S":"#V,CocChrPtr(((S *)NULL)->V),COC_CHAR,sizeof(((S *)NULL)->V),A); #define CocStrFld(S,V,A) CocDefVar(#S":"#V,CocChrPtr(((S *)NULL)->V),COC_CHAR,sizeof(((S *)NULL)->V),A);

View File

@ -4,13 +4,13 @@ set what="$1"
set where="$2" set where="$2"
set destlist=( type@osf1 \ set destlist=( type@osf1 \
AMOR@amor:tecs/ FOCUS@focus:tecs/ TRICS@trics:tecs/ \ amor@amor:tecs/ focus@focus:tecs/ trics@trics:tecs/ \
alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \ alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \
type@linux \ type@linux \
slinux=/afs/psi.ch/project/sinq/sl-linux/stow/tecs/bin/ \ slinux=/afs/psi.ch/project/sinq/sl-linux/stow/tecs/bin/ \
linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \ linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \
TASP@tasp:tecs/ dmc@dmc:tecs/ HRPT@hrpt:tecs/ \ tasp@tasp:tecs/ dmc@dmc:tecs/ hrpt@hrpt:tecs/ \
MORPHEUS@morpheus:tecs/ SANS@sans:tecs/ SANS2@sans2:tecs/ \ morpheus@morpheus:tecs/ sans@sans:tecs/ sans2@sans2:tecs/ \
type@darwin \ type@darwin \
macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \ macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \
) )
@ -43,7 +43,7 @@ foreach dest ($destlist)
endif endif
end end
set items=(TecsServer TecsClient six keep_running) set items=(TecsServer TecsClient six)
echo "" echo ""
echo " all $items" echo " all $items"
@ -71,14 +71,14 @@ if ($this == $0) then
endif endif
cd $this cd $this
set obj=../../obj/$SICS_VERSION/psi/tecs #set obj=../../obj/$SICS_VERSION/psi/tecs
foreach dest ($where) foreach dest ($where)
alias get 'set d=$'"d_$dest;"'set t=$'"t_$dest" alias get 'set d=$'"d_$dest;"'set t=$'"t_$dest"
get get
foreach item ($what) foreach item ($what)
if ("$t" == "$OSTYPE") then if ("$t" == "$OSTYPE") then
echo $item to $d echo $item to $d
rsync -e ssh -vt $obj/$item $d rsync -e ssh -vt $item $d
endif endif
end end
end end

View File

@ -11,7 +11,7 @@ int main(int argc, char *argv[]) {
int cnt, dif; int cnt, dif;
time_t tim1, tim2; time_t tim1, tim2;
pid_t pid; pid_t pid;
int status, i; int status;
if (argc<2) return 0; if (argc<2) return 0;
cnt = MAX_CNT; cnt = MAX_CNT;

View File

@ -1,7 +1,7 @@
#DFORTIFY= -DFORTIFY -I$(ROOT)/$(SRC) #DFORTIFY= -DFORTIFY
#FORTIFYOBJ= fortify.o strdup.o #FORTIFYOBJ= fortify.o strdup.o
MFLAGS=-f $(SRC)makefile_macosx$(DUMMY) SRC=$(SRC) MFLAGS=-f makefile_macosx$(DUMMY)
#HDFROOT= #HDFROOT=

View File

@ -1,24 +1,24 @@
#!/bin/tcsh #!/bin/tcsh
set src=${1:h} set src=${1:h}
set files=($src/*.inp) set files=($src/*.inp)
echo " " >! src/make_crv echo " " >! make_crv
set cfg="" set cfg=""
foreach file ($files) foreach file ($files)
set sens=${file:t:s/.inp//} set sens=${file:t:s/.inp//}
echo '$(CFGDIR)'"$sens.crv: ccrv "'$(SRC)'"inp/$sens.inp" >> src/make_crv echo '$(CFGDIR)'"$sens.crv: ccrv inp/$sens.inp" >> make_crv
echo ' $Q -p$(CFGDIR)' >> src/make_crv echo ' $Q -p$(CFGDIR)' >> make_crv
echo '' >> src/make_crv echo '' >> make_crv
end end
echo "all_crv: dev.list \" >> src/make_crv echo "all_crv: dev.list \" >> make_crv
foreach file ($files) foreach file ($files)
set sens=${file:t:s/.inp//} set sens=${file:t:s/.inp//}
echo ' $(CFGDIR)'"$sens.crv \" >> src/make_crv echo ' $(CFGDIR)'"$sens.crv \" >> make_crv
end end
echo '' >> src/make_crv echo '' >> make_crv
echo "ALLINP= \" >> src/make_crv echo "ALLINP= \" >> make_crv
foreach file ($files) foreach file ($files)
set sens=${file:t:s/.inp//} set sens=${file:t:s/.inp//}
echo ' $(SRC)'"inp/$sens.inp \" >> src/make_crv echo "inp/$sens.inp \" >> make_crv
end end
echo '' >> src/make_crv echo '' >> make_crv

View File

@ -8,9 +8,6 @@
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .o .c .f .SUFFIXES: .o .c .f
VPATH=$(SRC):$(ROOT)/$(SRC)
ROOT=../..
LIBR_OBJ =coc_util.o myc_err.o myc_str.o myc_buf.o myc_time.o LIBR_OBJ =coc_util.o myc_err.o myc_str.o myc_buf.o myc_time.o
SERV_OBJ =tecs.o coc_server.o tecs_lsc.o tecs_serial.o coc_logfile.o \ SERV_OBJ =tecs.o coc_server.o tecs_lsc.o tecs_serial.o coc_logfile.o \
tecs_data.o $(LIBR_OBJ) tecs_data.o $(LIBR_OBJ)
@ -35,11 +32,11 @@ CFGDIR=/afs/psi.ch/project/sinq/common/lib/tecs/cfg/
#-include make_crv #-include make_crv
$(SRC)make_crv: make_crv.tcsh inp/lsc.codes $(ALLINP) make_crv: make_crv.tcsh inp/lsc.codes $(ALLINP)
$(SRC)make_crv.tcsh $(SRC)inp/lsc.codes make_crv.tcsh inp/lsc.codes
dev.list: dev.list:
$(SRC)make_list.tcsh $(CFGDIR)*.cfg > $@ make_list.tcsh $(CFGDIR)*.cfg > $@
cp $@ $(CFGDIR) cp $@ $(CFGDIR)
# use target all_crv to make all curves in inp directory # use target all_crv to make all curves in inp directory
@ -66,7 +63,7 @@ ccrv: conv.f sys_cmdpar.o str.o cvt.o
# -- needs special include # -- needs special include
tecs_serial.o: tecs_serial.c tecs_serial.o: tecs_serial.c
$(CC) $(CFLAGS) -I$(ROOT)/psi/hardsup/$(SRC) -c $Q $(CC) $(CFLAGS) -I../hardsup -c $Q
keep_running: keep_running.c keep_running: keep_running.c
$(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ) $(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ)
@ -78,5 +75,8 @@ rexstart: rstart.c myc_str.o myc_err.o instr_hosts.o
$(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ) $(CC) $(CFLAGS) -o $@ $Q $(FORTIFYOBJ)
@ echo "$(PWD)/rstart" @ echo "$(PWD)/rstart"
pg_plus/libpgplus.a:
cd pg_plus; make $(MFLAGS)
clean: clean:
rm -f *.o *.a six keep_running TecsServer TecsClient rm -f *.o *.a six keep_running TecsServer TecsClient

View File

@ -1,15 +1,6 @@
# Forwards the execution to a version specific makefile.
# SICS_VERSION must be defined, else usage is printed
# M. Zolliker 03.2005 # M. Zolliker 03.2005
VERS_UNDEFINED= default:
VERS_UNDEFINED$(SICS_VERSION)=version_undefined
INCL_MF=makefile_$(SICS_VERSION)
-include $(INCL_MF)
version_undefined:
@ echo "" @ echo ""
@ echo "Usage:" @ echo "Usage:"
@ echo "" @ echo ""
@ -18,17 +9,4 @@ version_undefined:
@ echo ' where makefile_xxx is one of' @ echo ' where makefile_xxx is one of'
@ echo "" @ echo ""
@ ls -1 makefile_* | pr -t -o 4 @ ls -1 makefile_* | pr -t -o 4
@ echo ""
@ echo "Or, more convenient, define the following in the login script"
@ echo ""
@ echo " setenv SICS_VERSION version_xxx (assume we are using tcsh)"
@ echo ""
@ echo " where version_xxx is one of"
@ echo ""
@ ls -1 makefile_* | cut -b 10-99 | pr -t -o 4
@ echo ""
@ echo "and then use simply"
@ echo ""
@ echo " make [target]"
@ echo ""

View File

@ -5,14 +5,13 @@
# Markus Zolliker, March 2003 # Markus Zolliker, March 2003
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
include $(SRC)../../linux_def include ../../linux_def
SICST=.. SICS=..
SICS=$(SRC)..
CC = gcc CC = gcc
FC = g77 FC = g77
CFLAGS = -DLINUX -g $(DFORTIFY) -I../.. CFLAGS = -DLINUX -g $(DFORTIFY) -I../.. -I. -Wall -Wno-missing-braces
FFLAGS = -Wimplicit -g FFLAGS = -Wimplicit -g
ARFLAGS = cr ARFLAGS = cr
@ -38,4 +37,4 @@ Q=$^
F=$< F=$<
C=$< C=$<
include $(SRC)make_gen include make_gen

View File

@ -5,7 +5,7 @@
# Markus Zolliker, March 2003 # Markus Zolliker, March 2003
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
include $(SRC)macosx_def include macosx_def
CC = gcc CC = gcc
FC = g77 FC = g77
@ -20,7 +20,7 @@ PGLIB = -L/usr/X11R6/lib -lX11 -L/sw/lib -lpng \
-Wl,-framework -Wl,Foundation -Wl,-framework -Wl,AppKit -lcc_dynamic -Wl,-framework -Wl,Foundation -Wl,-framework -Wl,AppKit -lcc_dynamic
# -- library for ASYNSRV # -- library for ASYNSRV
HARDSUPLIB=$(SICST)/hardsup/libhlib.a HARDSUPLIB=../hardsup/libhlib.a
# -- readline library # -- readline library
RDLIB =-lreadline RDLIB =-lreadline
@ -36,4 +36,4 @@ Q=$^
F=$< F=$<
C=$< C=$<
include $(SRC)make_gen include make_gen

View File

@ -10,7 +10,7 @@
char *StrNGet(StrBuf *buf, char *result, int reslen, int sep) { char *StrNGet(StrBuf *buf, char *result, int reslen, int sep) {
char *b, *f, *e, quote; char *b, *f, *e, quote;
int res, l, ll; int l;
if (buf->rdpos < 0 || buf->rdpos >= buf->dsize || buf->buf==NULL) if (buf->rdpos < 0 || buf->rdpos >= buf->dsize || buf->buf==NULL)
ERR_MSG("buffer corrupt"); ERR_MSG("buffer corrupt");
@ -190,7 +190,6 @@ int StrPutInt(StrBuf *buf, int val, int sep) {
int StrPutFloat(StrBuf *buf, float val, int sep) { int StrPutFloat(StrBuf *buf, float val, int sep) {
char num[32]; char num[32];
int l;
if (val == MYC_NAN) { if (val == MYC_NAN) {
ERR_I(StrPut(buf, "NaN", sep)); ERR_I(StrPut(buf, "NaN", sep));

View File

@ -67,7 +67,7 @@ int mycDate(int time) {
int mycTime(int date) { int mycTime(int date) {
struct tm tim; struct tm tim;
time_t t, now; time_t now;
int y, m, d; int y, m, d;
if (my_base == 0) initBase(); if (my_base == 0) initBase();

View File

@ -94,7 +94,7 @@ int CocCreateSockAdr(
char* readWrite(int fd, int tmo, int skip, char *find) { char* readWrite(int fd, int tmo, int skip, char *find) {
char msg[256]; char msg[256];
int l, lbuf, pos, i, go, iret, n, ga; int lbuf, pos, go, iret, n, ga;
char *p, chr; char *p, chr;
static char result[256]; static char result[256];
int match; int match;
@ -197,7 +197,7 @@ int sendCmd(int fd, char *cmd) {
} }
int scramble(char *buf) { int scramble(char *buf) {
int i, n, cnt, chr, new; int i, n, cnt, chr;
int x; int x;
/* Scrambles a string. Twice scramble gives original. /* Scrambles a string. Twice scramble gives original.
It does never convert a plain char to a ctrl char It does never convert a plain char to a ctrl char
@ -217,12 +217,12 @@ int scramble(char *buf) {
return cnt; return cnt;
} }
getscrambled(char *buf, int size, FILE *fil) { void getscrambled(char *buf, int size, FILE *fil) {
term_fgets(buf, size, fil); term_fgets(buf, size, fil);
if (scramble(buf) > 0) scramble(buf); if (scramble(buf) > 0) scramble(buf);
} }
putscrambled(char *buf, FILE *fil) { void putscrambled(char *buf, FILE *fil) {
char cvt[256]; char cvt[256];
str_copy(cvt, buf); str_copy(cvt, buf);
scramble(cvt); scramble(cvt);
@ -394,7 +394,7 @@ int setrights(int gotolevel) {
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
int iret, pos; int iret, pos;
fd_set mask; fd_set mask;
int l, i, j, port, skip, gotolevel, sicslogin; int i, j, port, skip, gotolevel, sicslogin;
int savehist = 0; int savehist = 0;
char buf[128], lbuf[16], ilow[64]; char buf[128], lbuf[16], ilow[64];
char stdPrompt[128], prompt[256]; char stdPrompt[128], prompt[256];

View File

@ -5,7 +5,7 @@
static int lastFd=-1; static int lastFd=-1;
static struct termios atts; static struct termios atts;
static echo=1; static int echo=1;
void sys_keys_on(void) { void sys_keys_on(void) {
int iret; int iret;
@ -35,7 +35,7 @@ void sys_keys_off(void) {
} }
int sys_select_or_key(fd_set *mask, int msecTmo, char *key) { int sys_select_or_key(fd_set *mask, int msecTmo, char *key) {
int chan, fd, iret, fd1, m, chr; int fd, iret, fd1, chr;
struct timeval tmo, tmo0={0,0}; struct timeval tmo, tmo0={0,0};
fd_set rmask; fd_set rmask;

View File

@ -147,7 +147,6 @@ static int
maxfld, /* last used display field */ maxfld, /* last used display field */
busy, /* busy after CRVSAV */ busy, /* busy after CRVSAV */
relay, relay0, /* relay status */ relay, relay0, /* relay status */
deviceFlag, /* device given via net */
num, /* curve number */ num, /* curve number */
key, /* key status */ key, /* key status */
serialNo=340000, /* initialize with a valid, but not existing value */ serialNo=340000, /* initialize with a valid, but not existing value */
@ -284,9 +283,8 @@ int InstalCurve(SensorT *sensor, char *devArg) {
char *crv, *entry, *points, *start, char *crv, *entry, *points, *start,
*s, /* start of found entry */ *s, /* start of found entry */
*e, /* cache part after found entry */ *e, /* cache part after found entry */
*res, *t; *t;
int i, n, c1, c2; int i, n;
char ch;
char used[60]; char used[60];
FILE *fil; FILE *fil;
@ -690,7 +688,7 @@ again:
s->typ=typ; s->typ=typ;
s->band=10; s->band=10;
if (s->scale==0.0) s->scale=1.0; if (s->scale==0.0) s->scale=1.0;
if (s->alarm==0.0 && typ=='m' || typ=='s') { if ((s->alarm==0.0 && typ=='m') || typ=='s') {
s->alarm=tLimit; s->alarm=tLimit;
s->customAlarm=0; s->customAlarm=0;
} else { } else {
@ -1017,7 +1015,7 @@ int ReadTemp(void) {
} }
stat=(s->stat1 & s->stat2) & (255-3); /* ignore "old reading" and "invalid reading", error must be on min & max */ stat=(s->stat1 & s->stat2) & (255-3); /* ignore "old reading" and "invalid reading", error must be on min & max */
if (stat > s->readStat || stat==0 && s->readStat>0) { if (stat > s->readStat || (stat==0 && s->readStat>0)) {
err=LscReadStat(stat); err=LscReadStat(stat);
if (*err=='\0') { if (*err=='\0') {
logfileOut(LOG_MAIN, "reading o.k. %s\n", s->ch); logfileOut(LOG_MAIN, "reading o.k. %s\n", s->ch);
@ -1302,8 +1300,8 @@ int SetTemp(int switchOn) {
} }
void CalcMaxPower(void) { void CalcMaxPower(void) {
int i, j, vmax; int i, j;
float pa, pr, pw, quo, p, pl, plim, h; float pa, pr, pw, quo, p, plim, h;
iAmp=1; iRange=0; iAmp=1; iRange=0;
maxCurrent=0; maxCurrent=0;
@ -1346,7 +1344,6 @@ void CalcMaxPower(void) {
int PutFloat(StrBuf *buf, int prec, float f) { int PutFloat(StrBuf *buf, int prec, float f) {
char num[32], fmt[32]; char num[32], fmt[32];
int l;
if (f == DATA_UNDEF) { if (f == DATA_UNDEF) {
return StrPut(buf, "NaN", StrNONE); return StrPut(buf, "NaN", StrNONE);
@ -1393,7 +1390,7 @@ int PidSumHdl(int mode, void *base, int fd) {
int SetMaxPower(void) { int SetMaxPower(void) {
/* static float p0; */ /* static float p0; */
static float lastCurrent, limCurrent, pold; static float lastCurrent, limCurrent, pold;
float plim; /* float plim; */
if (loop == 1) { if (loop == 1) {
if (initMaxPower) { if (initMaxPower) {
@ -1719,7 +1716,7 @@ int ConfigByCode(int plugNr) {
while (p!=NULL && plug->code != c1 && plug->code != c2) { while (p!=NULL && plug->code != c1 && plug->code != c2) {
if (*p != '#') { if (*p != '#') {
c1=0; c2=0; c1=0; c2=0;
sscanf(buf, "%15s %d %d", &nam, &c1, &c2); sscanf(buf, "%15s %d %d", nam, &c1, &c2);
} }
p=fgets(buf, sizeof(buf), fil); p=fgets(buf, sizeof(buf), fil);
} }
@ -1764,8 +1761,8 @@ int PeriodicTask(void) {
static int lastIntTim; static int lastIntTim;
char buf[256], lbuf[16]; char buf[256], lbuf[16];
char *next, *alms; char *next, *alms;
int i, k, iret, cnt; int i, k, cnt;
float t3[3], p, d, w, t, dif, htr0, mstep, fdif; float p, d, w, t, dif, htr0, mstep, fdif;
if (nScan==0) { if (nScan==0) {
ERR_P(LscCmd(ser, "DIOST?>cod1,out1;DOUT 3,29;BUSY?>busy")); ERR_P(LscCmd(ser, "DIOST?>cod1,out1;DOUT 3,29;BUSY?>busy"));
@ -1773,7 +1770,7 @@ int PeriodicTask(void) {
cod1=0; cod1=0;
ERR_P(LscCmd(ser, "BUSY?>busy")); ERR_P(LscCmd(ser, "BUSY?>busy"));
} }
if (plug0.codDefined && plug1.codDefined || nScan>0) { if ((plug0.codDefined && plug1.codDefined) || nScan>0) {
per=period; /* no timeout on above command and codes are defined: normal period */ per=period; /* no timeout on above command and codes are defined: normal period */
if (per>logPeriod*1000) per=logPeriod*1000; if (per>logPeriod*1000) per=logPeriod*1000;
} }
@ -1976,8 +1973,8 @@ int PeriodicTask(void) {
} }
fdif=FakeScale(ctlSens, tr)-t; fdif=FakeScale(ctlSens, tr)-t;
fbuf=htr-mout-prop/6*fdif; /* value of integrator (assume deriv=0) */ fbuf=htr-mout-prop/6*fdif; /* value of integrator (assume deriv=0) */
if (fbuf > 99.8 && mout < 0 && fdif > 0 || if ((fbuf > 99.8 && mout < 0 && fdif > 0) ||
fbuf < 0.2 && mout > 0 && fdif < 0) { /* probably integrator overflow */ (fbuf < 0.2 && mout > 0 && fdif < 0)) { /* probably integrator overflow */
if (lastIntTim > 0) { if (lastIntTim > 0) {
mout += fdif*prop*integ/3000*(rdTim-lastIntTim); /* use mout for integral */ mout += fdif*prop*integ/3000*(rdTim-lastIntTim); /* use mout for integral */
if (mout < -100) mout=-100; if (mout < -100) mout=-100;
@ -2105,7 +2102,7 @@ int PeriodicTask(void) {
} }
int DeviceHdl(int mode, void *base, int fd) { int DeviceHdl(int mode, void *base, int fd) {
char *t, *res; char *t;
int do0, do1; int do0, do1;
if (mode==COC_WR) { if (mode==COC_WR) {
@ -2212,7 +2209,7 @@ int SwapHdl(int mode, void *base, int fd) {
} }
int SetPower(float setpower) { int SetPower(float setpower) {
float htr1, htr0, diff, dist; float htr1, htr0;
int cnt; int cnt;
logfileOut(LOG_MAIN,"SetPower\n"); logfileOut(LOG_MAIN,"SetPower\n");
@ -2401,7 +2398,6 @@ int LogHdl(int mode, void *base, int fd) {
data->logpos=logfileGetLines(data->logpos, 25, data->logline, sizeof(data->logline)); data->logpos=logfileGetLines(data->logpos, 25, data->logline, sizeof(data->logline));
} }
return 0; return 0;
OnError: return -1;
} }
int PltHdl(int mode, void *base, int fd) { int PltHdl(int mode, void *base, int fd) {
@ -2413,8 +2409,7 @@ int PltHdl(int mode, void *base, int fd) {
} }
int GraHdl(int mode, void *base, int fd) { int GraHdl(int mode, void *base, int fd) {
ClientData *data; int l;
int l, i;
char names[64]; char names[64];
long startTime, endTime, step; long startTime, endTime, step;
@ -2466,10 +2461,9 @@ int ShowSensor(StrBuf *buf, SensorT *s, char *name, char *units, char lim) {
} }
int StatusHdl(int mode, void *base, int fd) { int StatusHdl(int mode, void *base, int fd) {
int i, stat, typ; int i;
StrBuf buf; StrBuf buf;
float tM, tS; float tM, tS;
SensorT *s;
char pendAct[256]; char pendAct[256];
char *p; char *p;
@ -2654,7 +2648,6 @@ int UpdateHdl(int mode, void *base, int fd) {
} }
} }
return 0; return 0;
OnError: return -1;
} }
int RemoteHdl(int mode, void *base, int fd) { int RemoteHdl(int mode, void *base, int fd) {
@ -2726,7 +2719,7 @@ int ExecuteRequest(void) {
} }
int MainBody(void) { int MainBody(void) {
int i, iret, tdif; int iret, tdif;
logfileWrite(logMask); logfileWrite(logMask);

View File

@ -163,7 +163,6 @@ static pTecsClient conn=NULL;
int F_FUN(tecs_set_par)(F_CHAR(name), F_CHAR(par), int *show, int name_len, int par_len) { int F_FUN(tecs_set_par)(F_CHAR(name), F_CHAR(par), int *show, int name_len, int par_len) {
char nbuf[64], pbuf[COC_CMD_LEN]; char nbuf[64], pbuf[COC_CMD_LEN];
int iret=-1;
STR_TO_C(nbuf, name); STR_TO_C(nbuf, name);
STR_TO_C(pbuf, par); STR_TO_C(pbuf, par);
@ -180,7 +179,6 @@ int F_FUN(tecs_set_par)(F_CHAR(name), F_CHAR(par), int *show, int name_len, int
int F_FUN(tecs_get_par)(F_CHAR(name), F_CHAR(par), int *show, int name_len, int par_len) { int F_FUN(tecs_get_par)(F_CHAR(name), F_CHAR(par), int *show, int name_len, int par_len) {
char *b, nbuf[64], pbuf[COC_RES_LEN]; char *b, nbuf[64], pbuf[COC_RES_LEN];
int iret=-1;
STR_TO_C(nbuf, name); STR_TO_C(nbuf, name);
CocReset(conn); CocReset(conn);
@ -204,7 +202,7 @@ int F_FUN(tecs_get_par)(F_CHAR(name), F_CHAR(par), int *show, int name_len, int
} }
int F_FUN(tecs_get_mult)(F_CHAR(names), int *time, int *nvalues, float values[], int names_len) { int F_FUN(tecs_get_mult)(F_CHAR(names), int *time, int *nvalues, float values[], int names_len) {
char *b, nbuf[64], pbuf[COC_RES_LEN]; char nbuf[64];
char *nams, nam[32]; char *nams, nam[32];
int i; int i;

View File

@ -201,7 +201,7 @@ Run *InsertRun(Set *s, int time) {
int Put(Set *set, int time, float value) { int Put(Set *set, int time, float value) {
Run *r; Run *r;
int t, try = 1; int t;
int size; int size;
float last; float last;
static int errcnt=0; static int errcnt=0;
@ -325,7 +325,7 @@ void FreeBase(Base *base) {
int GetSet(Set *s, int startTime, int endTime, int size, float *data) { int GetSet(Set *s, int startTime, int endTime, int size, float *data) {
Run *r; Run *r;
int t, tlim, tmin; int t, tlim;
float d; float d;
int i, idx; int i, idx;
Summary sum; Summary sum;
@ -429,9 +429,8 @@ void Scan(void *sData, char *line) {
} }
void Load(Base *base, int from, int to, int stdStep) { void Load(Base *base, int from, int to, int stdStep) {
Set *set;
ScanData scanData; ScanData scanData;
int t, date; int t;
scanData.base = base; scanData.base = base;
scanData.stdStep = stdStep; scanData.stdStep = stdStep;

View File

@ -14,7 +14,7 @@
int LscEqPar(char *par, char *res) { int LscEqPar(char *par, char *res) {
char *p, *r, pbuf[SER_BUF_LEN], rbuf[SER_BUF_LEN]; char *p, *r, pbuf[SER_BUF_LEN], rbuf[SER_BUF_LEN];
int i,n,i1,i2; int i1,i2;
float f1, f2; float f1, f2;
p=par; p=par;
@ -42,7 +42,6 @@ int LscEqPar(char *par, char *res) {
#define nLIST 30 #define nLIST 30
char *LscCmd(SerChannel *ser, const char *cmds) { char *LscCmd(SerChannel *ser, const char *cmds) {
va_list ap;
char *blank, *colon, *qu, *res; char *blank, *colon, *qu, *res;
const char *p, *this, *next, *cmd_ptr, *retreq; const char *p, *this, *next, *cmd_ptr, *retreq;
const char *list[nLIST]; const char *list[nLIST];
@ -50,7 +49,7 @@ char *LscCmd(SerChannel *ser, const char *cmds) {
char cmd[SER_BUF_LEN]; char cmd[SER_BUF_LEN];
char varname[32]; char varname[32];
DeclStrBuf(sbuf, SER_BUF_LEN); DeclStrBuf(sbuf, SER_BUF_LEN);
int nres, i, j, response; int nres, i, response;
nres=0; nres=0;
response=0; response=0;

View File

@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include "rs232c_def.h" #include "rs232c_def.h"
#include "asynsrv_def.h" #include "asynsrv_def.h"
@ -160,7 +161,7 @@ char *SerCmd(SerChannel *serch, char *cmnd) {
int l, n; int l, n;
AsynSrvChan *aser; AsynSrvChan *aser;
TermSrvChan *tser; TermSrvChan *tser;
char *result, *pos, *trm; char *result, *pos;
char junk[256]; char junk[256];
int iret, incomplete; int iret, incomplete;

View File

@ -25,7 +25,6 @@
static char esc_key='\0'; static char esc_key='\0';
static fd_set regMask; static fd_set regMask;
static int lastFd=-1;
void term_reg_socket(int fd) { void term_reg_socket(int fd) {
FD_SET(fd, &regMask); FD_SET(fd, &regMask);
@ -151,7 +150,6 @@ static char filehead[256]="";
FILE *term_open_pref(char *head, char *mode) { FILE *term_open_pref(char *head, char *mode) {
char buf[PATH_MAX], hom[PATH_MAX]; char buf[PATH_MAX], hom[PATH_MAX];
char *cret, *home, usr[256]; char *cret, *home, usr[256];
int i;
cret=getenv("USER"); cret=getenv("USER");
if (cret == NULL || *cret == '\0') return NULL; if (cret == NULL || *cret == '\0') return NULL;
@ -265,7 +263,7 @@ void term_off(void) {
int term_get_line(char *buf, int size, int *pos, char *prompt, fd_set *mask) { int term_get_line(char *buf, int size, int *pos, char *prompt, fd_set *mask) {
char key, *lin; char key, *lin;
int i,j,l,iret,buflen; int i,l,iret,buflen;
char tmp[512]; char tmp[512];
static char back[128]=""; static char back[128]="";
@ -320,7 +318,7 @@ int term_get_line(char *buf, int size, int *pos, char *prompt, fd_set *mask) {
if (history[hist_end]!=NULL) { if (history[hist_end]!=NULL) {
FREE(history[hist_end]); /* clear line at end of history */ FREE(history[hist_end]); /* clear line at end of history */
} }
history[hist_end]==NULL; history[hist_end] = NULL;
} }
hist_pos=hist_end; hist_pos=hist_end;
term_save_hist(0); term_save_hist(0);

View File

@ -198,6 +198,8 @@ int TricsSupportAction(SConnection *pCon, SicsInterp *pSics, void *pData,
InvokeCallBack(self->pCall, NEWFRAME,&iFrame); InvokeCallBack(self->pCall, NEWFRAME,&iFrame);
SCSendOK(pCon); SCSendOK(pCon);
return 1; return 1;
} else {
return 0; /* guessed return value M.Z. */
} }
} }

View File

@ -141,6 +141,7 @@
#include <signal.h> #include <signal.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <time.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/time.h> #include <sys/time.h>
@ -2381,7 +2382,7 @@ static int RS__MAX_ASYNCH = 20; /* Asynch "ports" 0 - 19 will be allowed */
Ts_info = calloc (RS__MAX_ASYNCH, sizeof (Ts_info[0])); Ts_info = calloc (RS__MAX_ASYNCH, sizeof (Ts_info[0]));
if (Ts_info == NULL) { if (Ts_info == NULL) {
printf (" Unable to allocate space for Ts_info\n"); printf (" Unable to allocate space for Ts_info\n");
freeAll (Cl_info); exit (EXIT_FAILURE); freeAll (); exit (EXIT_FAILURE);
} }
for (i = 0; i < RS__MAX_ASYNCH; i++) Ts_info[i].status = TS_SS_IDLE; for (i = 0; i < RS__MAX_ASYNCH; i++) Ts_info[i].status = TS_SS_IDLE;
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
@ -2580,7 +2581,8 @@ static int RS__MAX_ASYNCH = 20; /* Asynch "ports" 0 - 19 will be allowed */
&buff[4]); &buff[4]);
traceWrite (); traceWrite ();
}else { }else {
printf ("%.15s - USR1 signal detected. There is no trace buffer.\n"); printf ("%.15s - USR1 signal detected. There is no trace buffer.\n",
&buff[4]);
} }
fflush (NULL); fflush (NULL);
signal (SIGUSR1, USR1_Handler); /* Re-enable USR1 signal */ signal (SIGUSR1, USR1_Handler); /* Re-enable USR1 signal */

View File

@ -1147,13 +1147,13 @@
switch (Cmnd_fmt[i]) { switch (Cmnd_fmt[i]) {
case ONE_INT: case ONE_INT:
sscanf (rply_ptr->rply, "%d", sscanf (rply_ptr->rply, "%d",
((char *) state) + Offsets[indx]); (int *)(((char *) state) + Offsets[indx]));
indx++; indx++;
break; break;
case TWO_INT: case TWO_INT:
sscanf (rply_ptr->rply, "%d %d", sscanf (rply_ptr->rply, "%d %d",
((char *) state) + Offsets[indx], (int *)(((char *) state) + Offsets[indx]),
((char *) state) + Offsets[indx+1]); (int *)(((char *) state) + Offsets[indx+1]));
indx++; indx++; indx++; indx++;
break; break;
case ONE_STRING: case ONE_STRING:

View File

@ -10,8 +10,6 @@
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .o .SUFFIXES: .c .o
VPATH=$(SRC)
ROOT=../..
HLIB=../hardsup/libhlib.a HLIB=../hardsup/libhlib.a
LIBS = -L/usr/X11R6/lib -lX11 LIBS = -L/usr/X11R6/lib -lX11
#---------------------------------------------------------- #----------------------------------------------------------

View File

@ -1,15 +1,6 @@
# Forwards the execution to a version specific makefile.
# SICS_VERSION must be defined, else usage is printed
# M. Zolliker 03.2005 # M. Zolliker 03.2005
VERS_UNDEFINED= default:
VERS_UNDEFINED$(SICS_VERSION)=version_undefined
INCL_MF=makefile_$(SICS_VERSION)
-include $(INCL_MF)
version_undefined:
@ echo "" @ echo ""
@ echo "Usage:" @ echo "Usage:"
@ echo "" @ echo ""
@ -18,17 +9,4 @@ version_undefined:
@ echo ' where makefile_xxx is one of' @ echo ' where makefile_xxx is one of'
@ echo "" @ echo ""
@ ls -1 makefile_* | pr -t -o 4 @ ls -1 makefile_* | pr -t -o 4
@ echo ""
@ echo "Or, more convenient, define the following in the login script"
@ echo ""
@ echo " setenv SICS_VERSION version_xxx (assume we are using tcsh)"
@ echo ""
@ echo " where version_xxx is one of"
@ echo ""
@ ls -1 makefile_* | cut -b 10-99 | pr -t -o 4
@ echo ""
@ echo "and then use simply"
@ echo ""
@ echo " make [target]"
@ echo ""

View File

@ -9,7 +9,7 @@
include ../../alpha_def include ../../alpha_def
CC = cc CC = cc
CFLAGS = -std1 -g $(DFORTIFY) -I$(SRC). -I$(ROOT)/psi/hardsup/$(SRC) CFLAGS = -std1 -g $(DFORTIFY) -I../hardsup -I.
ALPHA = el737 el734 el734_test ALPHA = el737 el734 el734_test
# -- the following macros are used as a replacement for some automatic variables # -- the following macros are used as a replacement for some automatic variables

View File

@ -6,10 +6,10 @@
# Markus Zolliker, Oct 2003 # Markus Zolliker, Oct 2003
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
include ../../$(SRC)linux_def include ../../linux_def
CC = gcc CC = gcc
CFLAGS = -g -DLINUX $(DFORTIFY) -I$(SRC). -I$(ROOT)/psi/hardsup/$(SRC) CFLAGS = -g -DLINUX $(DFORTIFY) -I../hardsup -I.
# -- the following macros are used as a replacement for some automatic variables # -- the following macros are used as a replacement for some automatic variables
# due to different make versions. # due to different make versions.
@ -22,4 +22,4 @@ Q=$^
F=$< F=$<
C=$< C=$<
include $(SRC)make_gen include make_gen