Reserve more space for startup-critical resource IDs.
When regenerating the startup resource ID list I found it greatly
exceeded 400 items, resulting in ID conflicts. Bump the reservation from
400 to 800 to give sufficient room.
This also fixes a couple bugs in the scripts -- a typo that led to a
crash and a missing inclusion of a new generated .h suffix.
Bug: none
Change-Id: I34624cd0ed29593b8dba764243aea1b3cbce3ed8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4555881
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Robert Flack <flackr@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1148093}
NOKEYCHECK=True
GitOrigin-RevId: da12af818e4458d9ae552b6a2650d82568a2115f
diff --git a/grit/format/gen_predetermined_ids.py b/grit/format/gen_predetermined_ids.py
index ba8a20c..da2e4af 100755
--- a/grit/format/gen_predetermined_ids.py
+++ b/grit/format/gen_predetermined_ids.py
@@ -107,7 +107,8 @@
original_resources = {}
for root, dirnames, filenames in os.walk(out_dir + '/gen'):
for filename in filenames:
- if filename.endswith(('_resources.h', '_settings.h', '_strings.h')):
+ if filename.endswith(
+ ('_resources.h', '_settings.h', '_strings.h', '_synonyms.h')):
with open(os.path.join(root, filename)) as f:
ReadResourceIdsFromFile(f, original_resources)
return original_resources
diff --git a/grit/node/misc.py b/grit/node/misc.py
index 617c1a8..4740a50 100644
--- a/grit/node/misc.py
+++ b/grit/node/misc.py
@@ -240,8 +240,8 @@
'avoid conflicts with system-defined resource IDs.')
if tid not in predetermined_tids and id in predetermined_ids:
- raise exception.IdRangeOverlap('ID %d overlaps between %s and %s'
- % (id, tid, predetermined_ids[tid]))
+ raise exception.IdRangeOverlap('ID %d overlaps between %s and %s' %
+ (id, tid, predetermined_ids[id]))
ids[id] = tid
tids[tid] = id