-1 is commonly used as ID for controls that one don't want to refer to later. For DIALOG resources, the IDs are 16 bit numbers, and -1 gets interpreted as UINT32_MAX earlier, which then later is too large to write into a uint16_t.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM, but consider inline suggestion.
tools/llvm-rc/ResourceFileWriter.cpp | ||
---|---|---|
986 ↗ | (On Diff #145413) | This is fine, but I had to stop and wonder if there's an assumption about two's-complement. Why not: if (Ctl.ID != static_cast<uint32_t>(-1)) |
tools/llvm-rc/ResourceFileWriter.cpp | ||
---|---|---|
986 ↗ | (On Diff #145413) | Thanks, that's even more readable, will try that before commiting! |