projects
/
musl-tables
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
186983d
)
fix type parsing
author
nsz
<nsz@port70.net>
Wed, 14 Sep 2011 12:15:53 +0000
(14:15 +0200)
committer
nsz
<nsz@port70.net>
Wed, 14 Sep 2011 12:15:53 +0000
(14:15 +0200)
type.sh
patch
|
blob
|
history
diff --git
a/type.sh
b/type.sh
index
2050e4b
..
82c943b
100755
(executable)
--- a/
type.sh
+++ b/
type.sh
@@
-6,7
+6,7
@@
export LC_ALL=C
awk '
BEGIN {
# type is not typedefed so next unknown id is probably a variable name
awk '
BEGIN {
# type is not typedefed so next unknown id is probably a variable name
- split("void char short int long float double signed unsigned _Bool _Complex", a)
+ split("void char short int long float double signed unsigned _Bool _Complex
bool complex
", a)
for (i in a)
tok[a[i]] = "type"
for (i in a)
tok[a[i]] = "type"
@@
-41,7
+41,7
@@
function put(tok) {
gsub(/\/\*[^/]*\*\//, "")
gsub(/\/\/.*/, "")
gsub(/\/\*[^/]*\*\//, "")
gsub(/\/\/.*/, "")
- gsub(/[^a-zA-Z0-9_.]/," & ")
+ gsub(/[^a-zA-Z0-9_.
-
]/," & ")
gsub(/\.\.\./, " & ")
state = "type"
gsub(/\.\.\./, " & ")
state = "type"
@@
-50,6
+50,9
@@
function put(tok) {
for (i = 1; i <= NF; i++) {
if ($i == ";")
break
for (i = 1; i <= NF; i++) {
if ($i == ";")
break
+ # drop restrict
+ if ($i == "restrict")
+ continue
if (state == "type") {
put($i)
if (!tok[$i] || tok[$i] == "type")
if (state == "type") {
put($i)
if (!tok[$i] || tok[$i] == "type")
@@
-77,8
+80,6
@@
function put(tok) {
}
# fixes
}
# fixes
- gsub(/restrict const/, "const", s)
- gsub(/restrict/, "", s)
gsub(/\[[0-9]+\]/, "[]", s)
gsub(/unsigned int/, "unsigned", s)
gsub(/long int/, "long", s)
gsub(/\[[0-9]+\]/, "[]", s)
gsub(/unsigned int/, "unsigned", s)
gsub(/long int/, "long", s)