projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Categorical value cache added
[pspp-builds.git]
/
src
/
hash.c
diff --git
a/src/hash.c
b/src/hash.c
index 019ddb1a4ae87e02aed24ed115f53fb5c48a4e3e..bcf5244f049ca64be73130476386a7e95e6cf586 100644
(file)
--- a/
src/hash.c
+++ b/
src/hash.c
@@
-77,7
+77,7
@@
next_power_of_2 (size_t x)
unsigned
hsh_hash_bytes (const void *buf_, size_t size)
{
unsigned
hsh_hash_bytes (const void *buf_, size_t size)
{
- const unsigned char *buf = buf_;
+ const unsigned char *buf =
(const unsigned char *)
buf_;
unsigned hash;
assert (buf != NULL);
unsigned hash;
assert (buf != NULL);
@@
-93,7
+93,7
@@
hsh_hash_bytes (const void *buf_, size_t size)
unsigned
hsh_hash_string (const char *s_)
{
unsigned
hsh_hash_string (const char *s_)
{
- const unsigned char *s = s_;
+ const unsigned char *s =
(const unsigned char *)
s_;
unsigned hash;
assert (s != NULL);
unsigned hash;
assert (s != NULL);
@@
-109,7
+109,7
@@
hsh_hash_string (const char *s_)
unsigned
hsh_hash_case_string (const char *s_)
{
unsigned
hsh_hash_case_string (const char *s_)
{
- const unsigned char *s = s_;
+ const unsigned char *s =
(const unsigned char *)
s_;
unsigned hash;
assert (s != NULL);
unsigned hash;
assert (s != NULL);
@@
-178,7
+178,7
@@
hsh_create (int size, hsh_compare_func *compare, hsh_hash_func *hash,
if (size < 4)
size = 4;
h->size = next_power_of_2 (size);
if (size < 4)
size = 4;
h->size = next_power_of_2 (size);
- h->entries = x
malloc (sizeof *h->entries * h->size
);
+ h->entries = x
nmalloc (h->size, sizeof *h->entries
);
for (i = 0; i < h->size; i++)
h->entries[i] = NULL;
h->aux = aux;
for (i = 0; i < h->size; i++)
h->entries[i] = NULL;
h->aux = aux;
@@
-268,7
+268,7
@@
rehash (struct hsh_table *h, size_t new_size)
end = begin + h->size;
h->size = new_size;
end = begin + h->size;
h->size = new_size;
- h->entries = x
malloc (sizeof *h->entries * h->size
);
+ h->entries = x
nmalloc (h->size, sizeof *h->entries
);
for (i = 0; i < h->size; i++)
h->entries[i] = NULL;
for (table_p = begin; table_p < end; table_p++)
for (i = 0; i < h->size; i++)
h->entries[i] = NULL;
for (table_p = begin; table_p < end; table_p++)
@@
-385,7
+385,7
@@
hsh_data_copy (struct hsh_table *h)
void **copy;
assert (h != NULL);
void **copy;
assert (h != NULL);
- copy = x
malloc ((h->used + 1) *
sizeof *copy);
+ copy = x
nmalloc ((h->used + 1),
sizeof *copy);
copy_if (h->entries, h->size, sizeof *h->entries, copy, not_null, NULL);
copy[h->used] = NULL;
return copy;
copy_if (h->entries, h->size, sizeof *h->entries, copy, not_null, NULL);
copy[h->used] = NULL;
return copy;