BEGIN {
kinds["TYPE"] = kinds["STOR"] = kinds["QUAL"] = kinds["FUNC"] = 1;
- count = maxwidth = 0;
+ count = 0;
}
# Locate all the relevant identifiers in cdecl.h. We assume everything
if (parts[2] in kinds) {
kind_counts[parts[2]]++;
specs[count++] = parts[3];
-
- if (length(parts[3]) > maxwidth)
- maxwidth = length(parts[3]);
}
}
if (specs[i] == "IDENT")
s = "0";
else
- s = "T_" substr(specs[i] " ", 1, maxwidth) " - 256";
+ s = "PACK_TOKEN(T_" specs[i] ")";
offset_table = offset_table s suffix;
}
print "\tassert(x < sizeof idx);";
print "\tif (!(x = idx[x]))";
print "\t\treturn \"\";";
- print "\treturn cdecl__token_name(x + 256);";
+ print "\treturn cdecl__token_name(UNPACK_TOKEN(x));";
print "}";
}