Changeset 501 in kBuild for vendor/gnumake/current/hash.c
- Timestamp:
- Sep 15, 2006 2:30:32 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/hash.c
r54 r501 3 3 Written by Greg McGary <[email protected]> <[email protected]> 4 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 */ 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License along with 16 this program; see the file COPYING. If not, write to the Free Software 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ 19 18 20 19 #include "make.h" … … 127 126 128 127 void * 129 hash_insert (struct hash_table *ht, void *item)128 hash_insert (struct hash_table *ht, const void *item) 130 129 { 131 130 void **slot = hash_find_slot (ht, item); 132 void *old_item = slot ? *slot : 0;131 const void *old_item = slot ? *slot : 0; 133 132 hash_insert_at (ht, item, slot); 134 return ( (HASH_VACANT (old_item)) ? 0 : old_item);135 } 136 137 void * 138 hash_insert_at (struct hash_table *ht, void *item, const void *slot)139 { 140 void *old_item = *(void **) slot;133 return (void *)((HASH_VACANT (old_item)) ? 0 : old_item); 134 } 135 136 void * 137 hash_insert_at (struct hash_table *ht, const void *item, const void *slot) 138 { 139 const void *old_item = *(void **) slot; 141 140 if (HASH_VACANT (old_item)) 142 141 {
Note:
See TracChangeset
for help on using the changeset viewer.