mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-19 21:46:54 +02:00
Fix method name problem.
This commit is contained in:
parent
2ee550bbfd
commit
9db9211ed3
2 changed files with 21 additions and 21 deletions
|
@ -472,35 +472,35 @@ extern "C" const char *ZTT_general()
|
|||
return "Utils::storeMachineEndian() broken";
|
||||
}
|
||||
#else
|
||||
if (Utils::loadAsIsEndian<uint64_t>(&a) != 0x0807060504030201ULL) {
|
||||
ZT_T_PRINTF("FAILED (loadAsIsEndian)" ZT_EOL_S);
|
||||
return "Utils::loadAsIsEndian() broken";
|
||||
if (Utils::loadMachineEndian<uint64_t>(&a) != 0x0807060504030201ULL) {
|
||||
ZT_T_PRINTF("FAILED (loadMachineEndian)" ZT_EOL_S);
|
||||
return "Utils::loadMachineEndian() broken";
|
||||
}
|
||||
if (Utils::loadAsIsEndian<uint32_t>(&b) != 0x04030201) {
|
||||
ZT_T_PRINTF("FAILED (loadAsIsEndian)" ZT_EOL_S);
|
||||
return "Utils::loadAsIsEndian() broken";
|
||||
if (Utils::loadMachineEndian<uint32_t>(&b) != 0x04030201) {
|
||||
ZT_T_PRINTF("FAILED (loadMachineEndian)" ZT_EOL_S);
|
||||
return "Utils::loadMachineEndian() broken";
|
||||
}
|
||||
if (Utils::loadAsIsEndian<uint16_t>(&c) != 0x0201) {
|
||||
ZT_T_PRINTF("FAILED (loadAsIsEndian)" ZT_EOL_S);
|
||||
return "Utils::loadAsIsEndian() broken";
|
||||
if (Utils::loadMachineEndian<uint16_t>(&c) != 0x0201) {
|
||||
ZT_T_PRINTF("FAILED (loadMachineEndian)" ZT_EOL_S);
|
||||
return "Utils::loadMachineEndian() broken";
|
||||
}
|
||||
Utils::zero<sizeof(t)>(t);
|
||||
Utils::storeAsIsEndian<uint64_t>(t,0x0807060504030201ULL);
|
||||
Utils::storeMachineEndian<uint64_t>(t,0x0807060504030201ULL);
|
||||
if (t[0] != 8) {
|
||||
ZT_T_PRINTF("FAILED (storeAsIsEndian)" ZT_EOL_S);
|
||||
return "Utils::storeAsIsEndian() broken";
|
||||
ZT_T_PRINTF("FAILED (storeMachineEndian)" ZT_EOL_S);
|
||||
return "Utils::storeMachineEndian() broken";
|
||||
}
|
||||
Utils::zero<sizeof(t)>(t);
|
||||
Utils::storeAsIsEndian<uint32_t>(t,0x04030201);
|
||||
Utils::storeMachineEndian<uint32_t>(t,0x04030201);
|
||||
if (t[0] != 4) {
|
||||
ZT_T_PRINTF("FAILED (storeAsIsEndian)" ZT_EOL_S);
|
||||
return "Utils::storeAsIsEndian() broken";
|
||||
ZT_T_PRINTF("FAILED (storeMachineEndian)" ZT_EOL_S);
|
||||
return "Utils::storeMachineEndian() broken";
|
||||
}
|
||||
Utils::zero<sizeof(t)>(t);
|
||||
Utils::storeAsIsEndian<uint16_t>(t,0x0201);
|
||||
Utils::storeMachineEndian<uint16_t>(t,0x0201);
|
||||
if (t[0] != 2) {
|
||||
ZT_T_PRINTF("FAILED (storeAsIsEndian)" ZT_EOL_S);
|
||||
return "Utils::storeAsIsEndian() broken";
|
||||
ZT_T_PRINTF("FAILED (storeMachineEndian)" ZT_EOL_S);
|
||||
return "Utils::storeMachineEndian() broken";
|
||||
}
|
||||
#endif
|
||||
ZT_T_PRINTF("OK" ZT_EOL_S);
|
||||
|
|
|
@ -651,7 +651,7 @@ template< typename I >
|
|||
static ZT_INLINE void storeBigEndian(void *const p, I i) noexcept
|
||||
{
|
||||
#ifdef ZT_NO_UNALIGNED_ACCESS
|
||||
storeAsIsEndian(p,hton(i));
|
||||
storeMachineEndian(p,hton(i));
|
||||
#else
|
||||
*reinterpret_cast<I *>(p) = hton(i);
|
||||
#endif
|
||||
|
@ -685,10 +685,10 @@ template< typename I >
|
|||
static ZT_INLINE void storeLittleEndian(void *const p, const I i) noexcept
|
||||
{
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
storeAsIsEndian(p,_swap_bytes_bysize<I,sizeof(I)>::s(i));
|
||||
storeMachineEndian(p,_swap_bytes_bysize<I,sizeof(I)>::s(i));
|
||||
#else
|
||||
#ifdef ZT_NO_UNALIGNED_ACCESS
|
||||
storeAsIsEndian(p,i);
|
||||
storeMachineEndian(p,i);
|
||||
#else
|
||||
*reinterpret_cast<I *>(p) = i;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue