Make CJS_Object's ObjDefnID be one-based.
Then use 0 as the invalid object id instead of -1.
Then stop shipping about 80 bytes of "-1" as mutable data, since
zero-initialized .bss doesn't cost anything size-wise.
Change-Id: I79956d85e0e2114038d6f67e11954451097d7d19
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74970
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/cjs_util.cpp b/fxjs/cjs_util.cpp
index 029ed7a..f33ac83 100644
--- a/fxjs/cjs_util.cpp
+++ b/fxjs/cjs_util.cpp
@@ -77,11 +77,11 @@
{"scand", scand_static},
{"byteToChar", byteToChar_static}};
-int CJS_Util::ObjDefnID = -1;
+uint32_t CJS_Util::ObjDefnID = 0;
const char CJS_Util::kName[] = "util";
// static
-int CJS_Util::GetObjDefnID() {
+uint32_t CJS_Util::GetObjDefnID() {
return ObjDefnID;
}