fixed small bugs/unproper code

This commit is contained in:
zolliker
2005-03-04 09:43:18 +00:00
parent 0a30ff82c3
commit b6f7d27147
10 changed files with 44 additions and 135 deletions

View File

@ -11,7 +11,7 @@
#ifndef FOURTABLE #ifndef FOURTABLE
#define FOURTABLE #define FOURTABLE
int MakeFourCircleTable(); int MakeFourCircleTable(void);
void DeleteFourCircleTable(int handle); void DeleteFourCircleTable(int handle);
int HandleFourCircleCommands(int handle, SConnection *pCon, int HandleFourCircleCommands(int handle, SConnection *pCon,
int argc, char *argv[], int *err); int argc, char *argv[], int *err);

2
hkl.h
View File

@ -47,6 +47,6 @@
int HKLAction(SConnection *pCon, SicsInterp *pSics, void *pData, int HKLAction(SConnection *pCon, SicsInterp *pSics, void *pData,
int argc, char *argv[]); int argc, char *argv[]);
void SetHKLScanTolerance(pHKL self, float fVal);
#endif #endif

View File

@ -320,7 +320,9 @@ static int ProtectedExec(ClientData clientData, Tcl_Interp *interp,
pUnknown->iStack = 0; pUnknown->iStack = 0;
pUnknown->pInter = pSics; pUnknown->pInter = pSics;
pUnbekannt = pUnknown; pUnbekannt = pUnknown;
Tcl_CreateCommand(pInter,"unknown",SicsUnknownProc, /* the cast before SicsUnknwonProc is to avoid a warning
Tcl_CmdProc has a const char instead of char as argument M.Z. */
Tcl_CreateCommand(pInter,"unknown",(Tcl_CmdProc *)SicsUnknownProc,
pUnknown, UnknownKill); pUnknown, UnknownKill);
/* delete dangers */ /* delete dangers */

View File

@ -1,87 +0,0 @@
# This file is included by the makefile.
# It forwards the execution to a version specific makefile.
# S_UP and SICS_VERSION must be defined
# M. Zolliker 08.2003
VERS_UNDEFINED=
VERS_UNDEFINED$(SICS_VERSION)=version_undefined
SICS_ROOT=$(PWD)/$(S_UP)
MD=cd $(SICS_VERSION); \
make -f $(SRC)makefile_$(SICS_VERSION) SRC=$(SRC)
#define TREE only when version defined
TREE$(VERS_UNDEFINED)=$(SICS_ROOT)/obj/$(SICS_VERSION)/tree
# overwrite MD when SICS_VERSION undefined
MD$(SICS_VERSION)=@ true
SRC=src/
.SUFFIXES: .none
default: $(VERS_UNDEFINED) $(TREE)
$(MD)
%.o: $(VERS_UNDEFINED) $(TREE)
$(MD) $@
%: $(VERS_UNDEFINED) $(TREE)
$(MD) $@
.DEFAULT: $(VERS_UNDEFINED) $(TREE)
$(MD) $@
makefile:
@ echo makefile
tree: $(TREE)
@ true
cleantree:
rm -f $(SICS_ROOT)/obj/$(SICS_VERSION)/tree
$(TREE):
@ $(VERS_UNDEFINED) test 1
@ echo --- Make object tree ---
@ $(SICS_ROOT)/maketree .
@ $(SICS_ROOT)/maketree matrix
@ $(SICS_ROOT)/maketree dummy
@ $(SICS_ROOT)/maketree psi
@ $(SICS_ROOT)/maketree psi/hardsup
@ $(SICS_ROOT)/maketree psi/utils
@ $(SICS_ROOT)/maketree psi/tecs
@ $(SICS_ROOT)/maketree psi/tecs/pg_plus
touch $(TREE)
@ echo --- End object tree ---
cleanall:
$(MD) clean
version_undefined:
@ echo ""
@ echo "Usage:"
@ echo ""
@ echo "Creating objects and targets mixed up with sources:"
@ 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 "Creating objects and targets in separate subdirectories"
@ echo ""
@ echo " setenv SICS_VERSION version_xxx (assume we are using tcsh)"
@ echo " make [target]"
@ echo ""
@ echo " where version_xxx is one of"
@ echo ""
@ ls -1 makefile_* | cut -b 10-99 | pr -t -o 4
@ echo ""
@ echo " Remarks:"
@ echo " All objects for alpha version will be created in subdirectory obj/alpha/,"
@ echo " SICServer is also found there."
@ echo " Tip: define SICS_VERSION at login"
@ echo ""

View File

@ -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 VERS_UNDEFINED=
S_UP=. 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

View File

@ -1,36 +0,0 @@
#!/bin/tcsh
# create the version specific object tree
#
# M.Zolliker 08.2003
#
if ("$SICS_VERSION" == "") then
echo SICS_VERSION undefined
else
if (${0:h} != $0) then
cd ${0:h}
endif
set SICS_ROOT=$PWD
# determine object directory
set o="$SICS_ROOT/obj/$SICS_VERSION/$1"
# determine makefile
set m="$SICS_ROOT/$1/makefile_$SICS_VERSION"
if (-e $m) then
if (! -e $o) then
echo create directory $o
mkdir -p $o
else
echo $o exists
endif
rm -f $o/src
echo ln -s $SICS_ROOT/$1 $o/src
ln -s $SICS_ROOT/$1 $o/src
ln -s $o $SICS_ROOT/$1/$SICS_VERSION
endif
endif

View File

@ -93,7 +93,7 @@ static int SaveMesure(void *pData, char *name, FILE *fd)
fprintf(fd,"%s np %d\n", name, self->np); fprintf(fd,"%s np %d\n", name, self->np);
fprintf(fd,"%s preset %f\n", name, self->fPreset); fprintf(fd,"%s preset %f\n", name, self->fPreset);
fprintf(fd,"%s step %f\n", name, self->fStep); fprintf(fd,"%s step %f\n", name, self->fStep);
fprintf(fd,"%s weakthreshold %f\n", name, self->weakThreshold); fprintf(fd,"%s weakthreshold %ld\n", name, self->weakThreshold);
fprintf(fd,"%s compact %d\n", name, self->iCompact); fprintf(fd,"%s compact %d\n", name, self->iCompact);
fprintf(fd,"%s weak %d\n", name, self->weak); fprintf(fd,"%s weak %d\n", name, self->weak);
fprintf(fd,"%s fastscan %d\n", name, self->fastScan); fprintf(fd,"%s fastscan %d\n", name, self->fastScan);
@ -122,7 +122,7 @@ static void ListMesure(pMesure self, char *name, SConnection *pCon)
Tcl_DStringAppend(&list,pBuffer,-1); Tcl_DStringAppend(&list,pBuffer,-1);
snprintf(pBuffer,131,"%s.step %f\n", name, self->fStep); snprintf(pBuffer,131,"%s.step %f\n", name, self->fStep);
Tcl_DStringAppend(&list,pBuffer,-1); Tcl_DStringAppend(&list,pBuffer,-1);
snprintf(pBuffer,131,"%s.weakthreshold %f\n", name, self->weakThreshold); snprintf(pBuffer,131,"%s.weakthreshold %ld\n", name, self->weakThreshold);
Tcl_DStringAppend(&list,pBuffer,-1); Tcl_DStringAppend(&list,pBuffer,-1);
snprintf(pBuffer,131,"%s.compact %d\n", name, self->iCompact); snprintf(pBuffer,131,"%s.compact %d\n", name, self->iCompact);
Tcl_DStringAppend(&list,pBuffer,-1); Tcl_DStringAppend(&list,pBuffer,-1);

View File

@ -19,7 +19,7 @@
pMotReg FindMotFromDataStructure(int iList, void *pData); pMotReg FindMotFromDataStructure(int iList, void *pData);
int CheckAllMotors(int iList, SConnection *pCon); int CheckAllMotors(int iList, SConnection *pCon);
void KillMotList(int iList); void KillMotList(int iList);
void StopAllMotors(int iList);
#endif #endif

View File

@ -334,7 +334,8 @@
pEVDriver pNew = NULL; pEVDriver pNew = NULL;
pTclEv pPriv = NULL; pTclEv pPriv = NULL;
int iRet; int iRet;
char *pPtr = NULL; /* the "const" saves us from a couple of warnings M.Z.*/
const char *pPtr = NULL;
if(argc < 1)/* we expect a Tcl array with all data */ if(argc < 1)/* we expect a Tcl array with all data */
{ {
@ -478,7 +479,7 @@
{ {
pTclEv pPriv = NULL; pTclEv pPriv = NULL;
char pBueffel[132]; char pBueffel[132];
char *pPtr = NULL; const char *pPtr = NULL;
assert(self); assert(self);
pPriv = (pTclEv)self->pPrivate; pPriv = (pTclEv)self->pPrivate;

View File

@ -12,6 +12,7 @@
#include "sics.h" #include "sics.h"
#include "passwd.h" #include "passwd.h"
#include "telnet.h" #include "telnet.h"
#include "commandlog.h"
#include "fortify.h" #include "fortify.h"
#define LOGINWAIT 300 #define LOGINWAIT 300
/* 300 == 5 minutes to wait for valid username password */ /* 300 == 5 minutes to wait for valid username password */