/* hash.c -- gas hash table code
- Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 98, 99, 2000
+ Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+ 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
structure. */
#include "as.h"
+#include "safe-ctype.h"
#include "obstack.h"
/* The default number of entries to use when creating a hash table. */
/* An entry in a hash table. */
-struct hash_entry
-{
+struct hash_entry {
/* Next entry for this hash code. */
struct hash_entry *next;
/* String being hashed. */
/* A hash table. */
-struct hash_control
-{
+struct hash_control {
/* The hash array. */
struct hash_entry **table;
/* The number of slots in the hash table. */
printf ("hash_test command: ");
gets (answer);
command = answer[0];
- if (isupper (command))
- command = tolower (command); /* Ecch! */
+ command = TOLOWER (command); /* Ecch! */
switch (command)
{
case '#':
what (description)
char *description;
{
- char *retval;
- char *malloc ();
-
printf (" %s : ", description);
gets (answer);
- /* Will one day clean up answer here. */
- retval = malloc (strlen (answer) + 1);
- if (!retval)
- {
- error ("room");
- }
- (void) strcpy (retval, answer);
- return (retval);
+ return xstrdup (answer);
}
void