X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Fprotoparse.h;h=3981588e7b1139c9a3162a63c1baf02948d810cb;hb=ddaf8bd7aa44ee867e43988ba0bb7658dae6e6eb;hp=46c2005c30df933992f7669739e9144cd48c1a76;hpb=89ff3147d22160eb8345fd0475b93d5343a3303d;p=ia32rtools.git diff --git a/tools/protoparse.h b/tools/protoparse.h index 46c2005..3981588 100644 --- a/tools/protoparse.h +++ b/tools/protoparse.h @@ -140,6 +140,7 @@ static const char *known_type_mod[] = { }; static const char *known_ptr_types[] = { + "FARPROC", "HACCEL", "HANDLE", "HBITMAP", @@ -148,9 +149,11 @@ static const char *known_ptr_types[] = { "HFONT", "HGDIOBJ", "HGLOBAL", + "HICON", "HINSTANCE", - "HIMC", + //"HIMC", // DWORD "HMODULE", + "HPALETTE", "HRGN", "HRSRC", "HKEY", @@ -313,10 +316,6 @@ static int parse_protostr(char *protostr, struct parsed_proto *pp) pp->is_noreturn = 1; p = sskip(p + 18); } - else if (!strncmp(p, "noreturn ", 9)) { - pp->is_noreturn = 1; - p = sskip(p + 9); - } for (i = 0; i < ARRAY_SIZE(ignored_keywords); i++) { l = strlen(ignored_keywords[i]); @@ -332,6 +331,11 @@ static int parse_protostr(char *protostr, struct parsed_proto *pp) } p = sskip(p + ret); + if (!strncmp(p, "noreturn ", 9)) { + pp->is_noreturn = 1; + p = sskip(p + 9); + } + if (!strchr(p, ')')) { p = next_idt(buf, sizeof(buf), p); p = sskip(p); @@ -606,8 +610,10 @@ static int b_pp_c_handler(char *proto, const char *fname) static void build_pp_cache(FILE *fhdr) { + long pos; int ret; + pos = ftell(fhdr); rewind(fhdr); ret = do_protostrs(fhdr, hdrfn); @@ -615,6 +621,7 @@ static void build_pp_cache(FILE *fhdr) exit(1); qsort(pp_cache, pp_cache_size, sizeof(pp_cache[0]), pp_name_cmp); + fseek(fhdr, pos, SEEK_SET); } static const struct parsed_proto *proto_parse(FILE *fhdr, const char *sym,