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"
gsub(/\/\*[^/]*\*\//, "")
gsub(/\/\/.*/, "")
- gsub(/[^a-zA-Z0-9_.]/," & ")
+ gsub(/[^a-zA-Z0-9_.-]/," & ")
gsub(/\.\.\./, " & ")
state = "type"
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")
}
# fixes
- gsub(/restrict const/, "const", s)
- gsub(/restrict/, "", s)
gsub(/\[[0-9]+\]/, "[]", s)
gsub(/unsigned int/, "unsigned", s)
gsub(/long int/, "long", s)