style: eliminate explicit boolean comparisons
Review Request #3308 - Created Jan. 29, 2016 and submitted
Information | |
---|---|
Steve Reinhardt | |
gem5 | |
default | |
Reviewers | |
Default | |
Changeset 11321:42f3fc1ea44c --------------------------- style: eliminate explicit boolean comparisons Result of running 'hg m5style --skip-all --fix-control -a' to get rid of '== true' comparisons, plus trivial manual edits to get rid of '== false'/'== False' comparisons. Left a couple of explicit comparisons in where they didn't seem unreasonable: invalid boolean comparison in src/arch/mips/interrupts.cc:155 >> DPRINTF(Interrupt, "Interrupts OnCpuTimerINterrupt(tc) == true\n");<< invalid boolean comparison in src/unittest/unittest.hh:110 >> "EXPECT_FALSE(" #expr ")", (expr) == false)<<
Ship It!
Posted (Jan. 31, 2016, 5:04 a.m.)
I just noticed that we have the occasional foo == NULL / foo != NULL check in the code base. I usually consider this to be on par with foo == False, should we check for that as well?
Ship It!