mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-18 10:46:33 +00:00
GCC/G++ build fixes, GitHub issue #563
This commit is contained in:
parent
ee1dc16e8f
commit
a4bc40542b
@ -50,7 +50,7 @@ public:
|
|||||||
inline int load() const
|
inline int load() const
|
||||||
{
|
{
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
return __sync_or_and_fetch(&_v,0);
|
return __sync_or_and_fetch(const_cast<int *>(&_v),0);
|
||||||
#else
|
#else
|
||||||
return _v.load();
|
return _v.load();
|
||||||
#endif
|
#endif
|
||||||
|
@ -100,7 +100,7 @@ Node::Node(void *uptr,void *tptr,const struct ZT_Node_Callbacks *callbacks,uint6
|
|||||||
} else {
|
} else {
|
||||||
idtmp[0] = RR->identity.address().toInt(); idtmp[1] = 0;
|
idtmp[0] = RR->identity.address().toInt(); idtmp[1] = 0;
|
||||||
n = stateObjectGet(tptr,ZT_STATE_OBJECT_IDENTITY_PUBLIC,idtmp,tmp,sizeof(tmp) - 1);
|
n = stateObjectGet(tptr,ZT_STATE_OBJECT_IDENTITY_PUBLIC,idtmp,tmp,sizeof(tmp) - 1);
|
||||||
if ((n > 0)&&(n < sizeof(RR->publicIdentityStr))&&(n < sizeof(tmp))) {
|
if ((n > 0)&&(n < (int)sizeof(RR->publicIdentityStr))&&(n < (int)sizeof(tmp))) {
|
||||||
if (memcmp(tmp,RR->publicIdentityStr,n))
|
if (memcmp(tmp,RR->publicIdentityStr,n))
|
||||||
stateObjectPut(tptr,ZT_STATE_OBJECT_IDENTITY_PUBLIC,idtmp,RR->publicIdentityStr,(unsigned int)strlen(RR->publicIdentityStr));
|
stateObjectPut(tptr,ZT_STATE_OBJECT_IDENTITY_PUBLIC,idtmp,RR->publicIdentityStr,(unsigned int)strlen(RR->publicIdentityStr));
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ public:
|
|||||||
case InetAddress::IP_SCOPE_GLOBAL:
|
case InetAddress::IP_SCOPE_GLOBAL:
|
||||||
case InetAddress::IP_SCOPE_SHARED:
|
case InetAddress::IP_SCOPE_SHARED:
|
||||||
case InetAddress::IP_SCOPE_PRIVATE:
|
case InetAddress::IP_SCOPE_PRIVATE:
|
||||||
for(int x=0;x<portCount;++x) {
|
for(int x=0;x<(int)portCount;++x) {
|
||||||
ip.setPort(ports[x]);
|
ip.setPort(ports[x]);
|
||||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(devname)));
|
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(devname)));
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ public:
|
|||||||
case InetAddress::IP_SCOPE_GLOBAL:
|
case InetAddress::IP_SCOPE_GLOBAL:
|
||||||
case InetAddress::IP_SCOPE_SHARED:
|
case InetAddress::IP_SCOPE_SHARED:
|
||||||
case InetAddress::IP_SCOPE_PRIVATE:
|
case InetAddress::IP_SCOPE_PRIVATE:
|
||||||
for(int x=0;x<portCount;++x) {
|
for(int x=0;x<(int)portCount;++x) {
|
||||||
ip.setPort(ports[x]);
|
ip.setPort(ports[x]);
|
||||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,ifname));
|
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,ifname));
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ public:
|
|||||||
case InetAddress::IP_SCOPE_GLOBAL:
|
case InetAddress::IP_SCOPE_GLOBAL:
|
||||||
case InetAddress::IP_SCOPE_SHARED:
|
case InetAddress::IP_SCOPE_SHARED:
|
||||||
case InetAddress::IP_SCOPE_PRIVATE:
|
case InetAddress::IP_SCOPE_PRIVATE:
|
||||||
for(int x=0;x<portCount;++x) {
|
for(int x=0;x<(int)portCount;++x) {
|
||||||
ip.setPort(ports[x]);
|
ip.setPort(ports[x]);
|
||||||
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(ifa->ifa_name)));
|
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(ifa->ifa_name)));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user