From c706d655c8092bb6a6d6f541fb9c0fbfadcb167b Mon Sep 17 00:00:00 2001 From: zolliker Date: Fri, 4 Mar 2005 09:44:12 +0000 Subject: [PATCH] fixed some bugs/unproper code --- lcdriv.c | 11 ++++++----- logger.c | 6 ++---- makefile | 36 ++++++++++++++++++++++++++++++++---- polterwrite.c | 8 ++++---- remob.c | 2 +- 5 files changed, 45 insertions(+), 18 deletions(-) diff --git a/lcdriv.c b/lcdriv.c index c128309..b0494cd 100644 --- a/lcdriv.c +++ b/lcdriv.c @@ -96,11 +96,12 @@ static int LcRead(long pc, LcDriv *me) { EveWrite(eve, "X"); FSM_NEXT LcStatus(me); /* check for errors */ -// if (!me->remote) goto skiprmt; -// EveWrite(eve, "C0"); -// me->remote = 0; -// FSM_NEXT - +/* + if (!me->remote) goto skiprmt; + EveWrite(eve, "C0"); + me->remote = 0; + FSM_NEXT +*/ skiprmt: if (me->dig[1] < 0) goto skip1; EveWrite(eve, "R1"); /* read sensor 1 */ diff --git a/logger.c b/logger.c index c9ba083..c57bdc1 100644 --- a/logger.c +++ b/logger.c @@ -145,9 +145,6 @@ int LoggerWrite(Logger *log, time_t now, int period, char *value) { */ strftime(stim, sizeof stim,"%H:%M:%S", tm); fprintf(fil, "%s\t%s%s\n", stim, value, buf); -// if (0 != strncmp(value, log->old, sizeof(log->old)) || buf[0]!='\0') { /* value has changed */ -// log->pos = ftell(fil); /* next time append to the end */ -// } l = strlen(value); if (l >= sizeof(log->old)) { l = sizeof(log->old) - 1; @@ -324,6 +321,7 @@ static void LoggerPut(Compressor *c, time_t t, char *value) { int LoggerGraph(SConnection *pCon, SicsInterp *pSics, void *pData, int argc, char *argv[]) { time_t from, to, step, xs, lastt, now; + long lxs; char *p; int i, l, yday, iret, loss; int inRange; @@ -431,7 +429,7 @@ int LoggerGraph(SConnection *pCon, SicsInterp *pSics, void *pData, if (p) { stp = p+1; *p='\0'; - iret = sscanf(stp, "%ld", &xs); + iret = sscanf(stp, "%ld", &lxs); xs = lxs; if (iret == 1) { if (xs < step) { loss = 1; diff --git a/makefile b/makefile index 887b267..8f5a8eb 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,34 @@ -# this makefile delegates to a version specific makefile +# Forwards the execution to a version specific makefile. +# SICS_VERSION must be defined, else usage is printed +# M. Zolliker 03.2005 -# where root is -S_UP=.. +VERS_UNDEFINED= +VERS_UNDEFINED$(SICS_VERSION)=version_undefined + +INCL_MF=makefile_$(SICS_VERSION) + +-include $(INCL_MF) + +version_undefined: + @ echo "" + @ echo "Usage:" + @ echo "" + @ echo " make -f makefile_xxx [target]" + @ echo "" + @ echo ' where makefile_xxx is one of' + @ echo "" + @ 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 "" -include ../make_forward diff --git a/polterwrite.c b/polterwrite.c index 2a0ef52..fdb872a 100644 --- a/polterwrite.c +++ b/polterwrite.c @@ -182,7 +182,7 @@ static void writeSample(NXhandle hfil, NXdict hdict, /*--------------------------------------------------------------------*/ -static int PoldiStart(pPolterdi self, SConnection *pCon) +static void PoldiStart(pPolterdi self, SConnection *pCon) { char pBueffel[256]; NXhandle hfil = NULL; @@ -206,14 +206,14 @@ static int PoldiStart(pPolterdi self, SConnection *pCon) { SCWrite(pCon,"ERROR: Extra severe: failed to create data file name", eError); - return 0; + return; } /* create a Nexus file */ NXopen(self->pFile,NXACC_CREATE,&hfil); if(!hfil) { SCWrite(pCon,"ERROR: cannot create data file ",eError); - return 0; + return; } /* tell Uwe User what we are doing */ pVar = NULL; @@ -245,7 +245,7 @@ static int PoldiStart(pPolterdi self, SConnection *pCon) SCWrite(pCon,"ERROR: This is a SERIOUS problem!",eError); SCWrite(pCon,"ERROR: DATA NOT WRITTEN",eError); NXclose(&hfil); - return 0; + return; } diff --git a/remob.c b/remob.c index bb568c9..c66a49d 100644 --- a/remob.c +++ b/remob.c @@ -140,7 +140,7 @@ static int RemHandle(RemServer *remserver) { return 0; } /*-------------------------------------------------------------------------*/ -static int RemCopy(RemServer *remserver, SConnection *pCon) { +static void RemCopy(RemServer *remserver, SConnection *pCon) { char buf[256]; if (pCon != NULL && remserver->line[0] != '\0') { snprintf(buf, sizeof(buf), " %s", remserver->line);