notaz.gp2x.de
/
ia32rtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
translate: some fixes
[ia32rtools.git]
/
tools
/
protoparse.h
diff --git
a/tools/protoparse.h
b/tools/protoparse.h
index
93129a1
..
7acd63a
100644
(file)
--- a/
tools/protoparse.h
+++ b/
tools/protoparse.h
@@
-15,6
+15,8
@@
struct parsed_type {
unsigned int is_struct:1; // split for args
unsigned int is_retreg:1; // register to return to caller
unsigned int is_va_list:1;
unsigned int is_struct:1; // split for args
unsigned int is_retreg:1; // register to return to caller
unsigned int is_va_list:1;
+ unsigned int is_64bit:1;
+ unsigned int is_float:1; // float, double
};
struct parsed_proto_arg {
};
struct parsed_proto_arg {
@@
-40,8
+42,10
@@
struct parsed_proto {
unsigned int is_fastcall:1;
unsigned int is_vararg:1; // vararg func
unsigned int is_fptr:1;
unsigned int is_fastcall:1;
unsigned int is_vararg:1; // vararg func
unsigned int is_fptr:1;
+ unsigned int is_import:1; // data import
unsigned int is_noreturn:1;
unsigned int is_unresolved:1;
unsigned int is_noreturn:1;
unsigned int is_unresolved:1;
+ unsigned int is_guessed:1; // for extra checking
unsigned int is_userstack:1;
unsigned int is_include:1; // not from top-level header
unsigned int is_osinc:1; // OS/system library func
unsigned int is_userstack:1;
unsigned int is_include:1; // not from top-level header
unsigned int is_osinc:1; // OS/system library func
@@
-214,8
+218,10
@@
static const char *known_ptr_types[] = {
"HMENU",
"HWAVEOUT",
"HWND",
"HMENU",
"HWAVEOUT",
"HWND",
+ "PAPPBARDATA",
"PBYTE",
"PCRITICAL_SECTION",
"PBYTE",
"PCRITICAL_SECTION",
+ "PDEVMODEA",
"PDWORD",
"PFILETIME",
"PLARGE_INTEGER",
"PDWORD",
"PFILETIME",
"PLARGE_INTEGER",
@@
-230,6
+236,7
@@
static const char *known_ptr_types[] = {
"PCVOID",
"PWORD",
"REFCLSID",
"PCVOID",
"PWORD",
"REFCLSID",
+ "REFGUID",
"REFIID",
"HOOKPROC",
"DLGPROC",
"REFIID",
"HOOKPROC",
"DLGPROC",
@@
-397,6
+404,9
@@
static int parse_arg(char **p_, struct parsed_proto_arg *arg, int xarg)
if (ret < 0)
return -1;
if (ret < 0)
return -1;
+ if (IS_START(arg->pp->name, "guess"))
+ arg->pp->is_guessed = 1;
+
// we don't use actual names right now...
snprintf(arg->pp->name, sizeof(arg->pp->name), "a%d", xarg);
// we don't use actual names right now...
snprintf(arg->pp->name, sizeof(arg->pp->name), "a%d", xarg);
@@
-457,6
+467,11
@@
static int parse_protostr(char *protostr, struct parsed_proto *pp)
p = sskip(p + l + 1);
}
p = sskip(p + l + 1);
}
+ if (IS_START(p, "DECL_IMPORT ")) {
+ pp->is_import = 1;
+ p = sskip(p + 12);
+ }
+
ret = check_type(p, &pp->ret_type);
if (ret <= 0) {
printf("%s:%d:%zd: unhandled return in '%s'\n",
ret = check_type(p, &pp->ret_type);
if (ret <= 0) {
printf("%s:%d:%zd: unhandled return in '%s'\n",
@@
-667,14
+682,22
@@
static int parse_protostr(char *protostr, struct parsed_proto *pp)
pp->has_retreg |= is_retreg;
}
pp->has_retreg |= is_retreg;
}
+ if (IS(arg->type.name, "float")
+ || IS(arg->type.name, "double"))
+ {
+ arg->type.is_float = 1;
+ }
+
if (!arg->type.is_ptr && (strstr(arg->type.name, "int64")
|| IS(arg->type.name, "double")))
{
if (!arg->type.is_ptr && (strstr(arg->type.name, "int64")
|| IS(arg->type.name, "double")))
{
+ arg->type.is_64bit = 1;
// hack..
// hack..
- free(arg->type.name);
- arg->type.name = strdup("int");
pp_copy_arg(&pp->arg[xarg], arg);
pp_copy_arg(&pp->arg[xarg], arg);
+ arg = &pp->arg[xarg];
xarg++;
xarg++;
+ free(arg->type.name);
+ arg->type.name = strdup("dummy");
}
ret = check_struct_arg(arg);
}
ret = check_struct_arg(arg);