diff --git a/src/as/asCa.c b/src/as/asCa.c index 859f03456..abcbac819 100644 --- a/src/as/asCa.c +++ b/src/as/asCa.c @@ -38,13 +38,13 @@ int asCaDebug = 0; epicsExportAddress(int,asCaDebug); -LOCAL int firstTime = TRUE; -LOCAL epicsThreadId threadid=0; -LOCAL int caInitializing=FALSE; -LOCAL epicsMutexId asCaTaskLock; /*lock access to task */ -LOCAL epicsEventId asCaTaskWait; /*Wait for task to respond*/ -LOCAL epicsEventId asCaTaskAddChannels; /*Tell asCaTask to add channels*/ -LOCAL epicsEventId asCaTaskClearChannels;/*Tell asCaTask to clear channels*/ +static int firstTime = TRUE; +static epicsThreadId threadid=0; +static int caInitializing=FALSE; +static epicsMutexId asCaTaskLock; /*lock access to task */ +static epicsEventId asCaTaskWait; /*Wait for task to respond*/ +static epicsEventId asCaTaskAddChannels; /*Tell asCaTask to add channels*/ +static epicsEventId asCaTaskClearChannels;/*Tell asCaTask to clear channels*/ typedef struct { struct dbr_sts_double rtndata; @@ -86,7 +86,7 @@ static void exceptionCallback(struct exception_handler_args args) } /*connectCallback only handles disconnects*/ -LOCAL void connectCallback(struct connection_handler_args arg) +static void connectCallback(struct connection_handler_args arg) { chid chid = arg.chid; ASGINP *pasginp = (ASGINP *)ca_puser(chid); @@ -103,7 +103,7 @@ LOCAL void connectCallback(struct connection_handler_args arg) } } -LOCAL void eventCallback(struct event_handler_args arg) +static void eventCallback(struct event_handler_args arg) { int caStatus = arg.status; chid chid = arg.chid; @@ -159,7 +159,7 @@ LOCAL void eventCallback(struct event_handler_args arg) if(!caInitializing) asComputeAsg(pasg); } -LOCAL void asCaTask(void) +static void asCaTask(void) { ASG *pasg; ASGINP *pasginp; diff --git a/src/ca/catime.c b/src/ca/catime.c index ec0c05ab0..2f86d1da1 100644 --- a/src/ca/catime.c +++ b/src/ca/catime.c @@ -34,10 +34,6 @@ #include "caDiagnostics.h" -#ifndef LOCAL -#define LOCAL static -#endif - #ifndef NULL #define NULL 0 #endif @@ -62,7 +58,7 @@ typedef void tf ( ti *pItems, unsigned iterations, unsigned *pInlineIter ); /* * test_pend() */ -LOCAL void test_pend( +static void test_pend( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -99,7 +95,7 @@ unsigned *pInlineIter /* * test_search () */ -LOCAL void test_search ( +static void test_search ( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -122,7 +118,7 @@ unsigned *pInlineIter * test_sync_search() */ #if 0 -LOCAL void test_sync_search( +static void test_sync_search( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -145,7 +141,7 @@ unsigned *pInlineIter /* * test_free () */ -LOCAL void test_free( +static void test_free( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -166,7 +162,7 @@ unsigned *pInlineIter /* * test_put () */ -LOCAL void test_put( +static void test_put( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -258,7 +254,7 @@ unsigned *pInlineIter /* * test_get () */ -LOCAL void test_get( +static void test_get( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -338,7 +334,7 @@ unsigned *pInlineIter /* * test_wait () */ -LOCAL void test_wait ( +static void test_wait ( ti *pItems, unsigned iterations, unsigned *pInlineIter @@ -364,7 +360,7 @@ unsigned *pInlineIter /* * measure_get_latency */ -LOCAL void measure_get_latency (ti *pItems, unsigned iterations) +static void measure_get_latency (ti *pItems, unsigned iterations) { epicsTimeStamp end_time; epicsTimeStamp start_time; @@ -411,7 +407,7 @@ LOCAL void measure_get_latency (ti *pItems, unsigned iterations) /* * printSearchStat() */ -LOCAL void printSearchStat ( const ti *pi, unsigned iterations ) +static void printSearchStat ( const ti *pi, unsigned iterations ) { unsigned i; double X = 0u; @@ -474,7 +470,7 @@ void timeIt ( tf *pfunc, ti *pItems, unsigned iterations, unsigned nBytes ) /* * test () */ -LOCAL void test ( ti *pItems, unsigned iterations ) +static void test ( ti *pItems, unsigned iterations ) { unsigned nBytes; diff --git a/src/cas/os/vms/vms_depen.h b/src/cas/os/vms/vms_depen.h index 4b7910325..630de4441 100644 --- a/src/cas/os/vms/vms_depen.h +++ b/src/cas/os/vms/vms_depen.h @@ -43,8 +43,3 @@ */ #define taskwdInsert(A,B,C) #define taskwdRemove(A) - -#ifndef LOCAL -#define LOCAL static -#endif /*LOCAL*/ - diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index 55e3d5675..06c48ae21 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -126,9 +126,9 @@ epicsMutexMustLock((RECPTR)->mlok); #define UNLOCKREC(RECPTR)\ epicsMutexUnlock((RECPTR)->mlok); -LOCAL void *dbevEventUserFreeList; -LOCAL void *dbevEventQueueFreeList; -LOCAL void *dbevEventBlockFreeList; +static void *dbevEventUserFreeList; +static void *dbevEventQueueFreeList; +static void *dbevEventBlockFreeList; static char *EVENT_PEND_NAME = "eventTask"; @@ -469,7 +469,7 @@ void epicsShareAPI db_event_disable (dbEventSubscription es) * event_remove() * event queue lock _must_ be applied */ -LOCAL void event_remove ( struct event_que *ev_que, +static void event_remove ( struct event_que *ev_que, unsigned short index, struct evSubscrip *placeHolder ) { struct evSubscrip *pEvent = ev_que->evque[index]; @@ -625,7 +625,7 @@ int epicsShareAPI db_post_extra_labor (dbEventCtx ctx) * * NOTE: This assumes that the db scan lock is already applied */ -LOCAL void db_post_single_event_private (struct evSubscrip *event) +static void db_post_single_event_private (struct evSubscrip *event) { struct event_que *ev_que; db_field_log *pLog; @@ -789,7 +789,7 @@ void epicsShareAPI db_post_single_event (dbEventSubscription es) /* * EVENT_READ() */ -LOCAL int event_read ( struct event_que *ev_que ) +static int event_read ( struct event_que *ev_que ) { db_field_log *pfl; void ( *user_sub ) ( void *user_arg, struct dbAddr *paddr, @@ -896,7 +896,7 @@ LOCAL int event_read ( struct event_que *ev_que ) /* * EVENT_TASK() */ -LOCAL void event_task (void *pParm) +static void event_task (void *pParm) { struct event_user *evUser = (struct event_user *) pParm; struct event_que *ev_que; diff --git a/src/libCom/bucketLib/bucketLib.c b/src/libCom/bucketLib/bucketLib.c index 4021c43fb..2f3771430 100644 --- a/src/libCom/bucketLib/bucketLib.c +++ b/src/libCom/bucketLib/bucketLib.c @@ -42,9 +42,6 @@ #ifndef FALSE #define FALSE 0 #endif /* FALSE */ -#ifndef LOCAL -#define LOCAL static -#endif /* LOCAL */ #ifndef max #define max(A,B) ((A)>(B)?(A):(B)) #endif /* max */ @@ -56,12 +53,12 @@ typedef BUCKETID bucketHash(BUCKET *pb, const void *pId); typedef ITEM **bucketCompare(ITEM **ppi, const void *pId); -LOCAL bucketCompare bucketUnsignedCompare; -LOCAL bucketCompare bucketPointerCompare; -LOCAL bucketCompare bucketStringCompare; -LOCAL bucketHash bucketUnsignedHash; -LOCAL bucketHash bucketPointerHash; -LOCAL bucketHash bucketStringHash; +static bucketCompare bucketUnsignedCompare; +static bucketCompare bucketPointerCompare; +static bucketCompare bucketStringCompare; +static bucketHash bucketUnsignedHash; +static bucketHash bucketPointerHash; +static bucketHash bucketStringHash; typedef struct { bucketHash *pHash; @@ -69,15 +66,15 @@ typedef struct { buckTypeOfId type; }bucketSET; -LOCAL bucketSET BSET[] = { +static bucketSET BSET[] = { {bucketUnsignedHash, bucketUnsignedCompare, bidtUnsigned}, {bucketPointerHash, bucketPointerCompare, bidtPointer}, {bucketStringHash, bucketStringCompare, bidtString} }; -LOCAL int bucketAddItem(BUCKET *prb, bucketSET *pBSET, +static int bucketAddItem(BUCKET *prb, bucketSET *pBSET, const void *pId, const void *pApp); -LOCAL void *bucketLookupItem(BUCKET *pb, bucketSET *pBSET, const void *pId); +static void *bucketLookupItem(BUCKET *pb, bucketSET *pBSET, const void *pId); @@ -165,7 +162,7 @@ main() /* * bucketUnsignedCompare() */ -LOCAL ITEM **bucketUnsignedCompare (ITEM **ppi, const void *pId) +static ITEM **bucketUnsignedCompare (ITEM **ppi, const void *pId) { unsigned id; unsigned *pItemId; @@ -188,7 +185,7 @@ LOCAL ITEM **bucketUnsignedCompare (ITEM **ppi, const void *pId) /* * bucketPointerCompare() */ -LOCAL ITEM **bucketPointerCompare (ITEM **ppi, const void *pId) +static ITEM **bucketPointerCompare (ITEM **ppi, const void *pId) { void *ptr; void **pItemId; @@ -211,7 +208,7 @@ LOCAL ITEM **bucketPointerCompare (ITEM **ppi, const void *pId) /* * bucketStringCompare () */ -LOCAL ITEM **bucketStringCompare (ITEM **ppi, const void *pId) +static ITEM **bucketStringCompare (ITEM **ppi, const void *pId) { const char *pStr = pId; ITEM *pi; @@ -233,7 +230,7 @@ LOCAL ITEM **bucketStringCompare (ITEM **ppi, const void *pId) /* * bucketUnsignedHash () */ -LOCAL BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId) +static BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId) { const unsigned *pUId = pId; unsigned src; @@ -255,7 +252,7 @@ LOCAL BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId) /* * bucketPointerHash () */ -LOCAL BUCKETID bucketPointerHash (BUCKET *pb, const void *pId) +static BUCKETID bucketPointerHash (BUCKET *pb, const void *pId) { void * const *ppId = (void * const *) pId; unsigned long src; @@ -283,7 +280,7 @@ LOCAL BUCKETID bucketPointerHash (BUCKET *pb, const void *pId) /* * bucketStringHash () */ -LOCAL BUCKETID bucketStringHash (BUCKET *pb, const void *pId) +static BUCKETID bucketStringHash (BUCKET *pb, const void *pId) { const char *pStr = pId; BUCKETID hashid; @@ -411,7 +408,7 @@ epicsShareFunc int epicsShareAPI { return bucketAddItem(prb, &BSET[bidtString], pId, pApp); } -LOCAL int bucketAddItem(BUCKET *prb, bucketSET *pBSET, const void *pId, const void *pApp) +static int bucketAddItem(BUCKET *prb, bucketSET *pBSET, const void *pId, const void *pApp) { BUCKETID hashid; ITEM **ppi; @@ -455,7 +452,7 @@ LOCAL int bucketAddItem(BUCKET *prb, bucketSET *pBSET, const void *pId, const vo /* * bucketLookupAndRemoveItem () */ -LOCAL void *bucketLookupAndRemoveItem (BUCKET *prb, bucketSET *pBSET, const void *pId) +static void *bucketLookupAndRemoveItem (BUCKET *prb, bucketSET *pBSET, const void *pId) { BUCKETID hashid; ITEM **ppi; @@ -538,7 +535,7 @@ epicsShareFunc void * epicsShareAPI { return bucketLookupItem(prb, &BSET[bidtString], pId); } -LOCAL void *bucketLookupItem (BUCKET *pb, bucketSET *pBSET, const void *pId) +static void *bucketLookupItem (BUCKET *pb, bucketSET *pBSET, const void *pId) { BUCKETID hashid; ITEM **ppi; diff --git a/src/libCom/error/makeStatTbl.pl b/src/libCom/error/makeStatTbl.pl index 735f819c9..372e22184 100644 --- a/src/libCom/error/makeStatTbl.pl +++ b/src/libCom/error/makeStatTbl.pl @@ -104,7 +104,7 @@ foreach $line ( @err_sym_line ) print OUT "\n"; -print OUT "LOCAL ERRSYMBOL symbols[] =\n"; +print OUT "static ERRSYMBOL symbols[] =\n"; print OUT "{\n"; for ($i=0; $i<$count; ++$i) @@ -115,7 +115,7 @@ for ($i=0; $i<$count; ++$i) print OUT "};\n"; print OUT "\n"; -print OUT "LOCAL ERRSYMTAB symTbl =\n"; +print OUT "static ERRSYMTAB symTbl =\n"; print OUT "{\n"; print OUT "\tNELEMENTS(symbols), /* current number of symbols in table */\n"; print OUT "\tsymbols, /* ptr to symbol array */\n"; diff --git a/src/libCom/logClient/iocLog.c b/src/libCom/logClient/iocLog.c index a5a46dcec..c6c707c30 100644 --- a/src/libCom/logClient/iocLog.c +++ b/src/libCom/logClient/iocLog.c @@ -22,22 +22,18 @@ #include "logClient.h" #include "iocLog.h" -#ifndef LOCAL -#define LOCAL static -#endif - int iocLogDisable = 0; static const int iocLogSuccess = 0; static const int iocLogError = -1; -LOCAL logClientId iocLogClient; +static logClientId iocLogClient; /* * getConfig() * Get Server Configuration */ -LOCAL int getConfig (struct in_addr *pserver_addr, unsigned short *pserver_port) +static int getConfig (struct in_addr *pserver_addr, unsigned short *pserver_port) { long status; long epics_port; @@ -82,7 +78,7 @@ void epicsShareAPI epicsShareAPI iocLogFlush (void) /* * iocLogClientInit() */ -LOCAL logClientId iocLogClientInit (void) +static logClientId iocLogClientInit (void) { int status; logClientId id; diff --git a/src/libCom/logClient/logClient.c b/src/libCom/logClient/logClient.c index 97356874d..adaaa7f95 100644 --- a/src/libCom/logClient/logClient.c +++ b/src/libCom/logClient/logClient.c @@ -34,10 +34,6 @@ #include "logClient.h" -#ifndef LOCAL -#define LOCAL static -#endif - static const int logClientSuccess = 0; static const int logClientError = -1; @@ -57,14 +53,14 @@ typedef struct { int connFailStatus; } logClient; -LOCAL const double LOG_RESTART_DELAY = 5.0; /* sec */ -LOCAL const double LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT = 5.0; /* sec */ -LOCAL const double LOG_SERVER_SHUTDOWN_TIMEOUT = 30.0; /* sec */ +static const double LOG_RESTART_DELAY = 5.0; /* sec */ +static const double LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT = 5.0; /* sec */ +static const double LOG_SERVER_SHUTDOWN_TIMEOUT = 30.0; /* sec */ /* * logClientClose () */ -LOCAL void logClientClose ( logClient *pClient ) +static void logClientClose ( logClient *pClient ) { # ifdef DEBUG fprintf (stderr, "log client: lingering for connection close..."); @@ -101,7 +97,7 @@ LOCAL void logClientClose ( logClient *pClient ) /* * logClientDestroy */ -LOCAL void logClientDestroy (logClientId id) +static void logClientDestroy (logClientId id) { enum epicsSocketSystemCallInterruptMechanismQueryInfo interruptInfo; logClient *pClient = (logClient *) id; @@ -286,7 +282,7 @@ void epicsShareAPI logClientFlush ( logClientId id ) /* * logClientMakeSock () */ -LOCAL void logClientMakeSock (logClient *pClient) +static void logClientMakeSock (logClient *pClient) { # ifdef DEBUG @@ -318,7 +314,7 @@ LOCAL void logClientMakeSock (logClient *pClient) /* * logClientConnect() */ -LOCAL void logClientConnect (logClient *pClient) +static void logClientConnect (logClient *pClient) { osiSockIoctl_t optval; int errnoCpy; @@ -430,7 +426,7 @@ LOCAL void logClientConnect (logClient *pClient) /* * logClientRestart () */ -LOCAL void logClientRestart ( logClientId id ) +static void logClientRestart ( logClientId id ) { logClient *pClient = (logClient *)id; diff --git a/src/libCom/misc/aToIPAddr.c b/src/libCom/misc/aToIPAddr.c index 0df071092..c5d53bc30 100644 --- a/src/libCom/misc/aToIPAddr.c +++ b/src/libCom/misc/aToIPAddr.c @@ -20,10 +20,6 @@ #define epicsExportSharedSymbols #include "osiSock.h" -#ifndef LOCAL -#define LOCAL static -#endif - #ifndef NELEMENTS #define NELEMENTS(A) (sizeof(A)/sizeof(A[0])) #endif /*NELEMENTS*/ @@ -31,7 +27,7 @@ /* * addrArrayToUL () */ -LOCAL int addrArrayToUL (const unsigned short *pAddr, unsigned nElements, struct in_addr *pIpAddr) +static int addrArrayToUL (const unsigned short *pAddr, unsigned nElements, struct in_addr *pIpAddr) { unsigned i; unsigned long addr = 0ul; @@ -53,7 +49,7 @@ LOCAL int addrArrayToUL (const unsigned short *pAddr, unsigned nElements, struct * !! ipAddr should be passed in in network byte order !! * !! port is passed in in host byte order !! */ -LOCAL int initIPAddr (struct in_addr ipAddr, unsigned short port, struct sockaddr_in *pIP) +static int initIPAddr (struct in_addr ipAddr, unsigned short port, struct sockaddr_in *pIP) { memset (pIP, '\0', sizeof(*pIP)); pIP->sin_family = AF_INET; diff --git a/src/libCom/osi/devLib.c b/src/libCom/osi/devLib.c index 4929a9d74..8e03f86d9 100644 --- a/src/libCom/osi/devLib.c +++ b/src/libCom/osi/devLib.c @@ -31,10 +31,10 @@ static const char sccsID[] = "@(#) $Id$"; #include "ellLib.h" #include "devLib.h" -LOCAL ELLLIST addrAlloc[atLast]; -LOCAL ELLLIST addrFree[atLast]; +static ELLLIST addrAlloc[atLast]; +static ELLLIST addrFree[atLast]; -LOCAL size_t addrLast[atLast] = { +static size_t addrLast[atLast] = { 0xffff, 0xffffff, 0xffffffff, @@ -42,7 +42,7 @@ LOCAL size_t addrLast[atLast] = { 0xffffff, }; -LOCAL unsigned addrHexDig[atLast] = { +static unsigned addrHexDig[atLast] = { 4, 6, 8, @@ -50,7 +50,7 @@ LOCAL unsigned addrHexDig[atLast] = { 6 }; -LOCAL long addrFail[atLast] = { +static long addrFail[atLast] = { S_dev_badA16, S_dev_badA24, S_dev_badA32, @@ -58,8 +58,8 @@ LOCAL long addrFail[atLast] = { S_dev_badCRCSR }; -LOCAL epicsMutexId addrListLock; -LOCAL char devLibInitFlag; +static epicsMutexId addrListLock; +static char devLibInitFlag; const char *epicsAddressTypeName[] = { @@ -87,14 +87,14 @@ typedef struct{ * These routines are not exported */ -LOCAL long devLibInit(void); +static long devLibInit(void); -LOCAL long addrVerify( +static long addrVerify( epicsAddressType addrType, size_t base, size_t size); -LOCAL long blockFind ( +static long blockFind ( epicsAddressType addrType, const rangeItem *pRange, /* size needed */ @@ -104,28 +104,28 @@ LOCAL long blockFind ( /* base address found */ size_t *pFirst); -LOCAL void report_conflict( +static void report_conflict( epicsAddressType addrType, size_t base, size_t size, const char *pOwnerName); -LOCAL void report_conflict_device( +static void report_conflict_device( epicsAddressType addrType, const rangeItem *pRange); -LOCAL void devInsertAddress( +static void devInsertAddress( ELLLIST *pRangeList, rangeItem *pNewRange); -LOCAL long devListAddressMap( +static long devListAddressMap( ELLLIST *pRangeList); -LOCAL long devCombineAdjacentBlocks( +static long devCombineAdjacentBlocks( ELLLIST *pRangeList, rangeItem *pRange); -LOCAL long devInstallAddr( +static long devInstallAddr( rangeItem *pRange, /* item on the free list to be split */ const char *pOwnerName, epicsAddressType addrType, @@ -301,7 +301,7 @@ long devWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValue) /* * devInstallAddr() */ -LOCAL long devInstallAddr ( +static long devInstallAddr ( rangeItem *pRange, /* item on the free list to be split */ const char *pOwnerName, epicsAddressType addrType, @@ -414,7 +414,7 @@ LOCAL long devInstallAddr ( /* * report_conflict() */ -LOCAL void report_conflict ( +static void report_conflict ( epicsAddressType addrType, size_t base, size_t size, @@ -447,7 +447,7 @@ LOCAL void report_conflict ( /* * report_conflict_device() */ -LOCAL void report_conflict_device(epicsAddressType addrType, const rangeItem *pRange) +static void report_conflict_device(epicsAddressType addrType, const rangeItem *pRange) { errPrintf ( S_dev_identifyOverlap, @@ -532,7 +532,7 @@ long devUnregisterAddress( /* * devCombineAdjacentBlocks() */ -LOCAL long devCombineAdjacentBlocks( +static long devCombineAdjacentBlocks( ELLLIST *pRangeList, rangeItem *pRange) { @@ -571,7 +571,7 @@ LOCAL long devCombineAdjacentBlocks( /* * devInsertAddress() */ -LOCAL void devInsertAddress( +static void devInsertAddress( ELLLIST *pRangeList, rangeItem *pNewRange) { @@ -662,7 +662,7 @@ long devAllocAddress( * * care has been taken here not to overflow type size_t */ -LOCAL long addrVerify(epicsAddressType addrType, size_t base, size_t size) +static long addrVerify(epicsAddressType addrType, size_t base, size_t size) { if (addrType>=atLast) { return S_dev_uknAddrType; @@ -690,7 +690,7 @@ LOCAL long addrVerify(epicsAddressType addrType, size_t base, size_t size) /* * devLibInit() */ -LOCAL long devLibInit (void) +static long devLibInit (void) { rangeItem *pRange; int i; @@ -741,7 +741,7 @@ long devAddressMap(void) /* * devListAddressMap() */ -LOCAL long devListAddressMap(ELLLIST *pRangeList) +static long devListAddressMap(ELLLIST *pRangeList) { rangeItem *pri; int i; @@ -784,7 +784,7 @@ LOCAL long devListAddressMap(ELLLIST *pRangeList) * Find unoccupied block in a large block * */ -LOCAL long blockFind ( +static long blockFind ( epicsAddressType addrType, const rangeItem *pRange, /* size needed */ diff --git a/src/libCom/osi/os/RTEMS/devLibOSD.c b/src/libCom/osi/os/RTEMS/devLibOSD.c index b1e8fadf4..633736d24 100644 --- a/src/libCom/osi/os/RTEMS/devLibOSD.c +++ b/src/libCom/osi/os/RTEMS/devLibOSD.c @@ -30,7 +30,7 @@ typedef void myISR (void *pParam); -LOCAL myISR *isrFetch(unsigned vectorNumber, void **parg); +static myISR *isrFetch(unsigned vectorNumber, void **parg); /* * this routine needs to be in the symbol table @@ -38,7 +38,7 @@ LOCAL myISR *isrFetch(unsigned vectorNumber, void **parg); */ void unsolicitedHandlerEPICS(int vectorNumber); -LOCAL myISR *defaultHandlerAddr[]={ +static myISR *defaultHandlerAddr[]={ (myISR*)unsolicitedHandlerEPICS, }; @@ -72,7 +72,7 @@ int EPICStovxWorksAddrType[] * maps logical address to physical address, but does not detect * two device drivers that are using the same address range */ -LOCAL long rtmsDevMapAddr (epicsAddressType addrType, unsigned options, +static long rtmsDevMapAddr (epicsAddressType addrType, unsigned options, size_t logicalAddress, size_t size, volatile void **ppPhysicalAddress); /* @@ -90,9 +90,9 @@ long rtmsDevWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValu /* RTEMS specific init */ /*devA24Malloc and devA24Free are not implemented*/ -LOCAL void *devA24Malloc(size_t size) { return 0;} -LOCAL void devA24Free(void *pBlock) {}; -LOCAL long rtmsDevInit(void); +static void *devA24Malloc(size_t size) { return 0;} +static void devA24Free(void *pBlock) {}; +static long rtmsDevInit(void); /* * used by bind in devLib.c @@ -106,7 +106,7 @@ static devLibVirtualOS rtemsVirtualOS = { devLibVirtualOS *pdevLibVirtualOS = &rtemsVirtualOS; /* RTEMS specific initialization */ -LOCAL long +static long rtmsDevInit(void) { /* assume the vme bridge has been initialized by bsp */ @@ -204,7 +204,7 @@ long devDisableInterruptLevelVME (unsigned level) /* * rtmsDevMapAddr () */ -LOCAL long rtmsDevMapAddr (epicsAddressType addrType, unsigned options, +static long rtmsDevMapAddr (epicsAddressType addrType, unsigned options, size_t logicalAddress, size_t size, volatile void **ppPhysicalAddress) { long status; @@ -271,7 +271,7 @@ long rtmsDevWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValu /* * isrFetch() */ -LOCAL myISR *isrFetch(unsigned vectorNumber, void **parg) +static myISR *isrFetch(unsigned vectorNumber, void **parg) { /* * fetch the handler or C stub attached at this vector diff --git a/src/libCom/osi/os/vxWorks/devLibOSD.c b/src/libCom/osi/os/vxWorks/devLibOSD.c index e39f3959a..871045fb6 100644 --- a/src/libCom/osi/os/vxWorks/devLibOSD.c +++ b/src/libCom/osi/os/vxWorks/devLibOSD.c @@ -38,15 +38,15 @@ typedef void myISR (void *pParam); * A list of the names of the unexpected interrupt handlers * ( some of these are provided by wrs ) */ -LOCAL char *defaultHandlerNames[] = { +static char *defaultHandlerNames[] = { "excStub", "excIntStub", "unsolicitedHandlerEPICS"}; -LOCAL myISR *defaultHandlerAddr[NELEMENTS(defaultHandlerNames)]; +static myISR *defaultHandlerAddr[NELEMENTS(defaultHandlerNames)]; #endif -LOCAL myISR *isrFetch(unsigned vectorNumber); +static myISR *isrFetch(unsigned vectorNumber); /* * this routine needs to be in the symbol table @@ -88,14 +88,14 @@ int EPICStovxWorksAddrType[] }; #if CPU_FAMILY != PPC -LOCAL void initHandlerAddrList(void); +static void initHandlerAddrList(void); #endif /* * maps logical address to physical address, but does not detect * two device drivers that are using the same address range */ -LOCAL long vxDevMapAddr (epicsAddressType addrType, unsigned options, +static long vxDevMapAddr (epicsAddressType addrType, unsigned options, size_t logicalAddress, size_t size, volatile void **ppPhysicalAddress); /* @@ -267,7 +267,7 @@ long devDisableInterruptLevelVME (unsigned level) /* * vxDevMapAddr () */ -LOCAL long vxDevMapAddr (epicsAddressType addrType, unsigned options, +static long vxDevMapAddr (epicsAddressType addrType, unsigned options, size_t logicalAddress, size_t size, volatile void **ppPhysicalAddress) { long status; @@ -327,7 +327,7 @@ static long vxDevWriteProbe (unsigned wordSize, volatile void *ptr, const void * /* * isrFetch() */ -LOCAL myISR *isrFetch(unsigned vectorNumber) +static myISR *isrFetch(unsigned vectorNumber) { myISR *psub; myISR *pCISR; @@ -421,7 +421,7 @@ void unsolicitedHandlerEPICS(int vectorNumber) * init list of interrupt handlers to ignore * */ -LOCAL +static void initHandlerAddrList(void) { int i; diff --git a/src/libCom/osi/os/vxWorks/veclist.c b/src/libCom/osi/os/vxWorks/veclist.c index 83b008f92..1afe1a777 100644 --- a/src/libCom/osi/os/vxWorks/veclist.c +++ b/src/libCom/osi/os/vxWorks/veclist.c @@ -213,7 +213,7 @@ union pointer{ struct char_array char_overlay; }; -LOCAL +static void *fetch_pointer(unsigned char *plow_byte) { union pointer p; diff --git a/src/rsrv/camessage.c b/src/rsrv/camessage.c index c42294366..e59681f2a 100644 --- a/src/rsrv/camessage.c +++ b/src/rsrv/camessage.c @@ -49,7 +49,7 @@ #define RECORD_NAME(PADDR) ((PADDR)->precord->name) -LOCAL EVENTFUNC read_reply; +static EVENTFUNC read_reply; #define logBadId(CLIENT, MP, PPL)\ logBadIdWithFileAndLineno(CLIENT, MP, PPL, __FILE__, __LINE__) @@ -90,7 +90,7 @@ typedef struct rsrv_put_notify { * * (dont drop below some max block threshold) */ -LOCAL void *casCalloc(size_t count, size_t size) +static void *casCalloc(size_t count, size_t size) { if ( UINT_MAX / size >= count ) { if (!osiSufficentSpaceInPool(size*count)) { @@ -108,7 +108,7 @@ LOCAL void *casCalloc(size_t count, size_t size) * * used to be a macro */ -LOCAL struct channel_in_use *MPTOPCIU (const caHdrLargeArray *mp) +static struct channel_in_use *MPTOPCIU (const caHdrLargeArray *mp) { struct channel_in_use *pciu; const unsigned id = mp->m_cid; @@ -127,7 +127,7 @@ LOCAL struct channel_in_use *MPTOPCIU (const caHdrLargeArray *mp) * send buffer lock must be on while in this routine * */ -LOCAL void vsend_err( +static void vsend_err( const caHdrLargeArray *curp, int status, struct client *client, @@ -242,7 +242,7 @@ va_list args * send buffer lock must be on while in this routine * */ -LOCAL void send_err ( +static void send_err ( const caHdrLargeArray *curp, int status, struct client *client, @@ -260,7 +260,7 @@ const char *pformat, * Debug aid - print the header part of a message. * */ -LOCAL void log_header ( +static void log_header ( const char *pContext, struct client *client, const caHdrLargeArray *mp, @@ -298,7 +298,7 @@ LOCAL void log_header ( /* * logBadIdWithFileAndLineno() */ -LOCAL void logBadIdWithFileAndLineno( +static void logBadIdWithFileAndLineno( struct client *client, caHdrLargeArray *mp, const void *pPayload, @@ -316,7 +316,7 @@ unsigned lineno /* * bad_udp_cmd_action() */ -LOCAL int bad_udp_cmd_action ( caHdrLargeArray *mp, +static int bad_udp_cmd_action ( caHdrLargeArray *mp, void *pPayload, struct client *pClient ) { log_header ("invalid (damaged?) request code from UDP", @@ -327,7 +327,7 @@ LOCAL int bad_udp_cmd_action ( caHdrLargeArray *mp, /* * udp_echo_action() */ -LOCAL int udp_echo_action ( caHdrLargeArray *mp, +static int udp_echo_action ( caHdrLargeArray *mp, void *pPayload, struct client *pClient ) { char *pPayloadOut; @@ -347,7 +347,7 @@ LOCAL int udp_echo_action ( caHdrLargeArray *mp, /* * bad_tcp_cmd_action() */ -LOCAL int bad_tcp_cmd_action ( caHdrLargeArray *mp, void *pPayload, +static int bad_tcp_cmd_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { const char *pCtx = "invalid (damaged?) request code from TCP"; @@ -367,7 +367,7 @@ LOCAL int bad_tcp_cmd_action ( caHdrLargeArray *mp, void *pPayload, /* * tcp_version_action() */ -LOCAL int tcp_version_action ( caHdrLargeArray *mp, void *pPayload, +static int tcp_version_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { double tmp; @@ -408,7 +408,7 @@ LOCAL int tcp_version_action ( caHdrLargeArray *mp, void *pPayload, /* * tcp_echo_action() */ -LOCAL int tcp_echo_action ( caHdrLargeArray *mp, +static int tcp_echo_action ( caHdrLargeArray *mp, void *pPayload, struct client *pClient ) { char *pPayloadOut; @@ -428,7 +428,7 @@ LOCAL int tcp_echo_action ( caHdrLargeArray *mp, /* * events_on_action () */ -LOCAL int events_on_action ( caHdrLargeArray *mp, +static int events_on_action ( caHdrLargeArray *mp, void *pPayload, struct client *pClient ) { db_event_flow_ctrl_mode_off ( pClient->evuser ); @@ -438,7 +438,7 @@ LOCAL int events_on_action ( caHdrLargeArray *mp, /* * events_off_action () */ -LOCAL int events_off_action ( caHdrLargeArray *mp, +static int events_off_action ( caHdrLargeArray *mp, void *pPayload, struct client *pClient ) { db_event_flow_ctrl_mode_on ( pClient->evuser ); @@ -453,7 +453,7 @@ LOCAL int events_off_action ( caHdrLargeArray *mp, * substantial complication introduced here by the need for backwards * compatibility */ -LOCAL void no_read_access_event ( struct client *pClient, +static void no_read_access_event ( struct client *pClient, struct event_ext *pevext ) { char *pPayloadOut; @@ -498,7 +498,7 @@ LOCAL void no_read_access_event ( struct client *pClient, /* * read_reply() */ -LOCAL void read_reply ( void *pArg, struct dbAddr *paddr, +static void read_reply ( void *pArg, struct dbAddr *paddr, int eventsRemaining, db_field_log *pfl ) { ca_uint32_t cid; @@ -634,7 +634,7 @@ LOCAL void read_reply ( void *pArg, struct dbAddr *paddr, /* * read_action () */ -LOCAL int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *pClient ) +static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *pClient ) { struct channel_in_use *pciu = MPTOPCIU ( mp ); const int readAccess = asCheckGet ( pciu->asClientPVT ); @@ -729,7 +729,7 @@ LOCAL int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *pC /* * read_notify_action() */ -LOCAL int read_notify_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) +static int read_notify_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { struct channel_in_use *pciu; struct event_ext evext; @@ -762,7 +762,7 @@ LOCAL int read_notify_action ( caHdrLargeArray *mp, void *pPayload, struct clien /* * write_action() */ -LOCAL int write_action ( caHdrLargeArray *mp, +static int write_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { struct channel_in_use *pciu; @@ -839,7 +839,7 @@ LOCAL int write_action ( caHdrLargeArray *mp, /* * host_name_action() */ -LOCAL int host_name_action ( caHdrLargeArray *mp, void *pPayload, +static int host_name_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { unsigned size; @@ -918,7 +918,7 @@ LOCAL int host_name_action ( caHdrLargeArray *mp, void *pPayload, /* * client_name_action() */ -LOCAL int client_name_action ( caHdrLargeArray *mp, void *pPayload, +static int client_name_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { unsigned size; @@ -993,7 +993,7 @@ LOCAL int client_name_action ( caHdrLargeArray *mp, void *pPayload, /* * casCreateChannel () */ -LOCAL struct channel_in_use *casCreateChannel ( +static struct channel_in_use *casCreateChannel ( struct client *client, struct dbAddr *pAddr, unsigned cid @@ -1073,7 +1073,7 @@ unsigned cid * If access right state changes then inform the client. * */ -LOCAL void casAccessRightsCB(ASCLIENTPVT ascpvt, asClientStatus type) +static void casAccessRightsCB(ASCLIENTPVT ascpvt, asClientStatus type) { struct client * pclient; struct channel_in_use * pciu; @@ -1146,7 +1146,7 @@ LOCAL void casAccessRightsCB(ASCLIENTPVT ascpvt, asClientStatus type) /* * access_rights_reply() */ -LOCAL void access_rights_reply ( struct channel_in_use * pciu ) +static void access_rights_reply ( struct channel_in_use * pciu ) { unsigned ar; int v41; @@ -1186,7 +1186,7 @@ LOCAL void access_rights_reply ( struct channel_in_use * pciu ) /* * claim_ciu_reply() */ -LOCAL void claim_ciu_reply ( struct channel_in_use * pciu ) +static void claim_ciu_reply ( struct channel_in_use * pciu ) { int v42 = CA_V42 ( pciu->client->minor_version_number ); access_rights_reply ( pciu ); @@ -1224,7 +1224,7 @@ LOCAL void claim_ciu_reply ( struct channel_in_use * pciu ) /* * claim_ciu_action() */ -LOCAL int claim_ciu_action ( caHdrLargeArray *mp, +static int claim_ciu_action ( caHdrLargeArray *mp, void *pPayload, client *client ) { int status; @@ -1390,7 +1390,7 @@ LOCAL int claim_ciu_action ( caHdrLargeArray *mp, * * (called by the db call back thread) */ -LOCAL void write_notify_call_back(putNotify *ppn) +static void write_notify_call_back(putNotify *ppn) { struct channel_in_use * pciu = (struct channel_in_use *) ppn->usrPvt; struct client * pClient; @@ -1429,7 +1429,7 @@ LOCAL void write_notify_call_back(putNotify *ppn) * write_notify_reply() * (called by the CA server event task via the extra labor interface) */ -LOCAL void write_notify_reply ( struct client * pClient ) +static void write_notify_reply ( struct client * pClient ) { while(TRUE){ caHdrLargeArray msgtmp; @@ -1505,7 +1505,7 @@ LOCAL void write_notify_reply ( struct client * pClient ) /* * sendAllUpdateAS() */ -LOCAL void sendAllUpdateAS ( struct client *client ) +static void sendAllUpdateAS ( struct client *client ) { struct channel_in_use *pciu; @@ -1549,7 +1549,7 @@ void rsrv_extra_labor ( void * pArg ) /* * putNotifyErrorReply */ -LOCAL void putNotifyErrorReply ( struct client *client, caHdrLargeArray *mp, int statusCA ) +static void putNotifyErrorReply ( struct client *client, caHdrLargeArray *mp, int statusCA ) { int status; @@ -1698,7 +1698,7 @@ void rsrvFreePutNotify ( client *pClient, /* * write_notify_action() */ -LOCAL int write_notify_action ( caHdrLargeArray *mp, void *pPayload, +static int write_notify_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { unsigned size; @@ -1830,7 +1830,7 @@ LOCAL int write_notify_action ( caHdrLargeArray *mp, void *pPayload, * event_add_action() * */ -LOCAL int event_add_action (caHdrLargeArray *mp, void *pPayload, struct client *client) +static int event_add_action (caHdrLargeArray *mp, void *pPayload, struct client *client) { struct mon_info *pmi = (struct mon_info *) pPayload; int spaceAvailOnFreeList; @@ -1935,7 +1935,7 @@ LOCAL int event_add_action (caHdrLargeArray *mp, void *pPayload, struct client * /* * clear_channel_reply() */ -LOCAL int clear_channel_reply ( caHdrLargeArray *mp, +static int clear_channel_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { struct event_ext *pevext; @@ -2039,7 +2039,7 @@ LOCAL int clear_channel_reply ( caHdrLargeArray *mp, * Much more efficient now since the event blocks hang off the channel in use * blocks not all together off the client block. */ -LOCAL int event_cancel_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) +static int event_cancel_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { struct channel_in_use *pciu; struct event_ext *pevext; @@ -2111,7 +2111,7 @@ LOCAL int event_cancel_reply ( caHdrLargeArray *mp, void *pPayload, struct clien /* * read_sync_reply() */ -LOCAL int read_sync_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) +static int read_sync_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { int status; SEND_LOCK(client); @@ -2133,7 +2133,7 @@ LOCAL int read_sync_reply ( caHdrLargeArray *mp, void *pPayload, struct client * * Only when requested by the client * send search failed reply */ -LOCAL void search_fail_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client) +static void search_fail_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client) { int status; SEND_LOCK ( client ); @@ -2151,7 +2151,7 @@ LOCAL void search_fail_reply ( caHdrLargeArray *mp, void *pPayload, struct clien /* * udp_version_action() */ -LOCAL int udp_version_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) +static int udp_version_action ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { if ( mp->m_count != 0 ) { client->minor_version_number = mp->m_count; @@ -2192,7 +2192,7 @@ int rsrv_version_reply ( struct client *client ) /* * search_reply() */ -LOCAL int search_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) +static int search_reply ( caHdrLargeArray *mp, void *pPayload, struct client *client ) { struct dbAddr tmp_addr; ca_uint16_t *pMinorVersion; @@ -2304,7 +2304,7 @@ typedef int (*pProtoStubTCP) (caHdrLargeArray *mp, void *pPayload, struct client /* * TCP protocol jump table */ -LOCAL const pProtoStubTCP tcpJumpTable[] = +static const pProtoStubTCP tcpJumpTable[] = { tcp_version_action, event_add_action, @@ -2340,7 +2340,7 @@ LOCAL const pProtoStubTCP tcpJumpTable[] = * UDP protocol jump table */ typedef int (*pProtoStubUDP) (caHdrLargeArray *mp, void *pPayload, struct client *client); -LOCAL const pProtoStubUDP udpJumpTable[] = +static const pProtoStubUDP udpJumpTable[] = { udp_version_action, bad_udp_cmd_action, diff --git a/src/rsrv/caservertask.c b/src/rsrv/caservertask.c index 43204c254..8140a5ab5 100644 --- a/src/rsrv/caservertask.c +++ b/src/rsrv/caservertask.c @@ -60,7 +60,7 @@ epicsThreadPrivateId rsrvCurrentClient; * handle each of them * */ -LOCAL void req_server (void *pParm) +static void req_server (void *pParm) { unsigned priorityOfSelf = epicsThreadGetPrioritySelf (); unsigned priorityOfBeacons; @@ -332,7 +332,7 @@ int rsrv_pause (void) return RSRV_OK; } -LOCAL unsigned countChanListBytes ( +static unsigned countChanListBytes ( struct client *client, ELLLIST * pList ) { struct channel_in_use * pciu; @@ -351,7 +351,7 @@ LOCAL unsigned countChanListBytes ( return bytes_reserved; } -LOCAL void showChanList ( +static void showChanList ( struct client * client, ELLLIST * pList ) { unsigned i = 0u; @@ -375,7 +375,7 @@ LOCAL void showChanList ( /* * log_one_client () */ -LOCAL void log_one_client (struct client *client, unsigned level) +static void log_one_client (struct client *client, unsigned level) { char *pproto; double send_delay; @@ -610,7 +610,7 @@ void destroy_client ( struct client *client ) freeListFree ( rsrvClientFreeList, client ); } -LOCAL void destroyAllChannels ( +static void destroyAllChannels ( struct client * client, ELLLIST * pList ) { if ( !client->chanListLock || !client->eventqLock ) { diff --git a/src/rsrv/cast_server.c b/src/rsrv/cast_server.c index 3569e099d..27cbea355 100644 --- a/src/rsrv/cast_server.c +++ b/src/rsrv/cast_server.c @@ -54,7 +54,7 @@ /* * clean_addrq */ -LOCAL void clean_addrq(void) +static void clean_addrq(void) { struct channel_in_use * pciu; struct channel_in_use * pnextciu; diff --git a/src/rsrv/server.h b/src/rsrv/server.h index 4df62aef8..443c0686e 100644 --- a/src/rsrv/server.h +++ b/src/rsrv/server.h @@ -39,8 +39,6 @@ #define epicsExportSharedSymbols #endif -#define LOCAL static - /* a modified ca header with capacity for large arrays */ typedef struct caHdrLargeArray { ca_uint32_t m_postsize; /* size of message extension */ diff --git a/src/util/ca_test.c b/src/util/ca_test.c index e2c2d8699..f7c6ab023 100644 --- a/src/util/ca_test.c +++ b/src/util/ca_test.c @@ -22,18 +22,14 @@ #include #include -#ifndef LOCAL -#define LOCAL static -#endif - #include "cadef.h" #include "epicsTime.h" int ca_test(char *pname, char *pvalue); -LOCAL int cagft(char *pname); -LOCAL void printit(struct event_handler_args args); -LOCAL int capft(char *pname, char *pvalue); -LOCAL void verify_value(chid chan_id, chtype type); +static int cagft(char *pname); +static void printit(struct event_handler_args args); +static int capft(char *pname, char *pvalue); +static void verify_value(chid chan_id, chtype type); static unsigned long outstanding; @@ -70,7 +66,7 @@ char *pvalue * * test ca get over the range of CA data types */ -LOCAL int cagft(char *pname) +static int cagft(char *pname) { const unsigned maxTries = 1000ul; unsigned ntries = 0u; @@ -158,7 +154,7 @@ LOCAL int cagft(char *pname) /* * PRINTIT() */ -LOCAL void printit ( struct event_handler_args args ) +static void printit ( struct event_handler_args args ) { if ( args.status == ECA_NORMAL ) { ca_dump_dbr ( args.type, args.count, args.dbr ); @@ -176,7 +172,7 @@ LOCAL void printit ( struct event_handler_args args ) * test ca_put() over a range of data types * */ -LOCAL int capft( +static int capft( char *pname, char *pvalue ) @@ -310,7 +306,7 @@ skip_rest: * * initiate print out the values in a database access interface structure */ -LOCAL void verify_value(chid chan_id, chtype type) +static void verify_value(chid chan_id, chtype type) { int status;