projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug which crashed gui if it attempted to enter invalid variable names.
[pspp-builds.git]
/
src
/
libpspp
/
hash.c
diff --git
a/src/libpspp/hash.c
b/src/libpspp/hash.c
index a6d5f5d88daae8d780405f57b8ebfb244ee23c51..9d88d6f7d568c221f5496a60bfef585a99f873fe 100644
(file)
--- a/
src/libpspp/hash.c
+++ b/
src/libpspp/hash.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-151,7
+150,7
@@
struct hsh_table
size_t size; /* Number of entries (a power of 2). */
void **entries; /* Hash table proper. */
size_t size; /* Number of entries (a power of 2). */
void **entries; /* Hash table proper. */
-
void *aux;
/* Auxiliary data for comparison functions. */
+
const void *aux;
/* Auxiliary data for comparison functions. */
hsh_compare_func *compare;
hsh_hash_func *hash;
hsh_free_func *free;
hsh_compare_func *compare;
hsh_hash_func *hash;
hsh_free_func *free;
@@
-167,7
+166,7
@@
struct hsh_table
struct hsh_table *
hsh_create (int size, hsh_compare_func *compare, hsh_hash_func *hash,
struct hsh_table *
hsh_create (int size, hsh_compare_func *compare, hsh_hash_func *hash,
- hsh_free_func *free, void *aux)
+ hsh_free_func *free,
const
void *aux)
{
return hsh_create_pool (NULL, size, compare, hash, free, aux);
}
{
return hsh_create_pool (NULL, size, compare, hash, free, aux);
}
@@
-181,7
+180,7
@@
hsh_create (int size, hsh_compare_func *compare, hsh_hash_func *hash,
struct hsh_table *
hsh_create_pool (struct pool *pool, int size,
hsh_compare_func *compare, hsh_hash_func *hash,
struct hsh_table *
hsh_create_pool (struct pool *pool, int size,
hsh_compare_func *compare, hsh_hash_func *hash,
- hsh_free_func *free, void *aux)
+ hsh_free_func *free,
const
void *aux)
{
struct hsh_table *h;
int i;
{
struct hsh_table *h;
int i;
@@
-323,7
+322,7
@@
rehash (struct hsh_table *h, size_t new_size)
/* A "algo_predicate_func" that returns true if DATA points
to a non-null void. */
static bool
/* A "algo_predicate_func" that returns true if DATA points
to a non-null void. */
static bool
-not_null (const void *data_, void *aux UNUSED)
+not_null (const void *data_,
const
void *aux UNUSED)
{
void *const *data = data_;
{
void *const *data = data_;
@@
-365,11
+364,11
@@
hsh_data (struct hsh_table *h)
/* Dereferences void ** pointers and passes them to the hash
comparison function. */
static int
/* Dereferences void ** pointers and passes them to the hash
comparison function. */
static int
-comparison_helper (const void *a_, const void *b_, void *h_)
+comparison_helper (const void *a_, const void *b_,
const
void *h_)
{
void *const *a = a_;
void *const *b = b_;
{
void *const *a = a_;
void *const *b = b_;
- struct hsh_table *h = h_;
+
const
struct hsh_table *h = h_;
assert(a);
assert(b);
assert(a);
assert(b);