-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Minor code cleanup in processData() #749
Conversation
srtcore/core.cpp
Outdated
|
||
bool excessive = false; | ||
string exc_type = "EXPECTED"; | ||
if ((offset < 0)) | ||
#ifdef ENABLE_HEAVY_LOGGING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda overspoken. In one of the works I created somewhere a type named DebugString
, which turned into a nothing and ignoring all operations if compiling without heavy logging. In this particular case maybe it would be easier something like this:
#if ENABLE_HEAVY_LOGGING
#define IF_HEAVY_LOGGING(instr) instr
#else
#define IF_HEAVY_LOGGING(instr) (void)0
#endif
This will work, as long as the instruction passed inside contains no commas.
Note also that HLOGC
macro resolves to nothing if ENABLE_HEAVY_LOGGING
is not defined, so you can safely use nonexistent symbols inside this macro call, as long as they exist under this condition.
int32_t seqlo = CSeqNo::incseq(m_iRcvCurrSeqNo); | ||
int32_t seqhi = CSeqNo::decseq(packet.m_iSeqNo); | ||
// If loss found, insert them to the receiver loss list | ||
// TODO: Can unlock rcvloss after m_pRcvLossList->insert(...)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_FreshLoss
probably should be also protected. Otherwise it can be unlocked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave it as a TODO, because this PR should not introduce changes, only minor code cleanup. Added you note to the comment.
6e142c5
to
d20e549
Compare
No description provided.