compilation errors corrected and license updated to MOZILLA PUBLIC LICENSE

This commit is contained in:
fc_botelho
2006-04-27 17:30:19 +00:00
parent a73afcb8c2
commit 9551495b02
10 changed files with 425 additions and 319 deletions

View File

@@ -130,7 +130,7 @@ cmph_t *bmz_new(cmph_config_t *mph, float c)
fprintf(stderr, "\tTraversing critical vertices.\n");
}
DEBUGP("Searching step\n");
visited = (char *)malloc(bmz->n/8 + 1);
visited = (cmph_uint8 *)malloc(bmz->n/8 + 1);
memset(visited, 0, bmz->n/8 + 1);
used_edges = (cmph_uint8 *)malloc(bmz->m/8 + 1);
memset(used_edges, 0, bmz->m/8 + 1);

View File

@@ -137,7 +137,7 @@ cmph_t *bmz8_new(cmph_config_t *mph, float c)
fprintf(stderr, "\tTraversing critical vertices.\n");
}
DEBUGP("Searching step\n");
visited = (char *)malloc(bmz8->n/8 + 1);
visited = (cmph_uint8 *)malloc(bmz8->n/8 + 1);
memset(visited, 0, bmz8->n/8 + 1);
used_edges = (cmph_uint8 *)malloc(bmz8->m/8 + 1);
memset(used_edges, 0, bmz8->m/8 + 1);

View File

@@ -19,10 +19,8 @@
static int brz_gen_mphf(cmph_config_t *mph);
static cmph_uint32 brz_min_index(cmph_uint32 * vector, cmph_uint32 n);
static char * brz_read_key(FILE * fd);
static void brz_destroy_keys_vd(char ** keys_vd, cmph_uint8 nkeys);
static char * brz_copy_partial_mphf(brz_config_data_t *brz, bmz8_data_t * bmzf, cmph_uint32 index, cmph_uint32 *buflen);
static void brz_flush_g(brz_config_data_t *brz, cmph_uint32 *start_index, FILE * fd);
brz_config_data_t *brz_config_new()
{
brz_config_data_t *brz = NULL;
@@ -449,26 +447,6 @@ static cmph_uint32 brz_min_index(cmph_uint32 * vector, cmph_uint32 n)
return min_index;
}
static char * brz_read_key(FILE * fd)
{
char * buf = (char *)malloc(BUFSIZ);
cmph_uint32 buf_pos = 0;
char c;
while(1)
{
fread(&c, sizeof(char), 1, fd);
if(feof(fd))
{
free(buf);
return NULL;
}
buf[buf_pos++] = c;
if(c == '\0') break;
if(buf_pos % BUFSIZ == 0) buf = (char *)realloc(buf, buf_pos + BUFSIZ);
}
return buf;
}
static void brz_destroy_keys_vd(char ** keys_vd, cmph_uint8 nkeys)
{
cmph_uint8 i;
@@ -477,7 +455,6 @@ static void brz_destroy_keys_vd(char ** keys_vd, cmph_uint8 nkeys)
static char * brz_copy_partial_mphf(brz_config_data_t *brz, bmz8_data_t * bmzf, cmph_uint32 index, cmph_uint32 *buflen)
{
cmph_uint32 i;
cmph_uint32 buflenh1 = 0;
cmph_uint32 buflenh2 = 0;
char * bufh1 = NULL;

View File

@@ -106,7 +106,7 @@ cmph_t *chm_new(cmph_config_t *mph, float c)
fprintf(stderr, "Starting assignment step\n");
}
DEBUGP("Assignment step\n");
visited = (char *)malloc(chm->n/8 + 1);
visited = (cmph_uint8 *)malloc(chm->n/8 + 1);
memset(visited, 0, chm->n/8 + 1);
free(chm->g);
chm->g = malloc(chm->n * sizeof(cmph_uint32));

View File

@@ -16,7 +16,7 @@ void djb2_state_destroy(djb2_state_t *state)
cmph_uint32 djb2_hash(djb2_state_t *state, const char *k, cmph_uint32 keylen)
{
register cmph_uint32 hash = 5381;
const unsigned char *ptr = k;
const unsigned char *ptr = (unsigned char *)k;
cmph_uint32 i = 0;
while (i < keylen)
{

View File

@@ -64,7 +64,7 @@ int main(int argc, char **argv)
float c = 2.09;
cmph_config_t *config = NULL;
cmph_t *mphf = NULL;
cmph_uint8 * tmp_dir = NULL;
char * tmp_dir = NULL;
cmph_io_adapter_t *source;
cmph_uint32 memory_availability = 0;
cmph_uint32 b = 128;
@@ -226,7 +226,7 @@ int main(int argc, char **argv)
cmph_config_set_algo(config, mph_algo);
if (nhashes) cmph_config_set_hashfuncs(config, hashes);
cmph_config_set_verbosity(config, verbosity);
cmph_config_set_tmp_dir(config, tmp_dir);
cmph_config_set_tmp_dir(config, (cmph_uint8 *) tmp_dir);
cmph_config_set_mphf_fd(config, mphf_fd);
cmph_config_set_memory_availability(config, memory_availability);
cmph_config_set_b(config, b);

View File

@@ -16,7 +16,7 @@ void sdbm_state_destroy(sdbm_state_t *state)
cmph_uint32 sdbm_hash(sdbm_state_t *state, const char *k, cmph_uint32 keylen)
{
register cmph_uint32 hash = 0;
const unsigned char *ptr = k;
const unsigned char *ptr = (unsigned char *)k;
cmph_uint32 i = 0;
while(i < keylen) {