[PATCH] D46506: [llvm-rc] Allow -1 for control IDs in old style dialogs with 16 bit fields
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 9 09:33:27 PDT 2018
mstorsjo added inline comments.
================
Comment at: tools/llvm-rc/ResourceFileWriter.cpp:986
+ // want to refer to later.
+ if (Ctl.ID != std::numeric_limits<uint32_t>::max())
+ RETURN_IF_ERROR(checkNumberFits<uint16_t>(
----------------
amccarth wrote:
> 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))
> ```
Thanks, that's even more readable, will try that before commiting!
Repository:
rL LLVM
https://reviews.llvm.org/D46506
More information about the llvm-commits
mailing list