summaryrefslogtreecommitdiffhomepage
path: root/ir/stat
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-16 07:52:26 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-16 08:59:11 +0200
commit033da89d83a546f4ac89ea6dd0212892f0e462fb (patch)
treebc2c5a89bf5e61d9df3161992c96080c48239baf /ir/stat
parent788de25cca7f5438b6750ed6d6d64cdbcb52e04b (diff)
Use a null pointer instead of an artificial disabled pointer for the global firmstat status.
Diffstat (limited to 'ir/stat')
-rw-r--r--ir/stat/firmstat.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c
index 1f5a6d3..02c715c 100644
--- a/ir/stat/firmstat.c
+++ b/ir/stat/firmstat.c
@@ -48,8 +48,7 @@ static unsigned stat_options;
/**
* global status
*/
-static const unsigned status_disable = 0;
-static stat_info_t *status = (stat_info_t*)&status_disable;
+static stat_info_t *status = NULL;
/**
* Compare two elements of the opcode hash.
@@ -1796,21 +1795,21 @@ static void stat_term_dumper(void)
/* Terminates the statistics module, frees all memory. */
void stat_term(void)
{
- if (status != (stat_info_t*)&status_disable) {
+ if (status) {
obstack_free(&status->be_data, NULL);
obstack_free(&status->cnts, NULL);
stat_term_dumper();
free(status);
- status = (stat_info_t*)&status_disable;
+ status = NULL;
}
}
/* returns 1 if statistics were initialized, 0 otherwise */
int stat_is_active(void)
{
- return status != (stat_info_t*)&status_disable;
+ return status != NULL;
}
void init_stat(void)