Fix K&R-isms found on SunOS 4.1.4 builds.

This commit is contained in:
Paul Smith 2002-10-04 02:12:52 +00:00
parent 1d3dfeb74b
commit 9dc79463a9
6 changed files with 64 additions and 25 deletions

View file

@ -1,5 +1,12 @@
2002-10-03 Paul D. Smith <psmith@gnu.org>
Version 3.80 released.
* dir.c: Change hash functions to use K&R function definition style.
* function.c: Ditto.
* read.c: Ditto.
* variable.c: Ditto.
Update to automake 1.7.
* Makefile.am (AUTOMAKE_OPTIONS): Update to require 1.7.

30
dir.c
View file

@ -248,7 +248,8 @@ struct directory_contents
};
static unsigned long
directory_contents_hash_1 (void const *key_0)
directory_contents_hash_1 (key_0)
const void *key_0;
{
struct directory_contents const *key = (struct directory_contents const *) key_0;
unsigned long hash;
@ -270,7 +271,8 @@ directory_contents_hash_1 (void const *key_0)
}
static unsigned long
directory_contents_hash_2 (void const *key_0)
directory_contents_hash_2 (key_0)
const void *key_0;
{
struct directory_contents const *key = (struct directory_contents const *) key_0;
unsigned long hash;
@ -293,7 +295,9 @@ directory_contents_hash_2 (void const *key_0)
}
static int
directory_contents_hash_cmp (void const *xv, void const *yv)
directory_contents_hash_cmp (xv, yv)
const void *xv;
const void *yv;
{
struct directory_contents const *x = (struct directory_contents const *) xv;
struct directory_contents const *y = (struct directory_contents const *) yv;
@ -341,19 +345,23 @@ struct directory
};
static unsigned long
directory_hash_1 (void const *key)
directory_hash_1 (key)
const void *key;
{
return_ISTRING_HASH_1 (((struct directory const *) key)->name);
}
static unsigned long
directory_hash_2 (void const *key)
directory_hash_2 (key)
const void *key;
{
return_ISTRING_HASH_2 (((struct directory const *) key)->name);
}
static int
directory_hash_cmp (void const *x, void const *y)
directory_hash_cmp (x, y)
const void *x;
const void *y;
{
return_ISTRING_COMPARE (((struct directory const *) x)->name,
((struct directory const *) y)->name);
@ -379,19 +387,23 @@ struct dirfile
};
static unsigned long
dirfile_hash_1 (void const *key)
dirfile_hash_1 (key)
const void *key;
{
return_ISTRING_HASH_1 (((struct dirfile const *) key)->name);
}
static unsigned long
dirfile_hash_2 (void const *key)
dirfile_hash_2 (key)
const void *key;
{
return_ISTRING_HASH_2 (((struct dirfile const *) key)->name);
}
static int
dirfile_hash_cmp (void const *xv, void const *yv)
dirfile_hash_cmp (xv, yv)
const void *xv;
const void *yv;
{
struct dirfile const *x = ((struct dirfile const *) xv);
struct dirfile const *y = ((struct dirfile const *) yv);

10
file.c
View file

@ -34,19 +34,23 @@ Boston, MA 02111-1307, USA. */
/* Hash table of files the makefile knows how to make. */
static unsigned long
file_hash_1 (void const *key)
file_hash_1 (key)
const void *key;
{
return_ISTRING_HASH_1 (((struct file const *) key)->hname);
}
static unsigned long
file_hash_2 (void const *key)
file_hash_2 (key)
const void *key;
{
return_ISTRING_HASH_2 (((struct file const *) key)->hname);
}
static int
file_hash_cmp (void const *x, void const *y)
file_hash_cmp (x, y)
const void *x;
const void *y;
{
return_ISTRING_COMPARE (((struct file const *) x)->hname,
((struct file const *) y)->hname);

View file

@ -41,21 +41,25 @@ struct function_table_entry
};
static unsigned long
function_table_entry_hash_1 (void const *keyv)
function_table_entry_hash_1 (keyv)
const void *keyv;
{
struct function_table_entry const *key = (struct function_table_entry const *) keyv;
return_STRING_N_HASH_1 (key->name, key->len);
}
static unsigned long
function_table_entry_hash_2 (void const *keyv)
function_table_entry_hash_2 (keyv)
const void *keyv;
{
struct function_table_entry const *key = (struct function_table_entry const *) keyv;
return_STRING_N_HASH_2 (key->name, key->len);
}
static int
function_table_entry_hash_cmp (void const *xv, void const *yv)
function_table_entry_hash_cmp (xv, yv)
const void *xv;
const void *yv;
{
struct function_table_entry const *x = (struct function_table_entry const *) xv;
struct function_table_entry const *y = (struct function_table_entry const *) yv;
@ -896,19 +900,23 @@ struct a_word
};
static unsigned long
a_word_hash_1 (void const *key)
a_word_hash_1 (key)
const void *key;
{
return_STRING_HASH_1 (((struct a_word const *) key)->str);
}
static unsigned long
a_word_hash_2 (void const *key)
a_word_hash_2 (key)
const void *key;
{
return_STRING_HASH_2 (((struct a_word const *) key)->str);
}
static int
a_word_hash_cmp (void const *x, void const *y)
a_word_hash_cmp (x, y)
const void *x;
const void *y;
{
int result = ((struct a_word const *) x)->length - ((struct a_word const *) y)->length;
if (result)

12
read.c
View file

@ -272,7 +272,7 @@ read_all_makefiles (makefiles)
return read_makefiles;
}
int
static int
eval_makefile (filename, flags)
char *filename;
int flags;
@ -1551,19 +1551,23 @@ conditional_line (line, flocp)
/* Remove duplicate dependencies in CHAIN. */
static unsigned long
dep_hash_1 (void const *key)
dep_hash_1 (key)
const void *key;
{
return_STRING_HASH_1 (dep_name ((struct dep const *) key));
}
static unsigned long
dep_hash_2 (void const *key)
dep_hash_2 (key)
const void *key;
{
return_STRING_HASH_2 (dep_name ((struct dep const *) key));
}
static int
dep_hash_cmp (void const *x, void const *y)
dep_hash_cmp (x, y)
const void *x;
const void *y;
{
struct dep *dx = (struct dep *) x;
struct dep *dy = (struct dep *) y;

View file

@ -33,21 +33,25 @@ Boston, MA 02111-1307, USA. */
/* Hash table of all global variable definitions. */
static unsigned long
variable_hash_1 (void const *keyv)
variable_hash_1 (keyv)
const void *keyv;
{
struct variable const *key = (struct variable const *) keyv;
return_STRING_N_HASH_1 (key->name, key->length);
}
static unsigned long
variable_hash_2 (void const *keyv)
variable_hash_2 (keyv)
const void *keyv;
{
struct variable const *key = (struct variable const *) keyv;
return_STRING_N_HASH_2 (key->name, key->length);
}
static int
variable_hash_cmp (void const *xv, void const *yv)
variable_hash_cmp (xv, yv)
const void *xv;
const void *yv;
{
struct variable const *x = (struct variable const *) xv;
struct variable const *y = (struct variable const *) yv;