diff --git a/src/libCom/env/envSubr.c b/src/libCom/env/envSubr.c index 644ffad25..a2bf0f00a 100644 --- a/src/libCom/env/envSubr.c +++ b/src/libCom/env/envSubr.c @@ -75,11 +75,16 @@ #include #include +#include "shareLib.h" + +epicsShareFunc int putenv ( const char *envstring ); /* not in ANSI C */ + #define epicsExportSharedSymbols #include "errMdef.h" #include "envDefs.h" #include "epicsAssert.h" + /*+/subr********************************************************************** * NAME envGetConfigParamPtr - returns a pointer to the configuration diff --git a/src/libCom/fdmgr/fdmgr.cpp b/src/libCom/fdmgr/fdmgr.cpp index 70ed9be3f..c5cddc378 100644 --- a/src/libCom/fdmgr/fdmgr.cpp +++ b/src/libCom/fdmgr/fdmgr.cpp @@ -141,8 +141,8 @@ private: osiTimerForOldFdmgr::osiTimerForOldFdmgr (oldFdmgr &fdmgrIn, double delayIn, pCallBackFDMgr pFuncIn, void *pParamIn) : - fdmgr (fdmgrIn), osiTimer (delayIn, fdmgrIn.timerQueueRef ()), - pFunc (pFuncIn), pParam(pParamIn) + osiTimer (delayIn, fdmgrIn.timerQueueRef ()), + fdmgr (fdmgrIn), pFunc (pFuncIn), pParam(pParamIn) { if (pFuncIn==NULL) { # ifdef noExceptionsFromCXX @@ -279,6 +279,7 @@ extern "C" epicsShareFunc int epicsShareAPI fdmgr_add_callback ( oldFdmgr *pfdm = static_cast (pfdctx); fdRegForOldFdmgr *pfdrbc; bool onceOnly = (fdi==fdi_write); + unsigned fdiType; if (pfdm==NULL) { return -1; @@ -288,15 +289,21 @@ extern "C" epicsShareFunc int epicsShareAPI fdmgr_add_callback ( return -1; } - if (fdi<0 || fdi>=fdiToFdRegTypeNElements) { + if (fdi<0) { + return -1; + } + + fdiType = (unsigned) fdi; + + if (fdiType>=fdiToFdRegTypeNElements) { return -1; } # ifdef noExceptionsFromCXX - pfdrbc = new fdRegForOldFdmgr (fd, fdiToFdRegType[fdi], onceOnly, *pfdm, pFunc, pParam); + pfdrbc = new fdRegForOldFdmgr (fd, fdiToFdRegType[fdiType], onceOnly, *pfdm, pFunc, pParam); # else try { - pfdrbc = new fdRegForOldFdmgr (fd, fdiToFdRegType[fdi], onceOnly, *pfdm, pFunc, pParam); + pfdrbc = new fdRegForOldFdmgr (fd, fdiToFdRegType[fdiType], onceOnly, *pfdm, pFunc, pParam); } catch (...) { diff --git a/src/libCom/timer/osiTimer.cpp b/src/libCom/timer/osiTimer.cpp index 9b5b1b633..b677194e4 100644 --- a/src/libCom/timer/osiTimer.cpp +++ b/src/libCom/timer/osiTimer.cpp @@ -319,7 +319,7 @@ void osiTimer::unlock () const // osiTimerQueue::osiTimerQueue (unsigned managerThreadPriority) : osiThread ("osiTimerQueue", threadGetStackSize (threadStackMedium), managerThreadPriority), - inProcess (false), pExpireTmr (0), terminateFlag (false) + pExpireTmr (0), inProcess (false), terminateFlag (false) { } diff --git a/src/libCom/timer/osiTimer.h b/src/libCom/timer/osiTimer.h index fc8bfcae3..991b44ed4 100644 --- a/src/libCom/timer/osiTimer.h +++ b/src/libCom/timer/osiTimer.h @@ -167,7 +167,7 @@ class osiTimerQueue : public osiThread { friend class osiTimer; public: osiTimerQueue (unsigned managerThreadPriority = threadPriorityMin); - ~osiTimerQueue(); + virtual ~osiTimerQueue(); double delayToFirstExpire () const; // returns seconds void process (); void show (unsigned level) const;