- if (pp->argc_stack > 0) {
- snprintf(buf + l, sizeof(buf) - l, ", {%d stack}", pp->argc_stack);
- l = strlen(buf);
+
+ sprint_pp_short(pp, g_comment, sizeof(g_comment));
+
+ if (sym != NULL) {
+ g_func_sym_pp = NULL;
+ pp_sym = proto_parse(fhdr, sym, 1);
+ if (pp_sym == NULL)
+ return pp;
+ if (!pp_sym->is_fptr)
+ aerr("func ptr data, but label '%s' !is_fptr\n", pp_sym->name);
+ g_func_sym_pp = pp_sym;
+ }
+ else {
+ pp_sym = g_func_sym_pp;
+ if (pp_sym == NULL)
+ return pp;
+ }
+
+ if (pp_cmp_func(pp, pp_sym)) {
+ pp_print(fp_sym, sizeof(fp_sym), pp_sym);
+ anote("var: %s\n", fp_var);
+ anote("sym: %s\n", fp_sym);
+ awarn("^ mismatch\n");
+ }
+
+ return pp;
+}
+
+static void output_decorated_pp(FILE *fout,
+ const struct parsed_proto *pp)
+{
+ if (pp->name[0] != '_')
+ fprintf(fout, pp->is_fastcall ? "@" : "_");
+ fprintf(fout, "%s", pp->name);
+ if (pp->is_stdcall && pp->argc > 0)
+ fprintf(fout, "@%d", pp->argc * 4);
+}
+
+static int align_value(int src_val)
+{
+ if (src_val <= 0) {
+ awarn("bad align: %d\n", src_val);
+ src_val = 1;