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

cosmetic: C++: add some brackets in if conditions

上级 e441bb28
......@@ -59,7 +59,9 @@ void DepLibSRTP::ClassInit()
const srtp_err_status_t err = srtp_init();
if (DepLibSRTP::IsError(err))
{
MS_THROW_ERROR("srtp_init() failed: %s", DepLibSRTP::GetErrorString(err));
}
}
++globalInstances;
......
......@@ -27,7 +27,9 @@ inline static void onWalk(uv_handle_t* handle, void* /*arg*/)
uv_has_ref(handle));
if (!uv_is_closing(handle))
{
uv_close(handle, onCloseLoop);
}
}
/* Static methods. */
......@@ -41,7 +43,9 @@ void DepLibUV::ClassInit()
const int err = uv_loop_init(DepLibUV::loop);
if (err != 0)
{
MS_ABORT("libuv loop initialization failed");
}
}
void DepLibUV::ClassDestroy()
......@@ -63,13 +67,17 @@ void DepLibUV::ClassDestroy()
err = uv_loop_close(DepLibUV::loop);
if (err != UV_EBUSY)
{
break;
}
uv_run(DepLibUV::loop, UV_RUN_NOWAIT);
}
if (err != 0)
{
MS_ERROR_STD("failed to close libuv loop: %s", uv_err_name(err));
}
delete DepLibUV::loop;
}
......
......@@ -127,7 +127,9 @@ uintptr_t DepUsrSCTP::GetNextSctpAssociationId()
// NOTE: usrsctp_connect() fails with a value of 0.
if (DepUsrSCTP::nextSctpAssociationId == 0u)
{
++DepUsrSCTP::nextSctpAssociationId;
}
// In case we've wrapped around and need to find an empty spot from a removed
// SctpAssociation. Assumes we'll never be full.
......@@ -137,7 +139,9 @@ uintptr_t DepUsrSCTP::GetNextSctpAssociationId()
++DepUsrSCTP::nextSctpAssociationId;
if (DepUsrSCTP::nextSctpAssociationId == 0u)
{
++DepUsrSCTP::nextSctpAssociationId;
}
}
return DepUsrSCTP::nextSctpAssociationId++;
......@@ -160,7 +164,9 @@ void DepUsrSCTP::RegisterSctpAssociation(RTC::SctpAssociation* sctpAssociation)
DepUsrSCTP::mapIdSctpAssociation[sctpAssociation->id] = sctpAssociation;
if (++DepUsrSCTP::numSctpAssociations == 1u)
{
DepUsrSCTP::checker->Start();
}
}
void DepUsrSCTP::DeregisterSctpAssociation(RTC::SctpAssociation* sctpAssociation)
......@@ -177,7 +183,9 @@ void DepUsrSCTP::DeregisterSctpAssociation(RTC::SctpAssociation* sctpAssociation
MS_ASSERT(DepUsrSCTP::numSctpAssociations > 0u, "numSctpAssociations was not higher than 0");
if (--DepUsrSCTP::numSctpAssociations == 0u)
{
DepUsrSCTP::checker->Stop();
}
}
RTC::SctpAssociation* DepUsrSCTP::RetrieveSctpAssociation(uintptr_t id)
......@@ -189,7 +197,9 @@ RTC::SctpAssociation* DepUsrSCTP::RetrieveSctpAssociation(uintptr_t id)
auto it = DepUsrSCTP::mapIdSctpAssociation.find(id);
if (it == DepUsrSCTP::mapIdSctpAssociation.end())
{
return nullptr;
}
return it->second;
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论