Support float and function ptr args better, -W warning fixes.
This commit is contained in:
parent
13c308caa7
commit
17c9af5fb6
|
@ -507,11 +507,12 @@ static char *demangle_datatype (char **str, compound_type *ct,
|
|||
{
|
||||
if (*iter == '6')
|
||||
{
|
||||
int sub_expressions = 0;
|
||||
/* FIXME: there are a tons of memory leaks here */
|
||||
/* FIXME: this is still broken in some cases and it has to be
|
||||
* merged with the function prototype parsing above...
|
||||
*/
|
||||
iter += 3; /* FIXME */
|
||||
iter += iter[1] == 'A' ? 2 : 3; /* FIXME */
|
||||
if (!demangle_datatype (&iter, &sub_ct, sym))
|
||||
return NULL;
|
||||
ct->expression = str_create(2, sub_ct.expression, " (*)(");
|
||||
|
@ -523,8 +524,12 @@ static char *demangle_datatype (char **str, compound_type *ct,
|
|||
INIT_CT (sub_ct);
|
||||
if (!demangle_datatype (&iter, &sub_ct, sym))
|
||||
return NULL;
|
||||
ct->expression = str_create(3, ct->expression, ", ", sub_ct.expression);
|
||||
if (sub_expressions)
|
||||
ct->expression = str_create(3, ct->expression, ", ", sub_ct.expression);
|
||||
else
|
||||
ct->expression = str_create(2, ct->expression, sub_ct.expression);
|
||||
while (*iter == '@') iter++;
|
||||
sub_expressions++;
|
||||
}
|
||||
} else while (*iter == '@') iter++;
|
||||
iter++;
|
||||
|
@ -739,7 +744,7 @@ static int get_type_constant (const char c, const int constraints)
|
|||
case 'J': case 'K':
|
||||
return ARG_LONG;
|
||||
case 'M':
|
||||
return -1; /* FIXME */
|
||||
return ARG_FLOAT;
|
||||
case 'N': case 'O':
|
||||
return ARG_DOUBLE;
|
||||
case 'P': case 'Q':
|
||||
|
|
|
@ -673,7 +673,7 @@ static const char *get_resource_type( unsigned int id )
|
|||
"HTML"
|
||||
};
|
||||
|
||||
if (id < sizeof(types)/sizeof(types[0])) return types[id];
|
||||
if ((size_t)id < sizeof(types)/sizeof(types[0])) return types[id];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -948,7 +948,7 @@ int pe_analysis(const char* name, void (*fn)(enum FileSig), enum FileSig wanted_
|
|||
#endif
|
||||
{
|
||||
if (!(PE_base = malloc( PE_total_len ))) fatal( "Out of memory" );
|
||||
if (read( fd, PE_base, PE_total_len ) != (int)PE_total_len) fatal( "Cannot read file" );
|
||||
if ((unsigned long)read( fd, PE_base, PE_total_len ) != PE_total_len) fatal( "Cannot read file" );
|
||||
}
|
||||
|
||||
effective_sig = check_headers();
|
||||
|
|
|
@ -259,6 +259,9 @@ int symbol_get_type (const char *string)
|
|||
if (strstr (string, "double"))
|
||||
return ARG_DOUBLE;
|
||||
|
||||
if (strstr (string, "float"))
|
||||
return ARG_FLOAT;
|
||||
|
||||
if (strstr (string, "void") || strstr (string, "VOID"))
|
||||
return ARG_VOID;
|
||||
|
||||
|
|
Loading…
Reference in New Issue