From 384d9e4132be7d7c41a992e6d5cb7c0f59a79ffe Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 28 Oct 2015 14:38:10 +0100 Subject: preserve and renumber duplicate values Change-Id: I5c805fb7d60d8bae7109e3910f7bb0b5dd142909 --- sc/util/number-defines-consecutively.awk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sc/util') 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) { -- cgit v1.2.3