Clean up compiler warnings.
This commit is contained in:
@@ -103,12 +103,14 @@ static int aitConvertStringString(void* d,const void* s,
|
||||
for(i=0;i<c;i++) out[i]=in[i];
|
||||
return 0;
|
||||
}
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetStringString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{ return aitConvertStringString(d,s,c, pEnumStringTable);}
|
||||
static int aitConvertFromNetStringString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{ return aitConvertStringString(d,s,c, pEnumStringTable);}
|
||||
#endif
|
||||
|
||||
/* ------ all the fixed string conversion functions ------ */
|
||||
static int aitConvertFixedStringFixedString(void* d,const void* s,
|
||||
@@ -118,12 +120,14 @@ static int aitConvertFixedStringFixedString(void* d,const void* s,
|
||||
memcpy(d,s,len);
|
||||
return 0;
|
||||
}
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetFixedStringFixedString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{ return aitConvertFixedStringFixedString(d,s,c,pEnumStringTable);}
|
||||
static int aitConvertFromNetFixedStringFixedString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{ return aitConvertFixedStringFixedString(d,s,c,pEnumStringTable);}
|
||||
#endif
|
||||
|
||||
static int aitConvertStringFixedString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *)
|
||||
@@ -156,6 +160,7 @@ static int aitConvertFixedStringString(void* d,const void* s,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetStringFixedString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{ return aitConvertStringFixedString(d,s,c,pEnumStringTable); }
|
||||
@@ -168,6 +173,7 @@ static int aitConvertToNetFixedStringString(void* d,const void* s,
|
||||
static int aitConvertFromNetStringFixedString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{ return aitConvertFixedStringString(d,s,c,pEnumStringTable); }
|
||||
#endif
|
||||
|
||||
static int aitConvertStringEnum16(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
@@ -202,6 +208,7 @@ static int aitConvertStringEnum16(void* d,const void* s,
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetStringEnum16(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{
|
||||
@@ -213,6 +220,7 @@ static int aitConvertFromNetStringEnum16(void* d,const void* s,
|
||||
{
|
||||
return aitConvertStringEnum16(d,s,c,pEnumStringTable);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int aitConvertFixedStringEnum16(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
@@ -248,6 +256,7 @@ static int aitConvertFixedStringEnum16(void* d,const void* s,
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetFixedStringEnum16(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{
|
||||
@@ -259,6 +268,7 @@ static int aitConvertFromNetFixedStringEnum16(void* d,const void* s,
|
||||
{
|
||||
return aitConvertFixedStringEnum16(d,s,c,pEnumStringTable);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int aitConvertEnum16FixedString (void* d,const void* s,aitIndex c,
|
||||
const gddEnumStringTable *pEnumStringTable)
|
||||
@@ -316,6 +326,7 @@ static int aitConvertEnum16FixedString (void* d,const void* s,aitIndex c,
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetEnum16FixedString(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{
|
||||
@@ -327,6 +338,7 @@ static int aitConvertFromNetEnum16FixedString(void* d,const void* s,
|
||||
{
|
||||
return aitConvertEnum16FixedString(d,s,c,pEnumStringTable);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int aitConvertEnum16String (void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
@@ -384,6 +396,7 @@ static int aitConvertEnum16String (void* d,const void* s,
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef AIT_NEED_BYTE_SWAP
|
||||
static int aitConvertToNetEnum16String(void* d,const void* s,
|
||||
aitIndex c, const gddEnumStringTable *pEnumStringTable)
|
||||
{
|
||||
@@ -395,6 +408,7 @@ static int aitConvertFromNetEnum16String(void* d,const void* s,
|
||||
{
|
||||
return aitConvertEnum16String(d,s,c,pEnumStringTable);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define AIT_CONVERT 1
|
||||
#include "aitConvertGenerated.cc"
|
||||
|
||||
@@ -35,7 +35,14 @@ typedef float aitFloat32;
|
||||
typedef double aitFloat64;
|
||||
typedef aitUint32 aitIndex;
|
||||
typedef void* aitPointer;
|
||||
typedef aitUint32 aitStatus;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
aitUint16 aitStat;
|
||||
aitUint16 aitSevr;
|
||||
} s;
|
||||
aitUint32 u;
|
||||
} aitStatus;
|
||||
|
||||
/* should the bool be added as a conversion type? it currently is not */
|
||||
typedef enum {
|
||||
|
||||
@@ -95,25 +95,26 @@ inline void gdd::setTimeStamp(const aitTimeStamp* const ts) { time_stamp=*ts; }
|
||||
inline void gdd::getTimeStamp(struct epicsTimeStamp* const ts) const { time_stamp.get(*ts); }
|
||||
inline void gdd::setTimeStamp(const struct epicsTimeStamp* const ts) { time_stamp=*ts; }
|
||||
|
||||
inline void gdd::setStatus(aitUint32 s) { status=s; }
|
||||
inline void gdd::getStatus(aitUint32& s) const { s=status; }
|
||||
inline void gdd::setStatus(aitUint32 s) { status.u = s; }
|
||||
inline void gdd::getStatus(aitUint32& s) const { s = status.u; }
|
||||
inline void gdd::setStatus(aitUint16 high, aitUint16 low)
|
||||
{ status=(((aitUint32)high)<<16)|low; }
|
||||
{ status.u = (aitUint32)high << 16 | low; }
|
||||
inline void gdd::getStatus(aitUint16& high, aitUint16& low) const
|
||||
{ high=(aitUint16)(status>>16); low=(aitUint16)(status&0x0000ffff); }
|
||||
{ high = (aitUint16)(status.u >> 16);
|
||||
low = (aitUint16)(status.u & 0x0000ffff); }
|
||||
|
||||
inline void gdd::setStat(aitUint16 s)
|
||||
{ aitUint16* x = (aitUint16*)&status; x[0]=s; }
|
||||
{ status.s.aitStat = s; }
|
||||
inline void gdd::setSevr(aitUint16 s)
|
||||
{ aitUint16* x = (aitUint16*)&status; x[1]=s; }
|
||||
{ status.s.aitSevr = s; }
|
||||
inline aitUint16 gdd::getStat(void) const
|
||||
{ aitUint16* x = (aitUint16*)&status; return x[0]; }
|
||||
{ return status.s.aitStat; }
|
||||
inline aitUint16 gdd::getSevr(void) const
|
||||
{ aitUint16* x = (aitUint16*)&status; return x[1]; }
|
||||
inline void gdd::getStatSevr(aitInt16& st, aitInt16& se) const
|
||||
{ st=getStat(); se=getSevr(); }
|
||||
inline void gdd::setStatSevr(aitInt16 st, aitInt16 se)
|
||||
{ setStat(st); setSevr(se); }
|
||||
{ return status.s.aitSevr; }
|
||||
inline void gdd::getStatSevr(aitInt16& stat, aitInt16& sevr) const
|
||||
{ stat = status.s.aitStat; sevr = status.s.aitSevr; }
|
||||
inline void gdd::setStatSevr(aitInt16 stat, aitInt16 sevr)
|
||||
{ status.s.aitStat = stat; status.s.aitSevr = sevr; }
|
||||
|
||||
inline gdd& gdd::operator=(const gdd& v)
|
||||
{ memcpy(this,&v,sizeof(gdd)); return *this; }
|
||||
|
||||
@@ -60,8 +60,10 @@ void gddGlobalCleanupAdd ( void * pBuf );
|
||||
#define gdd_NEWDEL_FUNC(fld) \
|
||||
void* operator new(size_t); \
|
||||
void operator delete(void*); \
|
||||
char* newdel_next(void) { char** x=(char**)&(fld); return *x; } \
|
||||
void newdel_setNext(char* n) { char** x=(char**)&(fld); *x=n; } \
|
||||
char* newdel_next(void) { char* pfld = (char *)&fld; \
|
||||
char** x = (char**)pfld; return *x; } \
|
||||
void newdel_setNext(char* n) { char* pfld = (char *)&fld; \
|
||||
char** x=(char**)pfld; *x=n; } \
|
||||
static void gddNewDelInit (void) { pNewdel_lock = new epicsMutex; } \
|
||||
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ public:
|
||||
protected:
|
||||
aitUint16 ref_cnt;
|
||||
void* arg;
|
||||
virtual ~gddDestructor () {}
|
||||
private:
|
||||
gdd_NEWDEL_DATA
|
||||
};
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
//
|
||||
// Smart Pointer Class for GDD
|
||||
// ( automatically takes care of referencing / unreferening a gdd each time that it is used )
|
||||
// ( handles referencing / unreferencing a gdd each time it is used )
|
||||
//
|
||||
// Author: Jeff Hill
|
||||
//
|
||||
@@ -59,7 +58,8 @@ template < class T >
|
||||
inline smartGDDPointerTemplate < T >::smartGDDPointerTemplate ( T & valueIn ) :
|
||||
pValue ( & valueIn )
|
||||
{
|
||||
assert ( ! this->pValue->reference () );
|
||||
gddStatus status = this->pValue->reference ();
|
||||
assert ( ! status );
|
||||
}
|
||||
|
||||
template < class T >
|
||||
@@ -67,7 +67,8 @@ inline smartGDDPointerTemplate < T >::smartGDDPointerTemplate ( T * pValueIn ) :
|
||||
pValue ( pValueIn )
|
||||
{
|
||||
if ( this->pValue != NULL ) {
|
||||
assert ( ! this->pValue->reference () );
|
||||
gddStatus status = this->pValue->reference ();
|
||||
assert ( ! status );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +78,8 @@ inline smartGDDPointerTemplate < T > ::
|
||||
pValue ( ptrIn.pValue )
|
||||
{
|
||||
if ( this->pValue != NULL ) {
|
||||
assert ( ! this->pValue->reference () );
|
||||
gddStatus status = this->pValue->reference ();
|
||||
assert ( ! status );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +87,8 @@ template < class T >
|
||||
inline smartGDDPointerTemplate < T > :: ~smartGDDPointerTemplate ()
|
||||
{
|
||||
if ( this->pValue != NULL ) {
|
||||
assert ( ! this->pValue->unreference () );
|
||||
gddStatus status = this->pValue->reference ();
|
||||
assert ( ! status );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +97,8 @@ inline void smartGDDPointerTemplate < T > :: set ( T * pNewValue )
|
||||
{
|
||||
if ( this->pValue != pNewValue ) {
|
||||
if ( pNewValue ) {
|
||||
assert ( ! pNewValue->reference () );
|
||||
gddStatus status = pNewValue->reference ();
|
||||
assert ( ! status );
|
||||
}
|
||||
if ( this->pValue ) {
|
||||
this->pValue->unreference ();
|
||||
|
||||
Reference in New Issue
Block a user