Replace FXBSTR_ID() macro with a constexpr function.

Let it perform a bit more typechecking.

Bug: pdfium:1085
Change-Id: I8529be6abb5c71e7be5b1a2698444338c4a4804c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/91890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/fx_string.h b/core/fxcrt/fx_string.h
index 9bdf465..e1b565e 100644
--- a/core/fxcrt/fx_string.h
+++ b/core/fxcrt/fx_string.h
@@ -14,9 +14,10 @@
 #include "core/fxcrt/bytestring.h"
 #include "core/fxcrt/widestring.h"
 
-#define FXBSTR_ID(c1, c2, c3, c4)                                      \
-  (((uint32_t)c1 << 24) | ((uint32_t)c2 << 16) | ((uint32_t)c3 << 8) | \
-   ((uint32_t)c4))
+constexpr uint32_t FXBSTR_ID(uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4) {
+  return static_cast<uint32_t>(c1) << 24 | static_cast<uint32_t>(c2) << 16 |
+         static_cast<uint32_t>(c3) << 8 | static_cast<uint32_t>(c4);
+}
 
 ByteString FX_UTF8Encode(WideStringView wsStr);
 WideString FX_UTF8Decode(ByteStringView bsStr);