fixed gnu warnings

This commit is contained in:
Jeff Hill
2004-02-05 01:16:02 +00:00
parent a5fd9c839e
commit 0a93c81e2c
2 changed files with 18 additions and 27 deletions

View File

@@ -27,20 +27,9 @@ gdd_NEWDEL_NEW(gdd)
gdd_NEWDEL_DEL(gdd)
gdd_NEWDEL_STAT(gdd)
epicsMutex * gdd::pGlobalMutex = 0;
epicsThreadOnceId gdd::staticInitOnce = EPICS_THREAD_ONCE_INIT;
epicsMutex * gdd::pGlobalMutex;
// Can't pass C++ linkage static member function gdd::staticInit
// into epicsThreadOnce(); we need a C linkage function for that:
extern "C" {
static void gdd_staticInit(void *) { gdd::staticInit(); }
}
void gdd::staticInit (void)
{
gdd::pGlobalMutex = new epicsMutex;
assert ( gdd::pGlobalMutex );
}
static epicsThreadOnceId gddOnce = EPICS_THREAD_ONCE_INIT;
class gddFlattenDestructor : public gddDestructor
{
@@ -87,22 +76,31 @@ class gddAitStringDestructor: public gddDestructor {
// --------------------------The gdd functions-------------------------
static void gddStaticInit ( void * p )
{
epicsMutex * * pMutex = static_cast < epicsMutex * * > ( p );
*pMutex = new epicsMutex ();
}
gdd::staticInit ()
{
epicsThreadOnce ( & gddOnce, gddStaticInit, & gdd::pGlobalMutex );
}
gdd::gdd(int app, aitEnum prim, int dimen)
{
init(app,prim,dimen);
}
gdd::gdd(int app, aitEnum prim, int dimen, aitUint32* val)
gdd::gdd(int app, aitEnum prim, int dimen, aitUint32* val)
{
int i;
init(app,prim,dimen);
for(i=0;i<dimen;i++) bounds[i].set(0,val[i]);
for(int i=0;i<dimen;i++) bounds[i].set(0,val[i]);
}
void gdd::init(int app, aitEnum prim, int dimen)
{
epicsThreadOnce ( & gdd::staticInitOnce, gdd_staticInit, 0 );
gdd::staticInit ();
setApplType(app);
//
// joh - we intentionally dont call setPrimType()

View File

@@ -56,10 +56,6 @@ class gddScalar;
struct epicsTimeStamp;
struct timespec;
extern "C" {
static void gdd_staticInit(void *);
}
// Not Complete in this prototype:
// - Read only DD.
// - Small array management using free lists
@@ -501,19 +497,16 @@ protected:
aitUint8 dim; // 0=scaler, >0=array
gdd_NEWDEL_DATA // required for using generic new and remove
private:
mutable aitUint32 ref_cnt;
aitUint8 flags;
static epicsMutex * pGlobalMutex;
static epicsThreadOnceId staticInitOnce;
static void staticInit (void);
friend void gdd_staticInit(void *);
static staticInit ();
const gdd* indexDD (aitIndex index) const;
};
// include these to be backward compatible with first gdd library version
#include "gddArray.h"
#include "gddScalar.h"