X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fstat%2Fdistrib.c;h=2f8e6da5e846e6989a590f6f538983171b8c7327;hb=edb11cbddcf9e4fef1bde33d576003af8a6a3323;hp=82100e764fdb1b9d7641200c892eb05dba941f48;hpb=2cc9db25f1d7780e24013ef1cc912a3cd770d7a5;p=libfirm diff --git a/ir/stat/distrib.c b/ir/stat/distrib.c index 82100e764..2f8e6da5e 100644 --- a/ir/stat/distrib.c +++ b/ir/stat/distrib.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -135,7 +135,7 @@ void stat_add_distrib_tbl(distrib_tbl_t *tbl, const void *object, const counter_ * adds a new key count into the integer distribution table */ void stat_add_int_distrib_tbl(distrib_tbl_t *tbl, int key, const counter_t *cnt) { - stat_add_distrib_tbl(tbl, (const void *)key, cnt); + stat_add_distrib_tbl(tbl, INT_TO_PTR(key), cnt); } /* @@ -151,7 +151,7 @@ void stat_inc_distrib_tbl(distrib_tbl_t *tbl, const void *object) { * increases key count by one */ void stat_inc_int_distrib_tbl(distrib_tbl_t *tbl, int key) { - stat_inc_distrib_tbl(tbl, (const void *)key); + stat_inc_distrib_tbl(tbl, INT_TO_PTR(key)); } /* @@ -168,7 +168,7 @@ void stat_insert_distrib_tbl(distrib_tbl_t *tbl, const void *object) { * if key is already present, nothing happens */ void stat_insert_int_distrib_tbl(distrib_tbl_t *tbl, int key) { - stat_insert_distrib_tbl(tbl, (const void *)key); + stat_insert_distrib_tbl(tbl, INT_TO_PTR(key)); } /* @@ -201,16 +201,16 @@ double stat_calc_mean_distrib_tbl(distrib_tbl_t *tbl) { return 0.0; min = - max = (int)entry->object; + max = PTR_TO_INT(entry->object); sum = cnt_to_dbl(&entry->cnt); for (entry = pset_next(tbl->hash_map); entry; entry = pset_next(tbl->hash_map)) { - int value = (int)entry->object; + int value = PTR_TO_INT(entry->object); if (value < min) min = value; - if (value > max); + if (value > max) max = value; sum += cnt_to_dbl(&entry->cnt); @@ -241,7 +241,7 @@ double stat_calc_avg_distrib_tbl(distrib_tbl_t *tbl) { return 0.0; foreach_pset(tbl->hash_map, entry) { - sum += cnt_to_dbl(&entry->cnt) * (int)entry->object; + sum += cnt_to_dbl(&entry->cnt) * PTR_TO_INT(entry->object); count += cnt_to_uint(&entry->cnt); } } else {