From 1aef9afabb541f61bee6f8922e8120aeb9b9bfd7 Mon Sep 17 00:00:00 2001 From: zolliker Date: Thu, 23 Mar 2006 12:39:11 +0000 Subject: [PATCH] polished code to suppress warnings SKIPPED: psi/makefile_linux --- SCinter.c | 14 ++++++-------- linux_def | 2 +- makefile_slinux | 2 +- napi4.c | 4 ++-- nxxml.c | 2 +- sics.h | 4 ++++ 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/SCinter.c b/SCinter.c index dcabc06e..185f074e 100644 --- a/SCinter.c +++ b/SCinter.c @@ -74,7 +74,6 @@ #include "lld_str.h" static void printList(SConnection *pCon, int listID); static void freeList(int listID); -int compareStringNode(void *pStr1, void **ppStr2); #define MAXLEN 256 #define MAXPAR 100 @@ -535,6 +534,12 @@ static void printAll(SicsInterp *pSics, SConnection *pCon) SCWrite(pCon,pBueffel,eStatus); } } +/*------------------------------------------------------------------------*/ +/* compareStringNode wraps strcmp for use in findNode(LLD module) calls */ +int compareStringNode(const void *pStr1, const void *ppStr2) +{ + return strcmp((char *)pStr1,*(char **)ppStr2); +} /*------------------------------------------------------------------------ printAllTypes prints the list of types of objects instantiated on the CommandList. @@ -1001,13 +1006,6 @@ static void freeList(int listID) } while(0!=LLDnodePtr2First(listID)); LLDdelete(listID); } - -/*------------------------------------------------------------------------*/ -/* compareStringNode wraps strcmp for use in findNode(LLD module) calls */ -int compareStringNode(void *pStr1, void **ppStr2) -{ - return strcmp((char *)pStr1,(char *)(*ppStr2)); -} /*------------------------------------------------------------------------*/ void RemoveStartupCommands(void) { diff --git a/linux_def b/linux_def index 95fe3c04..ea98bcdb 100644 --- a/linux_def +++ b/linux_def @@ -9,4 +9,4 @@ MFLAGS=-f makefile_linux$(DUMMY) -HDFROOT=/afs/psi.ch/project/sinq/sl-linux \ No newline at end of file +HDFROOT=/afs/psi.ch/project/sinq/sl-linux diff --git a/makefile_slinux b/makefile_slinux index 493ec238..d1347acc 100644 --- a/makefile_slinux +++ b/makefile_slinux @@ -17,7 +17,7 @@ CC = gcc CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 -DNXXML $(NI) \ -Ipsi/hardsup -I. \ -fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY) \ - -Wall -Wno-unused -Wno-comment -Wno-switch + -Wall -Wno-unused -Wno-comment -Wno-switch -Werror BINTARGET = bin EXTRA=nintf.o diff --git a/napi4.c b/napi4.c index 76b800ea..46ff5da8 100644 --- a/napi4.c +++ b/napi4.c @@ -21,7 +21,7 @@ For further information, see - $Id: napi4.c,v 1.6 2006/03/03 15:30:55 koennecke Exp $ + $Id: napi4.c,v 1.7 2006/03/23 12:39:11 zolliker Exp $ ----------------------------------------------------------------------------*/ #include @@ -1236,7 +1236,7 @@ extern void *NXpData; { pNexusFile pFile; pFile = NXIassert (fid); - printf("HDF4 link: iTag = %d, iRef = %d, target=\"%s\"\n", sLink->iTag, sLink->iRef, sLink->targetPath); + printf("HDF4 link: iTag = %ld, iRef = %ld, target=\"%s\"\n", sLink->iTag, sLink->iRef, sLink->targetPath); return NX_OK; } diff --git a/nxxml.c b/nxxml.c index 73fa4713..bec44eef 100644 --- a/nxxml.c +++ b/nxxml.c @@ -866,7 +866,7 @@ static char *formatAttributeData(void *data, int datalen, int iType){ break; } if(intData){ - snprintf(number,79,"%s%d",type,iValue); + snprintf(number,79,"%s%ld",type,iValue); } else { snprintf(number,79,"%s%f",type,dValue); } diff --git a/sics.h b/sics.h index ebc9c1ce..b7044e5b 100644 --- a/sics.h +++ b/sics.h @@ -15,6 +15,10 @@ ePreset }CounterMode; +/* the following line suppresses const declarations in tcl.h. + -> makes the compiler happy M.Z. */ +#define NO_CONST + #include #include #include