diff --git a/configure/RULES.Db b/configure/RULES.Db index d05dfb340..aea72b6a8 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -24,8 +24,8 @@ vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR) # dbExpand INSTALL_DBDFLAGS += -I $(INSTALL_DBD) INSTALL_DBFLAGS += -I $(INSTALL_DB) -DBDFLAGS = $(USR_DBDFLAGS) -I . -I .. $(INSTALL_DBDFLAGS) $(RELEASE_DBDFLAGS) -DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) -I. -I.. $(INSTALL_DBFLAGS) $(RELEASE_DBFLAGS) +DBDFLAGS = $(USR_DBDFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBDFLAGS) $(RELEASE_DBDFLAGS) +DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBFLAGS) $(RELEASE_DBFLAGS) ##################################################### # To allow os specific dbd files AND have the -j option work properly, diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index af7094cfb..7764c66b8 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -22,6 +22,7 @@ vpath %.cpp $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.C $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.rc $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.h $(USR_VPATH) $(ALL_SRC_DIRS) +vpath %.H $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.skel.static $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.y $(USR_VPATH) $(ALL_SRC_DIRS) vpath %.l $(USR_VPATH) $(ALL_SRC_DIRS) diff --git a/configure/os/CONFIG.Common.linux-arm b/configure/os/CONFIG.Common.linux-arm index 8b0a8c2a4..15dad9e9e 100644 --- a/configure/os/CONFIG.Common.linux-arm +++ b/configure/os/CONFIG.Common.linux-arm @@ -11,9 +11,6 @@ include $(CONFIG)/os/CONFIG.Common.linuxCommon ARCH_CLASS = arm -# Set a special definition for network order of Netwinder ARM floating point -ARCH_DEP_CPPFLAGS += -D_ARM_NWFP_ - ifeq ($(BUILD_CLASS),CROSS) VALID_BUILDS = Ioc GNU_TARGET = arm-linux diff --git a/configure/os/CONFIG.darwinCommon.darwinCommon b/configure/os/CONFIG.darwinCommon.darwinCommon index 2244276c6..dd794a02d 100644 --- a/configure/os/CONFIG.darwinCommon.darwinCommon +++ b/configure/os/CONFIG.darwinCommon.darwinCommon @@ -52,20 +52,6 @@ OP_SYS_CPPFLAGS += -Ddarwin OPT_CFLAGS_YES += -g OPT_CXXFLAGS_YES += -g -# -# The following two definitions enable the use of DarwinPorts packages. -# -OP_SYS_INCLUDES += -I/opt/local/include -# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist -OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /opt/local/lib/*)))) - -# -# The following two definitions enable the use of Fink packages. -# -OP_SYS_INCLUDES += -I/sw/include -# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist -OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /sw/lib/*)))) - # # Libraries for command-line editing. # diff --git a/configure/os/CONFIG_SITE.darwinCommon.darwinCommon b/configure/os/CONFIG_SITE.darwinCommon.darwinCommon new file mode 100644 index 000000000..e1690ba09 --- /dev/null +++ b/configure/os/CONFIG_SITE.darwinCommon.darwinCommon @@ -0,0 +1,20 @@ +# CONFIG_SITE.darwinCommon.darwinCommon +# +# $Revision-Id$ +# This file is maintained by the build community. +# +# Site specific definitions for darwin builds +#------------------------------------------------------- + +# Uncomment the following two definitions to enable the use of DarwinPorts packages. +# +#OP_SYS_INCLUDES += -I/opt/local/include +# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist +#OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /opt/local/lib/*)))) + +# Uncomment the following two definitions to enable the use of Fink packages. +# +#OP_SYS_INCLUDES += -I/sw/include +# dir/firstword/wildcard used to avoid warning -L: directory name (...) does not exist +#OP_SYS_LDFLAGS += $(addprefix -L,$(dir $(firstword $(wildcard /sw/lib/*)))) + diff --git a/src/ca/client/udpiiu.cpp b/src/ca/client/udpiiu.cpp index 625bead9f..4760583e9 100644 --- a/src/ca/client/udpiiu.cpp +++ b/src/ca/client/udpiiu.cpp @@ -397,6 +397,11 @@ void udpRecvThread::run () } while ( ! this->iiu.shutdownCmd ); } +/* for sunpro compiler */ +udpiiu::M_repeaterTimerNotify::~M_repeaterTimerNotify () +{ +} + /* * udpiiu::M_repeaterTimerNotify::repeaterRegistrationMessage () * diff --git a/src/ca/client/udpiiu.h b/src/ca/client/udpiiu.h index 2f9918e49..103547919 100644 --- a/src/ca/client/udpiiu.h +++ b/src/ca/client/udpiiu.h @@ -143,6 +143,7 @@ private: public: M_repeaterTimerNotify ( udpiiu & iiu ) : m_udpiiu ( iiu ) {} + ~M_repeaterTimerNotify (); /* for sunpro compiler */ // repeaterTimerNotify void repeaterRegistrationMessage ( unsigned attemptNumber ); diff --git a/src/ca/legacy/pcas/generic/st/casStreamOS.cc b/src/ca/legacy/pcas/generic/st/casStreamOS.cc index 12d2f2dab..e1fedb38a 100644 --- a/src/ca/legacy/pcas/generic/st/casStreamOS.cc +++ b/src/ca/legacy/pcas/generic/st/casStreamOS.cc @@ -230,6 +230,18 @@ void casStreamIOWakeup::show ( unsigned level ) const printf ( "}\n" ); } +// +// casStreamOS::armRecv () +// +inline void casStreamOS::armRecv() +{ + if ( ! this->pRdReg ) { + if ( ! this->inBufFull() ) { + this->pRdReg = new casStreamReadReg ( *this ); + } + } +} + // // casStreamIOWakeup::expire() // @@ -297,18 +309,6 @@ void casStreamIOWakeup::start ( casStreamOS &os ) this->pOS->printStatus ( "casStreamIOWakeup tmr start" ); } -// -// casStreamOS::armRecv () -// -inline void casStreamOS::armRecv() -{ - if ( ! this->pRdReg ) { - if ( ! this->inBufFull() ) { - this->pRdReg = new casStreamReadReg ( *this ); - } - } -} - // // casStreamOS::disarmRecv () // diff --git a/src/ioc/db/dbAccess.c b/src/ioc/db/dbAccess.c index 70d00a781..d1ea856ec 100644 --- a/src/ioc/db/dbAccess.c +++ b/src/ioc/db/dbAccess.c @@ -969,7 +969,7 @@ long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType, case DBR_CHAR: case DBR_UCHAR: - if (nRequest && *nRequest > 1) { + if (nRequest && *nRequest > 0) { maxlen = *nRequest - 1; break; } @@ -984,8 +984,8 @@ long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType, if (!status) status = dbFindField(&dbEntry, pfldDes->name); if (!status) { rtnString = dbGetString(&dbEntry); - strncpy(pbuf, rtnString, maxlen - 1); - pbuf[maxlen - 1] = 0; + strncpy(pbuf, rtnString, maxlen); + pbuf[maxlen] = 0; } dbFinishEntry(&dbEntry); } else { @@ -1028,7 +1028,7 @@ long epicsShareAPI dbGet(DBADDR *paddr, short dbrType, case DBR_CHAR: case DBR_UCHAR: - if (nRequest && *nRequest > 1) { + if (nRequest && *nRequest > 0) { maxlen = *nRequest - 1; break; } @@ -1037,8 +1037,8 @@ long epicsShareAPI dbGet(DBADDR *paddr, short dbrType, return S_db_badDbrtype; } - strncpy(pbuf, (char *)paddr->pfield, maxlen - 1); - pbuf[maxlen - 1] = 0; + strncpy(pbuf, (char *)paddr->pfield, maxlen); + pbuf[maxlen] = 0; return 0; } diff --git a/src/ioc/db/dbConvert.c b/src/ioc/db/dbConvert.c index f370e0aa2..4b7ad7da1 100644 --- a/src/ioc/db/dbConvert.c +++ b/src/ioc/db/dbConvert.c @@ -416,6 +416,13 @@ static long getCharChar( char *pbuffer = (char *)pto; char *psrc=(char *)(paddr->pfield); + if (paddr->pfldDes->field_type == DBF_STRING) { + /* This is a DBF_STRING field being read as a long string. + * The buffer we return must be zero-terminated. + */ + pbuffer[--nRequest] = 0; + if (nRequest == 0) return(0); + } if(nRequest==1 && offset==0) { *pbuffer = *psrc; return(0); @@ -436,6 +443,13 @@ static long getCharUchar( unsigned char *pbuffer = (unsigned char *)pto; char *psrc=(char *)(paddr->pfield); + if (paddr->pfldDes->field_type == DBF_STRING) { + /* This is a DBF_STRING field being read as a long string. + * The buffer we return must be zero-terminated. + */ + pbuffer[--nRequest] = 0; + if (nRequest == 0) return(0); + } if(nRequest==1 && offset==0) { *pbuffer = *psrc; return(0); diff --git a/src/ioc/db/dbTest.c b/src/ioc/db/dbTest.c index 433f3b5f4..9ef57f479 100644 --- a/src/ioc/db/dbTest.c +++ b/src/ioc/db/dbTest.c @@ -317,7 +317,7 @@ long epicsShareAPI dbpf(const char *pname,const char *pvalue) if (nameToAddr(pname, &addr)) return -1; /* For enumerated types must allow for ENUM rather than string*/ /* If entire field is digits then use DBR_ENUM else DBR_STRING*/ - if (addr.dbr_field_type == DBR_ENUM && !*pvalue && + if (addr.dbr_field_type == DBR_ENUM && *pvalue && strspn(pvalue,"0123456789") == strlen(pvalue)) { unsigned short value; diff --git a/src/libCom/iocsh/iocsh.cpp b/src/libCom/iocsh/iocsh.cpp index a3cbd22a1..c140e56a9 100644 --- a/src/libCom/iocsh/iocsh.cpp +++ b/src/libCom/iocsh/iocsh.cpp @@ -545,10 +545,19 @@ iocshBody (const char *pathname, const char *commandLine) lineno++; /* - * Ignore comment lines other than to echo - * them if they came from a script. + * Skip leading white-space */ - if (*raw == '#') { + icin = 0; + while ((c = raw[icin]) && isspace(c)) { + icin++; + } + + /* + * Ignore comment lines other than to echo + * them if they came from a script. This + * avoids macLib errors from comments. + */ + if (c == '#') { if ((prompt == NULL) && (commandLine == NULL)) puts(raw); continue; @@ -562,15 +571,28 @@ iocshBody (const char *pathname, const char *commandLine) continue; /* - * Echo commands read from scripts + * Skip leading white-space coming from a macro + */ + while ((c = line[icin]) && isspace(c)) { + icin++; + } + + /* + * Echo non-empty lines read from a script */ if ((prompt == NULL) && *line && (commandLine == NULL)) puts(line); + /* + * Ignore lines that became a comment or empty after macro expansion + */ + if (!c || c == '#') + continue; + /* * Break line into words */ - icout = icin = 0; + icout = 0; inword = 0; argc = 0; quote = EOF; diff --git a/src/libCom/osi/os/WIN32/osdThread.c b/src/libCom/osi/os/WIN32/osdThread.c index c880fbd1a..86f7b7df7 100644 --- a/src/libCom/osi/os/WIN32/osdThread.c +++ b/src/libCom/osi/os/WIN32/osdThread.c @@ -446,7 +446,10 @@ epicsShareFunc epicsThreadBooleanStatus epicsShareAPI epicsThreadHighestPriority epicsShareFunc unsigned int epicsShareAPI epicsThreadGetStackSize ( epicsThreadStackSizeClass stackSizeClass ) { - static const unsigned stackSizeTable[epicsThreadStackBig+1] = {4000, 6000, 11000}; + #define STACK_SIZE(f) (f * 0x10000 * sizeof(void *)) + static const unsigned stackSizeTable[epicsThreadStackBig+1] = { + STACK_SIZE(1), STACK_SIZE(2), STACK_SIZE(4) + }; if (stackSizeClass #include #include diff --git a/src/template/base/top/caClientApp/caMonitor.c b/src/template/base/top/caClientApp/caMonitor.c index 9bd77e8ea..059fefb5e 100644 --- a/src/template/base/top/caClientApp/caMonitor.c +++ b/src/template/base/top/caClientApp/caMonitor.c @@ -1,7 +1,9 @@ /*caMonitor.c*/ -/* This example accepts a file containing a list of pvs to monitor - * It prints a message for all ca evemts: connection, access rights, data + +/* This example accepts the name of a file containing a list of pvs to monitor. + * It prints a message for all ca events: connection, access rights and monitor. */ + #include #include #include @@ -110,18 +112,18 @@ int main(int argc,char **argv) SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create"); SEVCHK(ca_add_exception_event(exceptionCallback,NULL), "ca_add_exception_event"); - for(i=0; imychid), "ca_create_channel"); SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid, accessRightsCallback), "ca_replace_access_rights_event"); - SEVCHK(ca_add_event(DBR_STRING,pmynode[i]->mychid,eventCallback, - pmynode[i],&pmynode[i]->myevid), - "ca_add_event"); + SEVCHK(ca_create_subscription(DBR_STRING,1,pmynode[i]->mychid, + DBE_VALUE,eventCallback,pmynode[i],&pmynode[i]->myevid), + "ca_create_subscription"); } /*Should never return from following call*/ SEVCHK(ca_pend_event(0.0),"ca_pend_event"); - return(0); + return 0; } diff --git a/src/tools/makeDbDepends.pl b/src/tools/makeDbDepends.pl index 16834de10..1366091c7 100644 --- a/src/tools/makeDbDepends.pl +++ b/src/tools/makeDbDepends.pl @@ -14,8 +14,8 @@ my $target = shift @ARGV; my %depends; while (my $line = <>) { - $depends{$2}++ if $line =~ m/^\s*file\s*(["']?)(.*)\1/; - $depends{$1}++ if $line =~ m/^\s*include\s+"(.*)"/; + $depends{$2}++ if $line =~ m/^ \s* file \s* (["']?) (\S*) \1 /x; + $depends{$1}++ if $line =~ m/^ \s* include \s* "(.*)" /x; } if (%depends) {