From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29039 invoked by alias); 29 Apr 2005 17:01:55 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 28660 invoked from network); 29 Apr 2005 17:01:40 -0000 Received: from unknown (HELO rwcrmhc11.comcast.net) (204.127.198.35) by sourceware.org with SMTP; 29 Apr 2005 17:01:40 -0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (rwcrmhc11) with ESMTP id <2005042917013901300f4lpte>; Fri, 29 Apr 2005 17:01:39 +0000 Received: by lucon.org (Postfix, from userid 1000) id 0F8B663E85; Fri, 29 Apr 2005 10:01:38 -0700 (PDT) Date: Fri, 29 Apr 2005 17:47:00 -0000 From: "H. J. Lu" To: binutils@sources.redhat.com Cc: bje@au.ibm.com Subject: PATCH: Revert gas/hash.? and binutils/bucomm.? Message-ID: <20050429170136.GA20770@lucon.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2005-04/txt/msg00894.txt.bz2 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 193 I checked in the following patches to revert the last changes to gas/hash.? and binutils/bucomm.?. hash_replace and hash_delete are used by some assemblers. report is used by dlltool.c. H.J. --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=b Content-length: 1503 ? autom4te.cache Index: ChangeLog =================================================================== RCS file: /cvs/src/src/binutils/ChangeLog,v retrieving revision 1.919 diff -u -p -r1.919 ChangeLog --- ChangeLog 29 Apr 2005 01:15:21 -0000 1.919 +++ ChangeLog 29 Apr 2005 16:49:00 -0000 @@ -1,3 +1,8 @@ +2005-04-29 H.J. Lu + + * bucomm.c: Undo the last change. + * bucomm.h: Likewise. + 2005-04-29 Ben Elliston * syslex.l (word, number, unit): Remove unused variables. Index: bucomm.c =================================================================== RCS file: /cvs/src/src/binutils/bucomm.c,v retrieving revision 1.21 diff -u -p -r1.21 bucomm.c --- bucomm.c 29 Apr 2005 00:03:32 -0000 1.21 +++ bucomm.c 29 Apr 2005 16:49:00 -0000 @@ -65,7 +65,7 @@ bfd_fatal (const char *string) xexit (1); } -static void +void report (const char * format, va_list args) { fprintf (stderr, "%s: ", program_name); Index: bucomm.h =================================================================== RCS file: /cvs/src/src/binutils/bucomm.h,v retrieving revision 1.12 diff -u -p -r1.12 bucomm.h --- bucomm.h 29 Apr 2005 00:03:32 -0000 1.12 +++ bucomm.h 29 Apr 2005 16:49:00 -0000 @@ -152,6 +152,8 @@ void bfd_nonfatal (const char *); void bfd_fatal (const char *) ATTRIBUTE_NORETURN; +void report (const char *, va_list); + void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; void non_fatal (const char *, ...) ATTRIBUTE_PRINTF_1; --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=g Content-length: 3420 ? autom4te.cache Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gas/ChangeLog,v retrieving revision 1.2505 diff -u -p -r1.2505 ChangeLog --- ChangeLog 29 Apr 2005 00:22:23 -0000 1.2505 +++ ChangeLog 29 Apr 2005 16:54:58 -0000 @@ -1,3 +1,8 @@ +2005-04-29 H.J. Lu + + * hash.c: Undo the last change. + * hash.h: Likewise. + 2005-04-29 Ben Elliston * Makefile.am (GAS_CFILES): Remove bignum-copy.c. Index: hash.c =================================================================== RCS file: /cvs/src/src/gas/hash.c,v retrieving revision 1.16 diff -u -p -r1.16 hash.c --- hash.c 29 Apr 2005 00:22:26 -0000 1.16 +++ hash.c 29 Apr 2005 16:54:58 -0000 @@ -294,6 +294,31 @@ hash_jam (struct hash_control *table, co return NULL; } +/* Replace an existing entry in a hash table. This returns the old + value stored for the entry. If the entry is not found in the hash + table, this does nothing and returns NULL. */ + +PTR +hash_replace (struct hash_control *table, const char *key, PTR value) +{ + struct hash_entry *p; + PTR ret; + + p = hash_lookup (table, key, NULL, NULL); + if (p == NULL) + return NULL; + +#ifdef HASH_STATISTICS + ++table->replacements; +#endif + + ret = p->data; + + p->data = value; + + return ret; +} + /* Find an entry in a hash table, returning its value. Returns NULL if the entry is not found. */ @@ -309,6 +334,35 @@ hash_find (struct hash_control *table, c return p->data; } +/* Delete an entry from a hash table. This returns the value stored + for that entry, or NULL if there is no such entry. */ + +PTR +hash_delete (struct hash_control *table, const char *key) +{ + struct hash_entry *p; + struct hash_entry **list; + + p = hash_lookup (table, key, &list, NULL); + if (p == NULL) + return NULL; + + if (p != *list) + abort (); + +#ifdef HASH_STATISTICS + ++table->deletions; +#endif + + *list = p->next; + + /* Note that we never reclaim the memory for this entry. If gas + ever starts deleting hash table entries in a big way, this will + have to change. */ + + return p->data; +} + /* Traverse a hash table. Call the function on every entry in the hash table. */ Index: hash.h =================================================================== RCS file: /cvs/src/src/gas/hash.h,v retrieving revision 1.9 diff -u -p -r1.9 hash.h --- hash.h 29 Apr 2005 00:22:26 -0000 1.9 +++ hash.h 29 Apr 2005 16:54:58 -0000 @@ -51,11 +51,23 @@ extern const char *hash_insert (struct h extern const char *hash_jam (struct hash_control *, const char *key, PTR value); +/* Replace an existing entry in a hash table. This returns the old + value stored for the entry. If the entry is not found in the hash + table, this does nothing and returns NULL. */ + +extern PTR hash_replace (struct hash_control *, const char *key, + PTR value); + /* Find an entry in a hash table, returning its value. Returns NULL if the entry is not found. */ extern PTR hash_find (struct hash_control *, const char *key); +/* Delete an entry from a hash table. This returns the value stored + for that entry, or NULL if there is no such entry. */ + +extern PTR hash_delete (struct hash_control *, const char *key); + /* Traverse a hash table. Call the function on every entry in the hash table. */ --5mCyUwZo2JvN/JJP--