Fixed: gcc 2.95 problem and initialzes memory
This commit is contained in:
parent
01912bbe07
commit
41cd24604c
@ -19,14 +19,15 @@ static void chm_traverse(chm_config_data_t *chm, cmph_uint8 *visited, cmph_uint3
|
|||||||
|
|
||||||
chm_config_data_t *chm_config_new()
|
chm_config_data_t *chm_config_new()
|
||||||
{
|
{
|
||||||
chm_config_data_t *chm = NULL;
|
chm_config_data_t *chm;
|
||||||
chm = (chm_config_data_t *)malloc(sizeof(chm_config_data_t));
|
chm = (chm_config_data_t *)malloc(sizeof(chm_config_data_t));
|
||||||
|
assert(chm);
|
||||||
|
memset(chm,0,sizeof(chm_config_data_t));
|
||||||
chm->hashfuncs[0] = CMPH_HASH_JENKINS;
|
chm->hashfuncs[0] = CMPH_HASH_JENKINS;
|
||||||
chm->hashfuncs[1] = CMPH_HASH_JENKINS;
|
chm->hashfuncs[1] = CMPH_HASH_JENKINS;
|
||||||
chm->g = NULL;
|
chm->g = NULL;
|
||||||
chm->graph = NULL;
|
chm->graph = NULL;
|
||||||
chm->hashes = NULL;
|
chm->hashes = NULL;
|
||||||
assert(chm);
|
|
||||||
return chm;
|
return chm;
|
||||||
}
|
}
|
||||||
void chm_config_destroy(cmph_config_t *mph)
|
void chm_config_destroy(cmph_config_t *mph)
|
||||||
|
Loading…
Reference in New Issue
Block a user