kt = check_type(p, &ret);
if (kt == NULL) {
- printf("%s:%d:%ld: unhandled return in '%s'\n",
+ printf("%s:%d:%zd: unhandled return in '%s'\n",
hdrfn, hdrfline, (p - protostr) + 1, protostr);
return -1;
}
p = next_idt(buf, sizeof(buf), p);
p = sskip(p);
if (buf[0] == 0) {
- printf("%s:%d:%ld: var name missing\n",
+ printf("%s:%d:%zd: var name missing\n",
hdrfn, hdrfline, (p - protostr) + 1);
return -1;
}
p = next_word(cconv, sizeof(cconv), p);
p = sskip(p);
if (cconv[0] == 0) {
- printf("%s:%d:%ld: cconv missing\n",
+ printf("%s:%d:%zd: cconv missing\n",
hdrfn, hdrfline, (p - protostr) + 1);
return -1;
}
else if (IS(cconv, "WINAPI"))
pp->is_stdcall = 1;
else {
- printf("%s:%d:%ld: unhandled cconv: '%s'\n",
+ printf("%s:%d:%zd: unhandled cconv: '%s'\n",
hdrfn, hdrfline, (p - protostr) + 1, cconv);
return -1;
}
if (pp->is_fptr) {
if (*p != '*') {
- printf("%s:%d:%ld: '*' expected\n",
+ printf("%s:%d:%zd: '*' expected\n",
hdrfn, hdrfline, (p - protostr) + 1);
return -1;
}
p = next_idt(buf, sizeof(buf), p);
p = sskip(p);
if (buf[0] == 0) {
- printf("%s:%d:%ld: func name missing\n",
+ printf("%s:%d:%zd: func name missing\n",
hdrfn, hdrfline, (p - protostr) + 1);
return -1;
}
if (!IS(regparm, "eax") && !IS(regparm, "ax")
&& !IS(regparm, "al"))
{
- printf("%s:%d:%ld: bad regparm: %s\n",
+ printf("%s:%d:%zd: bad regparm: %s\n",
hdrfn, hdrfline, (p - protostr) + 1, regparm);
return -1;
}
if (pp->is_fptr) {
if (*p != ')') {
- printf("%s:%d:%ld: ')' expected\n",
+ printf("%s:%d:%zd: ')' expected\n",
hdrfn, hdrfline, (p - protostr) + 1);
return -1;
}
}
if (*p != '(') {
- printf("%s:%d:%ld: '(' expected, got '%c'\n",
+ printf("%s:%d:%zd: '(' expected, got '%c'\n",
hdrfn, hdrfline, (p - protostr) + 1, *p);
return -1;
}
p++;
break;
}
- printf("%s:%d:%ld: ')' expected\n",
+ printf("%s:%d:%zd: ')' expected\n",
hdrfn, hdrfline, (p - protostr) + 1);
return -1;
}
p1 = p;
kt = check_type(p, &ret);
if (kt == NULL) {
- printf("%s:%d:%ld: unhandled type for arg%d\n",
+ printf("%s:%d:%zd: unhandled type for arg%d\n",
hdrfn, hdrfline, (p - protostr) + 1, xarg);
return -1;
}
arg->fptr = calloc(1, sizeof(*arg->fptr));
ret = parse_protostr(p1, arg->fptr);
if (ret < 0) {
- printf("%s:%d:%ld: funcarg parse failed\n",
+ printf("%s:%d:%zd: funcarg parse failed\n",
hdrfn, hdrfline, p1 - protostr);
return -1;
}
p = sskip(p);
#if 0
if (buf[0] == 0) {
- printf("%s:%d:%ld: idt missing for arg%d\n",
+ printf("%s:%d:%zd: idt missing for arg%d\n",
hdrfn, hdrfline, (p - protostr) + 1, xarg);
return -1;
}
struct {
union {
char *label;
- int val;
+ unsigned int val;
} u;
int bt_i;
} *d;
static int g_stack_fsz;
static int g_ida_func_attr;
#define ferr(op_, fmt, ...) do { \
- printf("error:%s:#%ld: '%s': " fmt, g_func, (op_) - ops, \
+ printf("error:%s:#%zd: '%s': " fmt, g_func, (op_) - ops, \
dump_op(op_), ##__VA_ARGS__); \
fcloseall(); \
exit(1); \
return -1;
}
-static void printf_number(char *buf, size_t buf_size, long number)
+static void printf_number(char *buf, size_t buf_size,
+ unsigned long number)
{
// output in C-friendly form
snprintf(buf, buf_size, number < 10 ? "%lu" : "0x%02lx", number);
return -1;
}
-static long parse_number(const char *number)
+static unsigned long parse_number(const char *number)
{
int len = strlen(number);
const char *p = number;
char *endp = NULL;
+ unsigned long ret;
int neg = 0;
int bad;
- long ret;
if (*p == '-') {
neg = 1;
if (len > 1 && *p == '0')
p++;
if (number[len - 1] == 'h') {
- ret = strtol(p, &endp, 16);
+ ret = strtoul(p, &endp, 16);
bad = (*endp != 'h');
}
else {
- ret = strtol(p, &endp, 10);
+ ret = strtoul(p, &endp, 10);
bad = (*endp != 0);
}
if (bad)
{
struct parsed_proto pp;
enum opr_lenmod tmplmod;
+ unsigned long number;
int ret, len;
- long number;
int wordc_in;
char *tmp;
int i;