- fixed few warnings
This commit is contained in:
parent
5fb8f87b11
commit
b6a8312c7b
|
|
@ -47,7 +47,7 @@ void NullTimer::run()
|
|||
// Sleep for mInterval - mTail milliseconds
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(mInterval * 1000 - mTail));
|
||||
|
||||
mTail += std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - timestamp).count();
|
||||
mTail += (int)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - timestamp).count();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ uint64_t StringHelper::toUint64(const char* s, uint64_t def, bool *isOk)
|
|||
{
|
||||
uint64_t result = def;
|
||||
#if defined(TARGET_WIN)
|
||||
if (sscanf(s, "%d", &result) != 1)
|
||||
if (sscanf(s, "%I64d", &result) != 1)
|
||||
#else
|
||||
if (sscanf(s, "%llu", &result) != 1)
|
||||
#endif
|
||||
|
|
@ -290,7 +290,7 @@ static int hex2code(char s)
|
|||
|
||||
static int hex2code(const char* s)
|
||||
{
|
||||
return hex2code(s[0]) << 4 + hex2code(s[1]);
|
||||
return (hex2code(s[0]) << 4) + hex2code(s[1]);
|
||||
}
|
||||
|
||||
std::string StringHelper::fromHex2String(const std::string& s)
|
||||
|
|
|
|||
|
|
@ -208,6 +208,8 @@ bool Variant::operator == (const Variant& rhs) const
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Variant::operator != (const Variant& rhs) const
|
||||
|
|
|
|||
|
|
@ -528,9 +528,9 @@ std::string SevanaPVQA::mosToColor(float mos)
|
|||
|
||||
float mosFraction = (mos - 1.0f) / 4.0f;
|
||||
|
||||
end.mBlue += (start.mBlue - end.mBlue) * mosFraction;
|
||||
end.mGreen += (start.mGreen - end.mGreen) * mosFraction;
|
||||
end.mRed += (start.mRed - end.mRed) * mosFraction;
|
||||
end.mBlue += (uint8_t)((start.mBlue - end.mBlue) * mosFraction);
|
||||
end.mGreen += (uint8_t)((start.mGreen - end.mGreen) * mosFraction);
|
||||
end.mRed += (uint8_t)((start.mRed - end.mRed) * mosFraction);
|
||||
|
||||
return end.toHex();
|
||||
}
|
||||
|
|
@ -866,7 +866,7 @@ SevanaAqua::PFaultsReport SevanaAqua::loadFaultsReport(std::istream& input)
|
|||
if (parts.size() >= 3)
|
||||
{
|
||||
if (parts.back() == "ms.")
|
||||
result->mSignalAdvancedInMilliseconds = std::atof(parts[parts.size() - 2].c_str());
|
||||
result->mSignalAdvancedInMilliseconds = (float)std::atof(parts[parts.size() - 2].c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -879,7 +879,7 @@ SevanaAqua::PFaultsReport SevanaAqua::loadFaultsReport(std::istream& input)
|
|||
if (parts.size() >= 3)
|
||||
{
|
||||
if (parts.back() == "percent.")
|
||||
result->mMistimingInPercents = std::atof(parts[parts.size() - 2].c_str());
|
||||
result->mMistimingInPercents = (float)std::atof(parts[parts.size() - 2].c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,6 @@ set (ICE_STACK_SOURCES ICEAddress.cpp
|
|||
ICETime.cpp
|
||||
ICETransactionList.cpp)
|
||||
|
||||
add_definitions(-DUSE_NATIVE_SMARTPTR)
|
||||
add_definitions(-DUSE_NATIVE_SMARTPTR -D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
|
||||
add_library(ice_stack ${ICE_STACK_SOURCES})
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ static void EmbedAttrBuffer(StunAttribute& attr, BufferWriter& writer)
|
|||
writer.writeUShort(attr.type());
|
||||
|
||||
// Enqueue length
|
||||
writer.writeUShort(attrBuffer.size());
|
||||
writer.writeUShort((uint16_t)attrBuffer.size());
|
||||
|
||||
// Save data offset in generated buffer
|
||||
attr.setDataOffset(writer.offset() + 2); // 2 is for first 16 bits written by bitstream
|
||||
|
|
@ -281,7 +281,7 @@ void StunMessage::buildPacket(ByteBuffer& buffer, const std::string& password)
|
|||
buffer.resize(stream.offset() + 2);
|
||||
|
||||
// Put length in header
|
||||
*((unsigned short*)buffer.mutableData() + 1) = htons(buffer.size() - STUN_HEADER_SIZE);
|
||||
*((unsigned short*)buffer.mutableData() + 1) = (uint16_t)(htons(buffer.size() - STUN_HEADER_SIZE));
|
||||
|
||||
// Check for fingerprint attribute
|
||||
fpIter = mAttrMap.find(StunAttribute::Fingerprint);
|
||||
|
|
@ -507,7 +507,7 @@ bool StunMessage::validatePacket(std::string key)
|
|||
unsigned short len = *lengthPtr;
|
||||
|
||||
// Set fake length including MessageIntegrity attribute but excluding any attributes behind of it and excluding STUN header size
|
||||
*lengthPtr = htons(mi.dataOffset() + HMAC_DIGEST_SIZE - STUN_HEADER_SIZE);
|
||||
*lengthPtr = (uint16_t)(htons(mi.dataOffset() + HMAC_DIGEST_SIZE - STUN_HEADER_SIZE));
|
||||
|
||||
// Find HMAC-SHA1 again
|
||||
hmacSha1Digest(mPacket2Parse.data(), mi.dataOffset() - 4, digest, key.c_str(), key.size());
|
||||
|
|
|
|||
Loading…
Reference in New Issue