[PATCH] D46506: [llvm-rc] Allow -1 for control IDs in old style dialogs with 16 bit fields

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 09:06:34 PDT 2018


amccarth accepted this revision.
amccarth added a comment.
This revision is now accepted and ready to land.

LGTM, but consider inline suggestion.



================
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>(
----------------
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))
```


Repository:
  rL LLVM

https://reviews.llvm.org/D46506





More information about the llvm-commits mailing list