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> 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. Update to automake 1.7.
* Makefile.am (AUTOMAKE_OPTIONS): Update to require 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 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; struct directory_contents const *key = (struct directory_contents const *) key_0;
unsigned long hash; unsigned long hash;
@ -270,7 +271,8 @@ directory_contents_hash_1 (void const *key_0)
} }
static unsigned long 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; struct directory_contents const *key = (struct directory_contents const *) key_0;
unsigned long hash; unsigned long hash;
@ -293,7 +295,9 @@ directory_contents_hash_2 (void const *key_0)
} }
static int 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 *x = (struct directory_contents const *) xv;
struct directory_contents const *y = (struct directory_contents const *) yv; struct directory_contents const *y = (struct directory_contents const *) yv;
@ -341,19 +345,23 @@ struct directory
}; };
static unsigned long 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); return_ISTRING_HASH_1 (((struct directory const *) key)->name);
} }
static unsigned long 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); return_ISTRING_HASH_2 (((struct directory const *) key)->name);
} }
static int 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, return_ISTRING_COMPARE (((struct directory const *) x)->name,
((struct directory const *) y)->name); ((struct directory const *) y)->name);
@ -379,19 +387,23 @@ struct dirfile
}; };
static unsigned long 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); return_ISTRING_HASH_1 (((struct dirfile const *) key)->name);
} }
static unsigned long 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); return_ISTRING_HASH_2 (((struct dirfile const *) key)->name);
} }
static int 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 *x = ((struct dirfile const *) xv);
struct dirfile const *y = ((struct dirfile const *) yv); 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. */ /* Hash table of files the makefile knows how to make. */
static unsigned long 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); return_ISTRING_HASH_1 (((struct file const *) key)->hname);
} }
static unsigned long 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); return_ISTRING_HASH_2 (((struct file const *) key)->hname);
} }
static int 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, return_ISTRING_COMPARE (((struct file const *) x)->hname,
((struct file const *) y)->hname); ((struct file const *) y)->hname);

View File

@ -41,21 +41,25 @@ struct function_table_entry
}; };
static unsigned long 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; struct function_table_entry const *key = (struct function_table_entry const *) keyv;
return_STRING_N_HASH_1 (key->name, key->len); return_STRING_N_HASH_1 (key->name, key->len);
} }
static unsigned long 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; struct function_table_entry const *key = (struct function_table_entry const *) keyv;
return_STRING_N_HASH_2 (key->name, key->len); return_STRING_N_HASH_2 (key->name, key->len);
} }
static int 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 *x = (struct function_table_entry const *) xv;
struct function_table_entry const *y = (struct function_table_entry const *) yv; struct function_table_entry const *y = (struct function_table_entry const *) yv;
@ -896,19 +900,23 @@ struct a_word
}; };
static unsigned long 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); return_STRING_HASH_1 (((struct a_word const *) key)->str);
} }
static unsigned long 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); return_STRING_HASH_2 (((struct a_word const *) key)->str);
} }
static int 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; int result = ((struct a_word const *) x)->length - ((struct a_word const *) y)->length;
if (result) if (result)

12
read.c
View File

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

View File

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