This commit is contained in:
Adam Ierymenko 2019-08-14 15:28:10 -07:00
parent 9740ab8bd6
commit 9461bc948f
No known key found for this signature in database
GPG key ID: 1657198823E52A61
5 changed files with 13 additions and 10 deletions

View file

@ -78,6 +78,7 @@ public:
typedef int difference_type; typedef int difference_type;
typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { return _b; } inline iterator begin() { return _b; }
inline iterator end() { return (_b + _l); } inline iterator end() { return (_b + _l); }
inline const_iterator begin() const { return _b; } inline const_iterator begin() const { return _b; }

View file

@ -57,7 +57,7 @@ private:
bool wrap; bool wrap;
public: public:
RingBuffer() : inline RingBuffer() :
begin(0), begin(0),
end(0), end(0),
wrap(false) wrap(false)

View file

@ -49,7 +49,7 @@ namespace ZeroTier {
class _ResetWithinScope class _ResetWithinScope
{ {
public: public:
_ResetWithinScope(void *tPtr,int64_t now,int inetAddressFamily,InetAddress::IpScope scope) : inline _ResetWithinScope(void *tPtr,int64_t now,int inetAddressFamily,InetAddress::IpScope scope) :
_now(now), _now(now),
_tPtr(tPtr), _tPtr(tPtr),
_family(inetAddressFamily), _family(inetAddressFamily),

View file

@ -72,11 +72,13 @@ private:
InetAddress reporterPhysicalAddress; InetAddress reporterPhysicalAddress;
InetAddress::IpScope scope; InetAddress::IpScope scope;
PhySurfaceKey() : reporter(),scope(InetAddress::IP_SCOPE_NONE) {} inline PhySurfaceKey() : reporter(),scope(InetAddress::IP_SCOPE_NONE) {}
PhySurfaceKey(const Address &r,const int64_t rol,const InetAddress &ra,InetAddress::IpScope s) : reporter(r),receivedOnLocalSocket(rol),reporterPhysicalAddress(ra),scope(s) {} inline PhySurfaceKey(const Address &r,const int64_t rol,const InetAddress &ra,InetAddress::IpScope s) : reporter(r),receivedOnLocalSocket(rol),reporterPhysicalAddress(ra),scope(s) {}
inline unsigned long hashCode() const { return ((unsigned long)reporter.toInt() + (unsigned long)scope); } inline unsigned long hashCode() const { return ((unsigned long)reporter.toInt() + (unsigned long)scope); }
inline bool operator==(const PhySurfaceKey &k) const { return ((reporter == k.reporter)&&(receivedOnLocalSocket == k.receivedOnLocalSocket)&&(reporterPhysicalAddress == k.reporterPhysicalAddress)&&(scope == k.scope)); } inline bool operator==(const PhySurfaceKey &k) const { return ((reporter == k.reporter)&&(receivedOnLocalSocket == k.receivedOnLocalSocket)&&(reporterPhysicalAddress == k.reporterPhysicalAddress)&&(scope == k.scope)); }
inline bool operator!=(const PhySurfaceKey &k) const { return (!(*this == k)); }
}; };
struct PhySurfaceEntry struct PhySurfaceEntry
{ {
@ -84,8 +86,8 @@ private:
uint64_t ts; uint64_t ts;
bool trusted; bool trusted;
PhySurfaceEntry() : mySurface(),ts(0),trusted(false) {} inline PhySurfaceEntry() : mySurface(),ts(0),trusted(false) {}
PhySurfaceEntry(const InetAddress &a,const uint64_t t) : mySurface(a),ts(t),trusted(false) {} inline PhySurfaceEntry(const InetAddress &a,const uint64_t t) : mySurface(a),ts(t),trusted(false) {}
}; };
const RuntimeEnvironment *RR; const RuntimeEnvironment *RR;

View file

@ -43,11 +43,11 @@ template<typename T>
class SharedPtr class SharedPtr
{ {
public: public:
SharedPtr() : _ptr((T *)0) {} inline SharedPtr() : _ptr((T *)0) {}
SharedPtr(T *obj) : _ptr(obj) { ++obj->__refCount; } inline SharedPtr(T *obj) : _ptr(obj) { ++obj->__refCount; }
SharedPtr(const SharedPtr &sp) : _ptr(sp._getAndInc()) {} inline SharedPtr(const SharedPtr &sp) : _ptr(sp._getAndInc()) {}
~SharedPtr() inline ~SharedPtr()
{ {
if (_ptr) { if (_ptr) {
if (--_ptr->__refCount <= 0) if (--_ptr->__refCount <= 0)