From: Christian Würdig Date: Mon, 28 Aug 2006 10:51:09 +0000 (+0000) Subject: added memset and NULL initializers to keep valgrind happy X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=c0641a647427dea7c7eb3aa894f5b62fa52aed18;p=libfirm added memset and NULL initializers to keep valgrind happy [r8134] --- diff --git a/ir/tv/fltcalc.c b/ir/tv/fltcalc.c index 761bf8362..eda9f5ede 100644 --- a/ir/tv/fltcalc.c +++ b/ir/tv/fltcalc.c @@ -1584,6 +1584,7 @@ void init_fltcalc(int precision) calc_buffer_size = DESCRIPTOR_POS + sizeof(descriptor_t); calc_buffer = xmalloc(calc_buffer_size); + memset(calc_buffer, 0, calc_buffer_size); DEBUGPRINTF(("init fltcalc:\n\tVALUE_SIZE = %d\n\tSIGN_POS = %d\n\tEXPONENT_POS = %d\n\tMANTISSA_POS = %d\n\tDESCRIPTOR_POS = %d\n\tCALC_BUFFER_SIZE = %d\n\tcalc_buffer = %p\n\n", value_size, SIGN_POS, EXPONENT_POS, MANTISSA_POS, DESCRIPTOR_POS, calc_buffer_size, calc_buffer)); #ifdef HAVE_LONG_DOUBLE DEBUGPRINTF(("\tUsing long double (1-15-64) interface\n")); diff --git a/ir/tv/tv.c b/ir/tv/tv.c index 9ccdbad1c..dd744b76c 100644 --- a/ir/tv/tv.c +++ b/ir/tv/tv.c @@ -98,8 +98,8 @@ static long long count = 0; /**************************************************************************** * private variables ****************************************************************************/ -static struct set *tarvals; /* container for tarval structs */ -static struct set *values; /* container for values */ +static struct set *tarvals = NULL; /* container for tarval structs */ +static struct set *values = NULL; /* container for values */ static tarval_int_overflow_mode_t int_overflow_mode = TV_OVERFLOW_WRAP; /****************************************************************************