aboutsummaryrefslogtreecommitdiff
path: root/gcc/hashtable.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2003-07-06 08:15:36 +0200
committerAndreas Jaeger <aj@gcc.gnu.org>2003-07-06 08:15:36 +0200
commit1d088deebefc04b8c99fe00e4df4e9c4ddacec2d (patch)
tree5608aad0f59e34928c3ebcd5b5bf7492d6a81e96 /gcc/hashtable.c
parent481668695af894b6738d2d64f3e005b2709399c5 (diff)
downloadgcc-1d088deebefc04b8c99fe00e4df4e9c4ddacec2d.zip
gcc-1d088deebefc04b8c99fe00e4df4e9c4ddacec2d.tar.gz
gcc-1d088deebefc04b8c99fe00e4df4e9c4ddacec2d.tar.bz2
gcc.c: Convert prototypes to ISO C90.
* gcc.c: Convert prototypes to ISO C90. * gcc.h: Likewise. * gcov-dump.c: Likewise. * gcov-iov.c: Likewise. * gcse.c: Likewise. * genattrtab.h: Likewise. * ggc.h: Likewise. * global.c: Likewise. * graph.c: Likewise. * graph.h: Likewise. * hosthooks.h: Likewise. * hooks.h: Likewise. * hooks.c: Likewise. * hashtable.h: Likewise. * hashtable.c: Likewise. * haifa-sched.c: Likewise. * integrate.h: Likewise. * integrate.c: Likewise. * input.h: Likewise. * ifcvt.c: Likewise. From-SVN: r68995
Diffstat (limited to 'gcc/hashtable.c')
-rw-r--r--gcc/hashtable.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/gcc/hashtable.c b/gcc/hashtable.c
index 86898f3..88b1a29 100644
--- a/gcc/hashtable.c
+++ b/gcc/hashtable.c
@@ -1,5 +1,5 @@
/* Hash tables.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -32,15 +32,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
existing entry with a potential new one. Also, the ability to
delete members from the table has been removed. */
-static unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int));
-static void ht_expand PARAMS ((hash_table *));
+static unsigned int calc_hash (const unsigned char *, unsigned int);
+static void ht_expand (hash_table *);
/* Calculate the hash of the string STR of length LEN. */
static unsigned int
-calc_hash (str, len)
- const unsigned char *str;
- unsigned int len;
+calc_hash (const unsigned char *str, unsigned int len)
{
unsigned int n = len;
unsigned int r = 0;
@@ -56,8 +54,7 @@ calc_hash (str, len)
/* Initialize an identifier hashtable. */
hash_table *
-ht_create (order)
- unsigned int order;
+ht_create (unsigned int order)
{
unsigned int nslots = 1 << order;
hash_table *table;
@@ -77,8 +74,7 @@ ht_create (order)
/* Frees all memory associated with a hash table. */
void
-ht_destroy (table)
- hash_table *table;
+ht_destroy (hash_table *table)
{
obstack_free (&table->stack, NULL);
free (table->entries);
@@ -94,11 +90,8 @@ ht_destroy (table)
CPP_ALLOCED and the item is assumed to be at the top of the
obstack. */
hashnode
-ht_lookup (table, str, len, insert)
- hash_table *table;
- const unsigned char *str;
- unsigned int len;
- enum ht_lookup_option insert;
+ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
+ enum ht_lookup_option insert)
{
unsigned int hash = calc_hash (str, len);
unsigned int hash2;
@@ -158,8 +151,7 @@ ht_lookup (table, str, len, insert)
/* Double the size of a hash table, re-hashing existing entries. */
static void
-ht_expand (table)
- hash_table *table;
+ht_expand (hash_table *table)
{
hashnode *nentries, *p, *limit;
unsigned int size, sizemask;
@@ -200,10 +192,7 @@ ht_expand (table)
/* For all nodes in TABLE, callback CB with parameters TABLE->PFILE,
the node, and V. */
void
-ht_forall (table, cb, v)
- hash_table *table;
- ht_cb cb;
- const void *v;
+ht_forall (hash_table *table, ht_cb cb, const void *v)
{
hashnode *p, *limit;
@@ -221,8 +210,7 @@ ht_forall (table, cb, v)
/* Dump allocation statistics to stderr. */
void
-ht_dump_statistics (table)
- hash_table *table;
+ht_dump_statistics (hash_table *table)
{
size_t nelts, nids, overhead, headers;
size_t total_bytes, longest, sum_of_squares;
@@ -251,7 +239,7 @@ ht_dump_statistics (table)
nids++;
}
while (++p < limit);
-
+
nelts = table->nelements;
overhead = obstack_memory_used (&table->stack) - total_bytes;
headers = table->nslots * sizeof (hashnode);
@@ -287,8 +275,7 @@ ht_dump_statistics (table)
/* Return the approximate positive square root of a number N. This is for
statistical reports, not code generation. */
double
-approx_sqrt (x)
- double x;
+approx_sqrt (double x)
{
double s, d;