| commit | 2527628edae5651cb28e72b2c98f24e72dcdb384 | [log] [tgz] |
|---|---|---|
| author | Yabin Cui <yabinc@google.com> | Mon Mar 21 17:46:21 2016 -0700 |
| committer | Yabin Cui <yabinc@google.com> | Mon Mar 21 17:46:21 2016 -0700 |
| tree | 697594d823c0c668db81b5624bccc37c722d3423 | |
| parent | a01de8fee1fa47ef4893d2017ac8c390c3c08a00 [diff] |
base: Avoid compilation error when compiled with -Wdangling-else.
As logging macros uses `if xxx else yyy` style, it is reported as an
error when DCHECK() is compiled with -Wdangling-else option. Because
after preprocess, DCHECK(x) becomes:
if (EnableDChecks)
if (x)
;
else
LogMessage(FATAL) << yyy;
This CL avoids compilation error by replacing `if xxx else yyy`
with `xxx && yyy` or `!(xxx) || yyy`.
Bug: 26962895
Change-Id: Ib0bf242cc04a238ec31a1ab66b53fc8a5b5ed28f