fixed gnu warnings

This commit is contained in:
Jeff Hill
2000-12-14 00:41:49 +00:00
parent a67a2852bc
commit 7a5b239bff
5 changed files with 58 additions and 43 deletions

View File

@@ -167,10 +167,10 @@ private:
unsigned nInUse;
resTableIndex hash (const ID & idIn) const;
T *find (tsSLList<T> &list, const ID &idIn) const;
T *findDelete (tsSLList<T> &list, const ID &idIn);
resTable ( const resTable & );
resTable & operator = ( const resTable & );
};
@@ -284,7 +284,7 @@ public:
class epicsShareClass dynamicMemoryAllocationFailed {};
enum allocationType {copyString, refString};
stringId (const char * idIn, allocationType typeIn=copyString);
~ stringId();
virtual ~stringId();
resTableIndex hash (unsigned nBitsIndex) const;
bool operator == (const stringId &idIn) const;
const char * resourceName() const; // return the pointer to the string
@@ -294,6 +294,7 @@ public:
private:
stringId & operator = ( const stringId & );
stringId ( const stringId &);
const char * pStr;
const allocationType allocType;
static const unsigned char fastHashPermutedIndexSpace[256];
@@ -307,8 +308,8 @@ private:
// resTable::resTable (unsigned nHashTableEntries)
//
template <class T, class ID>
resTable<T,ID>::resTable (unsigned nHashTableEntries) :
nInUse (0)
resTable<T,ID>::resTable ( unsigned nHashTableEntries ) :
pTable ( 0 ), hashIdMask ( 0 ), hashIdNBits ( 0 ), nInUse ( 0 )
{
unsigned nbits, mask = 0u;

View File

@@ -59,8 +59,9 @@ friend class tsSLIter < T >;
friend class tsSLIterConst < T >;
public:
tsSLNode ();
void operator = ( const tsSLNode < T > & ) const;
const tsSLNode < T > & operator = ( const tsSLNode < T > & ) const;
private:
tsSLNode ( const tsSLNode < T > & );
void removeNextItem (); // removes the item after this node
T *pNext;
};
@@ -103,8 +104,8 @@ public:
const T & operator * () const;
const T * operator -> () const;
tsSLIterConst<T> operator ++ (); // prefix ++
tsSLIterConst<T> operator ++ (int); // postfix ++
tsSLIterConst<T> & operator ++ (); // prefix ++
tsSLIterConst<T> & operator ++ (int); // postfix ++
# if defined(_MSC_VER) && _MSC_VER < 1200
tsSLIterConst (const class tsSLIterConst<T> &copyIn);
@@ -142,8 +143,8 @@ public:
T & operator * () const;
T * operator -> () const;
tsSLIter <T> operator ++ (); // prefix ++
tsSLIter <T> operator ++ (int); // postfix ++
tsSLIter <T> & operator ++ (); // prefix ++
tsSLIter <T> & operator ++ (int); // postfix ++
# if defined(_MSC_VER) && _MSC_VER < 1200
tsSLIter (class tsSLIter<T> &copyIn);
@@ -176,7 +177,10 @@ tsSLNode < T > ::tsSLNode () : pNext ( 0 ) {}
// do _not_ change the node pointers
//
template < class T >
inline void tsSLNode < T >::operator = ( const tsSLNode < T > & ) const {}
inline const tsSLNode < T > & tsSLNode < T >::operator = ( const tsSLNode < T > & ) const
{
return *this;
}
//
// removeNextItem ()
@@ -326,7 +330,7 @@ inline const T * tsSLIterConst<T>::operator -> () const
}
template < class T >
inline tsSLIterConst<T> tsSLIterConst<T>::operator ++ () // prefix ++
inline tsSLIterConst<T> & tsSLIterConst<T>::operator ++ () // prefix ++
{
const tsSLNode < T > *pCurNode = this->pConstEntry;
this->pConstEntry = pCurNode->pNext;
@@ -334,7 +338,7 @@ inline tsSLIterConst<T> tsSLIterConst<T>::operator ++ () // prefix ++
}
template < class T >
inline tsSLIterConst<T> tsSLIterConst<T>::operator ++ (int) // postfix ++
inline tsSLIterConst<T> & tsSLIterConst<T>::operator ++ (int) // postfix ++
{
tsSLIterConst<T> tmp = *this;
tsSLNode < T > *pCurNode = this->pConstEntry;
@@ -417,14 +421,14 @@ inline T * tsSLIter<T>::operator -> () const
}
template < class T >
inline tsSLIter<T> tsSLIter<T>::operator ++ () // prefix ++
inline tsSLIter<T> & tsSLIter<T>::operator ++ () // prefix ++
{
this->tsSLIterConst<T>::operator ++ ();
return *this;
}
template < class T >
inline tsSLIter<T> tsSLIter<T>::operator ++ (int) // postfix ++
inline tsSLIter<T> & tsSLIter<T>::operator ++ (int) // postfix ++
{
tsSLIter<T> tmp = *this;
this->tsSLIterConst<T>::operator ++ ();

View File

@@ -17,6 +17,8 @@ template <class T>
class sourceFileLocation : public T {
public:
sourceFileLocation (const T &parm, const char *fileName, unsigned lineNumber);
sourceFileLocation ( const sourceFileLocation & );
sourceFileLocation & operator = ( const sourceFileLocation & );
const char *fileName () const;
unsigned lineNumber () const;
private:
@@ -26,9 +28,23 @@ private:
template <class T>
inline sourceFileLocation<T>::sourceFileLocation (const T &parm, const char *fileName, unsigned lineNumber) :
T (parm), pFileName (fileName) , lineNumberCopy(lineNumber) {}
T ( parm ), pFileName ( fileName ) , lineNumberCopy ( lineNumber ) {}
template <class T>
inline sourceFileLocation<T>::sourceFileLocation ( const sourceFileLocation<T> &in ) :
T ( in ), pFileName ( in.pFileName ), lineNumberCopy ( in.lineNumberCopy )
{
}
template < class T >
inline sourceFileLocation<T> & sourceFileLocation<T>::operator = ( const sourceFileLocation<T> &in )
{
this->pFileName = in.pFileName;
this->lineNumberCopy = in.lineNumberCopy;
return *this;
}
template < class T >
inline unsigned sourceFileLocation<T>::lineNumber () const
{
return this->lineNumberCopy;

View File

@@ -80,11 +80,8 @@ static char *fracFormat (const char *pFormat, unsigned long *width);
//
// osiTime (const unsigned long secIn, const unsigned long nSecIn)
//
inline osiTime::osiTime (const unsigned long secIn, const unsigned long nSecIn)
{
this->secPastEpoch = nSecIn/nSecPerSec + secIn;
this->nSec = nSecIn%nSecPerSec;
}
inline osiTime::osiTime (const unsigned long secIn, const unsigned long nSecIn) :
secPastEpoch ( nSecIn / nSecPerSec + secIn ), nSec ( nSecIn % nSecPerSec ) {}
//
// osiTimeLoadTimeInit

View File

@@ -139,7 +139,7 @@ public:
//
operator TS_STAMP () const;
osiTime (const TS_STAMP &ts);
osiTime operator = (const TS_STAMP &rhs);
osiTime & operator = (const TS_STAMP &rhs);
//
// convert to and from ANSI C's "time_t"
@@ -150,42 +150,42 @@ public:
//
operator time_t_wrapper () const;
osiTime (const time_t_wrapper &tv);
osiTime operator = (const time_t_wrapper &rhs);
osiTime & operator = (const time_t_wrapper &rhs);
//
// convert to and from ANSI C's "struct tm" (with nano seconds)
//
operator tm_nano_sec () const;
osiTime (const tm_nano_sec &ts);
osiTime operator = (const tm_nano_sec &rhs);
osiTime & operator = (const tm_nano_sec &rhs);
//
// convert to and from POSIX RT's "struct timespec"
//
operator struct timespec () const;
osiTime (const struct timespec &ts);
osiTime operator = (const struct timespec &rhs);
osiTime & operator = (const struct timespec &rhs);
//
// convert to and from BSD's "struct timeval"
//
operator struct timeval () const;
osiTime (const struct timeval &ts);
osiTime operator = (const struct timeval &rhs);
osiTime & operator = (const struct timeval &rhs);
//
// convert to and from NTP timestamp format
//
operator ntpTimeStamp () const;
osiTime (const ntpTimeStamp &ts);
osiTime operator = (const ntpTimeStamp &rhs);
osiTime & operator = (const ntpTimeStamp &rhs);
//
// convert to and from GDD's aitTimeStamp format
//
operator aitTimeStamp () const;
osiTime (const aitTimeStamp &ts);
osiTime operator = (const aitTimeStamp &rhs);
osiTime & operator = (const aitTimeStamp &rhs);
//
// arithmetic operators
@@ -193,8 +193,8 @@ public:
double operator- (const osiTime &rhs) const; // returns seconds
osiTime operator+ (const double &rhs) const; // add rhs seconds
osiTime operator- (const double &rhs) const; // subtract rhs seconds
osiTime operator+= (const double &rhs); // add rhs seconds
osiTime operator-= (const double &rhs); // subtract rhs seconds
osiTime & operator+= (const double &rhs); // add rhs seconds
osiTime & operator-= (const double &rhs); // subtract rhs seconds
//
// comparison operators
@@ -249,11 +249,8 @@ private:
// type osiTime inline member functions
//
inline osiTime::osiTime (const TS_STAMP &ts)
{
this->secPastEpoch = ts.secPastEpoch;
this->nSec = ts.nsec;
}
inline osiTime::osiTime (const TS_STAMP &ts) :
secPastEpoch ( ts.secPastEpoch ), nSec ( ts.nsec ) {}
//
// getCurrent ()
@@ -295,13 +292,13 @@ inline osiTime osiTime::operator - (const double &rhs) const
return osiTime::operator + (-rhs);
}
inline osiTime osiTime::operator += (const double &rhs)
inline osiTime & osiTime::operator += (const double &rhs)
{
*this = osiTime::operator + (rhs);
return *this;
}
inline osiTime osiTime::operator -= (const double &rhs)
inline osiTime & osiTime::operator -= (const double &rhs)
{
*this = osiTime::operator + (-rhs);
return *this;
@@ -332,24 +329,24 @@ inline bool osiTime::operator > (const osiTime &rhs) const
return ! ( *this <= rhs );
}
inline osiTime osiTime::operator = (const tm_nano_sec &rhs)
inline osiTime & osiTime::operator = (const tm_nano_sec &rhs)
{
return *this = osiTime (rhs);
}
inline osiTime osiTime::operator = (const struct timespec &rhs)
inline osiTime & osiTime::operator = (const struct timespec &rhs)
{
*this = osiTime (rhs);
return *this;
}
inline osiTime osiTime::operator = (const aitTimeStamp &rhs)
inline osiTime & osiTime::operator = (const aitTimeStamp &rhs)
{
*this = osiTime (rhs);
return *this;
}
inline osiTime osiTime::operator = (const TS_STAMP &rhs)
inline osiTime & osiTime::operator = (const TS_STAMP &rhs)
{
*this = osiTime (rhs);
return *this;
@@ -364,14 +361,14 @@ inline osiTime::operator TS_STAMP () const
}
#ifdef NTP_SUPPORT
inline osiTime osiTime::operator = (const ntpTimeStamp &rhs)
inline osiTime & osiTime::operator = (const ntpTimeStamp &rhs)
{
*this = osiTime (rhs);
return *this;
}
#endif
inline osiTime osiTime::operator = (const time_t_wrapper &rhs)
inline osiTime & osiTime::operator = (const time_t_wrapper &rhs)
{
*this = osiTime (rhs);
return *this;