summaryrefslogtreecommitdiff
path: root/sc/util
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-10-28 14:38:10 +0100
committerEike Rathke <erack@redhat.com>2015-10-28 14:38:53 +0100
commit384d9e4132be7d7c41a992e6d5cb7c0f59a79ffe (patch)
treed445122a99e1fea402c1a0d30a09276f388257bc /sc/util
parent882a0ad91676a4edc25feec8b129b42f88ef970c (diff)
preserve and renumber duplicate values
Change-Id: I5c805fb7d60d8bae7109e3910f7bb0b5dd142909
Diffstat (limited to 'sc/util')
-rwxr-xr-xsc/util/number-defines-consecutively.awk9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/util/number-defines-consecutively.awk b/sc/util/number-defines-consecutively.awk
index 6297dcdb2a35..6712490ea751 100755
--- a/sc/util/number-defines-consecutively.awk
+++ b/sc/util/number-defines-consecutively.awk
@@ -10,6 +10,10 @@
#
# Consecutively number a series of defines, for example sc/inc/globstr.hrc
+# Duplicated values are renumbered but preserved, i.e. for ...START and ...END
+# definitions, and commented with "XXX was duplicate".
+# To insert and renumber use a higher value for the inserted definition than
+# any other used, for example 9999.
# WARNING: this does not expect other defines in between and would mess around
# with them.
@@ -25,13 +29,16 @@ BEGIN {
if (dup[a[3]])
{
dupmsg = " // XXX was duplicate " a[3] " of " dup[a[3]];
+ a[3] = map[a[3]];
}
else
{
dup[a[3]] = a[2];
dupmsg = "";
+ ++id;
+ map[a[3]] = id;
+ a[3] = id;
}
- a[3] = ++id;
lastline = s[0];
for (i=1; i<=n; ++i)
{