summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-05-12 16:21:25 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-05-12 16:21:25 +0000
commite39b51f9c02ebfed131cec480cfa87308738ad37 (patch)
treecab6a4e3736cc4303edc14f5a4b873763be50abd /sys
parentd67373efece6c4c01148cfcd1b36184b256cf4b5 (diff)
Populate \t better in the output, for human readability; no change in the
map themselves.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/gsc/makemap.awk23
-rw-r--r--sys/dev/usb/makemap.awk21
2 files changed, 29 insertions, 15 deletions
diff --git a/sys/arch/hppa/gsc/makemap.awk b/sys/arch/hppa/gsc/makemap.awk
index 2f1281f6e11..f2556a275fd 100644
--- a/sys/arch/hppa/gsc/makemap.awk
+++ b/sys/arch/hppa/gsc/makemap.awk
@@ -1,7 +1,7 @@
#! /usr/bin/awk -f
-# $OpenBSD: makemap.awk,v 1.5 2005/05/09 05:07:25 miod Exp $
+# $OpenBSD: makemap.awk,v 1.6 2005/05/12 16:21:23 miod Exp $
#
-# Copyright (c) 2003, Miodrag Vallat.
+# Copyright (c) 2003, 2005, Miodrag Vallat.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@
#
BEGIN {
- rcsid = "$OpenBSD: makemap.awk,v 1.5 2005/05/09 05:07:25 miod Exp $"
+ rcsid = "$OpenBSD: makemap.awk,v 1.6 2005/05/12 16:21:23 miod Exp $"
ifdepth = 0
ignore = 0
mapnum = 0
@@ -257,7 +257,7 @@ $1 == "#define" || $1 == "#undef" {
}
printf("\t*/\n")
} else {
- lines[id] = sprintf(" KC(%d),", id)
+ lines[id] = sprintf(" KC(%d),\t", id)
#
# This makes sure that the non-comment part of the output
# ends up with a trailing comma. This is necessary since
@@ -267,13 +267,20 @@ $1 == "#define" || $1 == "#undef" {
#
comma = 0
for (f = 2; f <= NF; f++) {
+ l = length($f)
if ($f == "/*")
comma++
- if (comma == 0 &&
- substr($f, length($f)) != ",") {
- lines[id] = sprintf("%s\t%s,", lines[id], $f)
+ if (comma == 0 && substr($f, l) != ",") {
+ lines[id] = sprintf("%s%s,", lines[id], $f)
+ l++
} else {
- lines[id] = sprintf("%s\t%s", lines[id], $f)
+ lines[id] = sprintf("%s%s", lines[id], $f)
+ }
+ if (comma == 0 && f != NF) {
+ if (l < 2 * 8)
+ lines[id] = lines[id] "\t"
+ if (l < 8)
+ lines[id] = lines[id] "\t"
}
if ($f == "*/")
comma--
diff --git a/sys/dev/usb/makemap.awk b/sys/dev/usb/makemap.awk
index 48f2407f576..ae2c98960fe 100644
--- a/sys/dev/usb/makemap.awk
+++ b/sys/dev/usb/makemap.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $OpenBSD: makemap.awk,v 1.2 2005/05/12 09:28:21 miod Exp $
+# $OpenBSD: makemap.awk,v 1.3 2005/05/12 16:21:24 miod Exp $
#
# Copyright (c) 2005, Miodrag Vallat
#
@@ -31,7 +31,7 @@
#
BEGIN {
- rcsid = "$OpenBSD: makemap.awk,v 1.2 2005/05/12 09:28:21 miod Exp $"
+ rcsid = "$OpenBSD: makemap.awk,v 1.3 2005/05/12 16:21:24 miod Exp $"
ifdepth = 0
ignore = 0
declk = 0
@@ -256,7 +256,7 @@ $1 == "#define" || $1 == "#undef" {
}
printf("\t*/\n")
} else {
- lines[id] = sprintf(" KC(%d),", id)
+ lines[id] = sprintf(" KC(%d),\t", id)
#
# This makes sure that the non-comment part of the output
# ends up with a trailing comma. This is necessary since
@@ -266,13 +266,20 @@ $1 == "#define" || $1 == "#undef" {
#
comma = 0
for (f = 2; f <= NF; f++) {
+ l = length($f)
if ($f == "/*")
comma++
- if (comma == 0 &&
- substr($f, length($f)) != ",") {
- lines[id] = sprintf("%s\t%s,", lines[id], $f)
+ if (comma == 0 && substr($f, l) != ",") {
+ lines[id] = sprintf("%s%s,", lines[id], $f)
+ l++
} else {
- lines[id] = sprintf("%s\t%s", lines[id], $f)
+ lines[id] = sprintf("%s%s", lines[id], $f)
+ }
+ if (comma == 0 && f != NF) {
+ if (l < 2 * 8)
+ lines[id] = lines[id] "\t"
+ if (l < 8)
+ lines[id] = lines[id] "\t"
}
if ($f == "*/")
comma--