Commit 376e7c78 authored by Michael Beck's avatar Michael Beck
Browse files

Fixed some 64bit warnings by using size_t and fixing compare functions.

[r28196]
parent a221e03b
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -1193,7 +1193,7 @@ static int cmp_regs(const void *a, const void *b)
if (p->reg->reg_class == q->reg->reg_class)
return p->reg->index - q->reg->index;
else
return p->reg->reg_class - q->reg->reg_class;
return p->reg->reg_class < q->reg->reg_class ? -1 : +1;
}
static void reg_map_to_arr(reg_node_map_t *res, pmap *reg_map)
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -933,7 +933,7 @@ static struct lexer {
unsigned cur_token; /**< current token. */
unsigned number; /**< current token attribute. */
const char *s; /**< current token attribute. */
unsigned len; /**< current token attribute. */
size_t len; /**< current token attribute. */
const char *curr_pos;
const char *end_pos;
......@@ -1052,7 +1052,7 @@ static unsigned get_token(void)
void firm_debug(const char *cmd)
{
char name[1024], fname[1024];
int len;
size_t len;
init_lexer(cmd);
......
......@@ -387,7 +387,7 @@ int lc_evpprintf(const lc_arg_env_t *env, lc_appendable_t *app, const char *fmt,
for (ch = *s; ch != '}' && ch != '\0'; ch = *++s);
if (s - named) {
int n = s - named;
size_t n = s - named;
char *name;
lc_arg_t tmp;
......
......@@ -1992,7 +1992,7 @@ static int cmp_op_mode(const void *elt, const void *key, size_t size)
const op_mode_entry_t *e2 = (const op_mode_entry_t*)key;
(void) size;
return (e1->op - e2->op) | (e1->imode - e2->imode) | (e1->omode - e2->omode);
return (e1->op != e2->op) | (e1->imode != e2->imode) | (e1->omode != e2->omode);
}
/**
......@@ -2004,7 +2004,7 @@ static int cmp_conv_tp(const void *elt, const void *key, size_t size)
const conv_tp_entry_t *e2 = (const conv_tp_entry_t*)key;
(void) size;
return (e1->imode - e2->imode) | (e1->omode - e2->omode);
return (e1->imode != e2->imode) | (e1->omode != e2->omode);
}
/**
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -54,7 +54,9 @@ static int int_cmp_fun(const void *elt, const void *key)
const distrib_entry_t *p1 = (const distrib_entry_t*)elt;
const distrib_entry_t *p2 = (const distrib_entry_t*)key;
return (char *)p1->object - (char *)p2->object;
if (p1->object == p2->object)
return 0;
return p1->object < p2->object ? -1 : 1;
}
/*
......
/*
* Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
* Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -2134,7 +2134,7 @@ void stat_dump_snapshot(const char *name, const char *phase)
{
char fname[2048];
const char *p;
int l;
size_t l;
if (! status->stat_options)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment