projects
/
chise
/
concord.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update.
[chise/concord.git]
/
name.c
diff --git
a/name.c
b/name.c
index
41ca2ec
..
da8b7d5
100644
(file)
--- a/
name.c
+++ b/
name.c
@@
-1,4
+1,4
@@
-/* Copyright (C) 2003,2004,2005,2006 MORIOKA Tomohiko
+/* Copyright (C) 2003, 2004, 2005, 2006, 2013 MORIOKA Tomohiko
This file is part of the CONCORD Library.
The CONCORD Library is free software; you can redistribute it and/or
This file is part of the CONCORD Library.
The CONCORD Library is free software; you can redistribute it and/or
@@
-34,7
+34,7
@@
struct CONCORD_HASH_TABLE
CONCORD_HASH_TABLE* concord_make_hash_table (size_t size);
void concord_destroy_hash_table (CONCORD_HASH_TABLE* hash);
CONCORD_HASH_TABLE* concord_make_hash_table (size_t size);
void concord_destroy_hash_table (CONCORD_HASH_TABLE* hash);
-int concord_hash_c_string (const unsigned char *ptr);
+unsigned long concord_hash_c_string (const unsigned char *ptr);
CONCORD_HASH_TABLE*
concord_make_hash_table (size_t size)
CONCORD_HASH_TABLE*
concord_make_hash_table (size_t size)
@@
-70,14
+70,14
@@
concord_destroy_hash_table (CONCORD_HASH_TABLE* table)
/* derived from hashpjw, Dragon Book P436. */
/* derived from hashpjw, Dragon Book P436. */
-int
+unsigned long
concord_hash_c_string (const unsigned char *ptr)
{
concord_hash_c_string (const unsigned char *ptr)
{
- int hash = 0;
+ unsigned long hash = 0;
while (*ptr != '\0')
{
while (*ptr != '\0')
{
- int g;
+ unsigned long g;
hash = (hash << 4) + *ptr++;
g = hash & 0xf0000000;
if (g)
hash = (hash << 4) + *ptr++;
g = hash & 0xf0000000;
if (g)
@@
-194,6
+194,7
@@
concord_name_table_grow (CONCORD_NAME_TABLE* table)
}
}
}
}
}
}
+ free (table->data);
table->size = new_table->size;
table->data = new_table->data;
free (new_table);
table->size = new_table->size;
table->data = new_table->data;
free (new_table);