matt-kempster / m2c

A MIPS and PowerPC decompiler.
GNU General Public License v3.0
386 stars 46 forks source link

Simplify flag checks such as !(var & 4) #239

Closed ethteck closed 2 years ago

ethteck commented 2 years ago

This PR makes flag checks briefer and more in line with how projects tend to actually write this code: (flagVar & 0x100) == 0 becomes !(flagVar & 0x100) (flagVar & 0x100) != 0 becomes (flagVar & 0x100)

ethteck commented 2 years ago

I implemented the paren handling I mentioned above, but the way I did it and the scope might not be ideal. lmk what you think