提交 f8928b1d authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Update C++ code to satisfy new clang-tidy version (run `make format` in `worker/`)

上级 b60ba8a7
...@@ -46,10 +46,9 @@ namespace RTC ...@@ -46,10 +46,9 @@ namespace RTC
bool HasReceiverReferenceTime() bool HasReceiverReferenceTime()
{ {
return std::any_of( return std::any_of(
this->xrPacket.Begin(), this->xrPacket.Begin(), this->xrPacket.End(), [](const ExtendedReportBlock* report) {
this->xrPacket.End(), return report->GetType() == ExtendedReportBlock::Type::RRT;
[](const ExtendedReportBlock* report) });
{ return report->GetType() == ExtendedReportBlock::Type::RRT; });
} }
void Serialize(uint8_t* data); void Serialize(uint8_t* data);
......
...@@ -83,8 +83,7 @@ namespace RTC ...@@ -83,8 +83,7 @@ namespace RTC
{ {
// Get the limit value for possitive and negative totalLost. // Get the limit value for possitive and negative totalLost.
int32_t clamp = (totalLost >= 0) ? totalLost > 0x07FFFFF ? 0x07FFFFF : totalLost int32_t clamp = (totalLost >= 0) ? totalLost > 0x07FFFFF ? 0x07FFFFF : totalLost
: -totalLost > 0x0800000 ? 0x0800000 : -totalLost > 0x0800000 ? 0x0800000 : -totalLost;
: -totalLost;
uint32_t value = (totalLost >= 0) ? (clamp & 0x07FFFFF) : (clamp | 0x0800000); uint32_t value = (totalLost >= 0) ? (clamp & 0x07FFFFF) : (clamp | 0x0800000);
......
...@@ -17,10 +17,7 @@ void DepOpenSSL::ClassInit() ...@@ -17,10 +17,7 @@ void DepOpenSSL::ClassInit()
{ {
MS_TRACE(); MS_TRACE();
std::call_once( std::call_once(globalInitOnce, [] {
globalInitOnce,
[]
{
MS_DEBUG_TAG(info, "openssl version: \"%s\"", OpenSSL_version(OPENSSL_VERSION)); MS_DEBUG_TAG(info, "openssl version: \"%s\"", OpenSSL_version(OPENSSL_VERSION));
// Initialize some crypto stuff. // Initialize some crypto stuff.
......
...@@ -222,14 +222,11 @@ namespace RTC ...@@ -222,14 +222,11 @@ namespace RTC
return; return;
} }
const auto* cb = new onQueuedCallback( const auto* cb = new onQueuedCallback([&request](bool queued, bool sctpSendBufferFull) {
[&request](bool queued, bool sctpSendBufferFull)
{
if (queued) if (queued)
request->Accept(); request->Accept();
else else
request->Error( request->Error(sctpSendBufferFull == true ? "sctpsendbufferfull" : "message send failed");
sctpSendBufferFull == true ? "sctpsendbufferfull" : "message send failed");
}); });
SendMessage(ppid, msg, len, cb); SendMessage(ppid, msg, len, cb);
......
...@@ -2598,9 +2598,7 @@ namespace RTC ...@@ -2598,9 +2598,7 @@ namespace RTC
sentInfo.size = packet->GetSize(); sentInfo.size = packet->GetSize();
sentInfo.sendingAtMs = DepLibUV::GetTimeMs(); sentInfo.sendingAtMs = DepLibUV::GetTimeMs();
auto* cb = new onSendCallback( auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
[tccClient, &packetInfo, senderBwe, &sentInfo](bool sent)
{
if (sent) if (sent)
{ {
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
...@@ -2613,9 +2611,7 @@ namespace RTC ...@@ -2613,9 +2611,7 @@ namespace RTC
SendRtpPacket(consumer, packet, cb); SendRtpPacket(consumer, packet, cb);
#else #else
const auto* cb = new onSendCallback( const auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
[tccClient, &packetInfo](bool sent)
{
if (sent) if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
}); });
...@@ -2670,9 +2666,7 @@ namespace RTC ...@@ -2670,9 +2666,7 @@ namespace RTC
sentInfo.size = packet->GetSize(); sentInfo.size = packet->GetSize();
sentInfo.sendingAtMs = DepLibUV::GetTimeMs(); sentInfo.sendingAtMs = DepLibUV::GetTimeMs();
auto* cb = new onSendCallback( auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
[tccClient, &packetInfo, senderBwe, &sentInfo](bool sent)
{
if (sent) if (sent)
{ {
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
...@@ -2685,9 +2679,7 @@ namespace RTC ...@@ -2685,9 +2679,7 @@ namespace RTC
SendRtpPacket(consumer, packet, cb); SendRtpPacket(consumer, packet, cb);
#else #else
const auto* cb = new onSendCallback( const auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
[tccClient, &packetInfo](bool sent)
{
if (sent) if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
}); });
...@@ -3009,9 +3001,7 @@ namespace RTC ...@@ -3009,9 +3001,7 @@ namespace RTC
sentInfo.isProbation = true; sentInfo.isProbation = true;
sentInfo.sendingAtMs = DepLibUV::GetTimeMs(); sentInfo.sendingAtMs = DepLibUV::GetTimeMs();
auto* cb = new onSendCallback( auto* cb = new onSendCallback([tccClient, &packetInfo, senderBwe, &sentInfo](bool sent) {
[tccClient, &packetInfo, senderBwe, &sentInfo](bool sent)
{
if (sent) if (sent)
{ {
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
...@@ -3024,9 +3014,7 @@ namespace RTC ...@@ -3024,9 +3014,7 @@ namespace RTC
SendRtpPacket(nullptr, packet, cb); SendRtpPacket(nullptr, packet, cb);
#else #else
const auto* cb = new onSendCallback( const auto* cb = new onSendCallback([tccClient, &packetInfo](bool sent) {
[tccClient, &packetInfo](bool sent)
{
if (sent) if (sent)
tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64()); tccClient->PacketSent(packetInfo, DepLibUV::GetTimeMsInt64());
}); });
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论