MonsterDruide1 / OdysseyDecomp

Decompilation of Super Mario Odyssey for all versions.
143 stars 24 forks source link

Custom linter: Add requirement for `_OFFSET` variable names to be lowercase #170

Open MonsterDruide1 opened 1 month ago

MonsterDruide1 commented 1 month ago

Example: _1d8, _c8, ...

Reason for this is that Begins with underscore and uppercase letter are technically reserved by the C++ spec and should not be used for own variable names. _C throws an error in some compilers, while _c does not - thus, we should use the latter, to improve compatibility with different systems.

Source: https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685

GRAnimated commented 1 month ago

What about the difference between field_xxx and _xxx? HexRaysPyTools generates field_xxx (and the fork I use adds the generated type into the name, like char_xxx) while the built-in struct creator uses _xxx. I'm far more in favor of field_xxx for the record.

ThePixelGamer commented 1 month ago

Isn't "field" already just implied by the _xxx scheme?

MonsterDruide1 commented 1 month ago

That's also what I'm thinking. It does not add information/value, just make the name longer, and one advantage of having a very short name for these placeholders is that they stick out from proper namings, are immediately apparent that they do not have their final name yet and thus need to be adjusted.