Revert r7858 ("DCHECK: Reference condition parameter in release builds")
Apparently Visual Studio is cleverer than I am at figuring out what local variables are actually unused. TBR=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/32739004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7859 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
3148060e61
commit
3cd26b677a
@ -71,11 +71,9 @@ namespace rtc {
|
|||||||
#define LAZY_STREAM(stream, condition) \
|
#define LAZY_STREAM(stream, condition) \
|
||||||
!(condition) ? static_cast<void>(0) : rtc::FatalMessageVoidify() & (stream)
|
!(condition) ? static_cast<void>(0) : rtc::FatalMessageVoidify() & (stream)
|
||||||
|
|
||||||
// The actual stream used isn't important. We reference condition in the code
|
// The actual stream used isn't important.
|
||||||
// but don't evaluate it; this is to avoid "unused variable" warnings.
|
#define EAT_STREAM_PARAMETERS \
|
||||||
#define EAT_STREAM_PARAMETERS(condition) \
|
true ? static_cast<void>(0) \
|
||||||
true || (condition) \
|
|
||||||
? static_cast<void>(0) \
|
|
||||||
: rtc::FatalMessageVoidify() & rtc::FatalMessage("", 0).stream()
|
: rtc::FatalMessageVoidify() & rtc::FatalMessage("", 0).stream()
|
||||||
|
|
||||||
// CHECK dies with a fatal error if condition is not true. It is *not*
|
// CHECK dies with a fatal error if condition is not true. It is *not*
|
||||||
@ -161,9 +159,8 @@ DEFINE_CHECK_OP_IMPL(GT, > )
|
|||||||
#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2)
|
#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2)
|
||||||
#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2)
|
#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2)
|
||||||
|
|
||||||
// The DCHECK macro is equivalent to CHECK except that it only generates code
|
// The DCHECK macro is equivalent to CHECK except that it only generates code in
|
||||||
// in debug builds. It does reference the condition parameter in all cases,
|
// debug builds.
|
||||||
// though, so callers won't risk getting warnings about unused variables.
|
|
||||||
#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
|
#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
|
||||||
#define DCHECK(condition) CHECK(condition)
|
#define DCHECK(condition) CHECK(condition)
|
||||||
#define DCHECK_EQ(v1, v2) CHECK_EQ(v1, v2)
|
#define DCHECK_EQ(v1, v2) CHECK_EQ(v1, v2)
|
||||||
@ -173,13 +170,13 @@ DEFINE_CHECK_OP_IMPL(GT, > )
|
|||||||
#define DCHECK_GE(v1, v2) CHECK_GE(v1, v2)
|
#define DCHECK_GE(v1, v2) CHECK_GE(v1, v2)
|
||||||
#define DCHECK_GT(v1, v2) CHECK_GT(v1, v2)
|
#define DCHECK_GT(v1, v2) CHECK_GT(v1, v2)
|
||||||
#else
|
#else
|
||||||
#define DCHECK(condition) EAT_STREAM_PARAMETERS(condition)
|
#define DCHECK(condition) EAT_STREAM_PARAMETERS
|
||||||
#define DCHECK_EQ(v1, v2) EAT_STREAM_PARAMETERS((v1) == (v2))
|
#define DCHECK_EQ(v1, v2) EAT_STREAM_PARAMETERS
|
||||||
#define DCHECK_NE(v1, v2) EAT_STREAM_PARAMETERS((v1) != (v2))
|
#define DCHECK_NE(v1, v2) EAT_STREAM_PARAMETERS
|
||||||
#define DCHECK_LE(v1, v2) EAT_STREAM_PARAMETERS((v1) <= (v2))
|
#define DCHECK_LE(v1, v2) EAT_STREAM_PARAMETERS
|
||||||
#define DCHECK_LT(v1, v2) EAT_STREAM_PARAMETERS((v1) < (v2))
|
#define DCHECK_LT(v1, v2) EAT_STREAM_PARAMETERS
|
||||||
#define DCHECK_GE(v1, v2) EAT_STREAM_PARAMETERS((v1) >= (v2))
|
#define DCHECK_GE(v1, v2) EAT_STREAM_PARAMETERS
|
||||||
#define DCHECK_GT(v1, v2) EAT_STREAM_PARAMETERS((v1) > (v2))
|
#define DCHECK_GT(v1, v2) EAT_STREAM_PARAMETERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This is identical to LogMessageVoidify but in name.
|
// This is identical to LogMessageVoidify but in name.
|
||||||
|
@ -60,7 +60,7 @@ bool AudioEncoderIlbc::EncodeInternal(uint32_t timestamp,
|
|||||||
EncodedInfo* info) {
|
EncodedInfo* info) {
|
||||||
const size_t expected_output_len =
|
const size_t expected_output_len =
|
||||||
num_10ms_frames_per_packet_ == 2 ? 38 : 50;
|
num_10ms_frames_per_packet_ == 2 ? 38 : 50;
|
||||||
DCHECK_GE(max_encoded_bytes, expected_output_len);
|
CHECK_GE(max_encoded_bytes, expected_output_len);
|
||||||
|
|
||||||
// Save timestamp if starting a new packet.
|
// Save timestamp if starting a new packet.
|
||||||
if (num_10ms_frames_buffered_ == 0)
|
if (num_10ms_frames_buffered_ == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user