X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=include%2Ffibheap.h;h=16d26eea7d8c1b968895bbb570d47398b540b5dc;hb=ad43e107eb233dcef8e76da6328aa4e4d74afd84;hp=06f4b39e39011dbc9b0e2f9f9ed069e508037721;hpb=f01b59ed06353e2b0254f6fb6493d7407f8d166f;p=deliverable%2Fbinutils-gdb.git diff --git a/include/fibheap.h b/include/fibheap.h index 06f4b39e39..16d26eea7d 100644 --- a/include/fibheap.h +++ b/include/fibheap.h @@ -1,23 +1,23 @@ /* A Fibonacci heap datatype. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998-2016 Free Software Foundation, Inc. Contributed by Daniel Berlin (dan@cgsoftware.com). -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify it +GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -GNU CC is distributed in the hope that it will be useful, but +GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ /* Fibonacci heaps are somewhat complex, but, there's an article in DDJ that explains them pretty well: @@ -40,7 +40,11 @@ Boston, MA 02111-1307, USA. */ #ifndef _FIBHEAP_H_ #define _FIBHEAP_H_ -#include +#include "ansidecl.h" + +#ifdef __cplusplus +extern "C" { +#endif typedef long fibheapkey_t; @@ -59,23 +63,32 @@ typedef struct fibnode struct fibnode *right; fibheapkey_t key; void *data; +#if defined (__GNUC__) && (!defined (SIZEOF_INT) || SIZEOF_INT < 4) + __extension__ unsigned long int degree : 31; + __extension__ unsigned long int mark : 1; +#else unsigned int degree : 31; unsigned int mark : 1; +#endif } *fibnode_t; -extern fibheap_t fibheap_new PARAMS ((void)); -extern fibnode_t fibheap_insert PARAMS ((fibheap_t, fibheapkey_t, void *)); -extern int fibheap_empty PARAMS ((fibheap_t)); -extern fibheapkey_t fibheap_min_key PARAMS ((fibheap_t)); -extern fibheapkey_t fibheap_replace_key PARAMS ((fibheap_t, fibnode_t, - fibheapkey_t)); -extern void *fibheap_replace_key_data PARAMS ((fibheap_t, fibnode_t, - fibheapkey_t, void *)); -extern void *fibheap_extract_min PARAMS ((fibheap_t)); -extern void *fibheap_min PARAMS ((fibheap_t)); -extern void *fibheap_replace_data PARAMS ((fibheap_t, fibnode_t, void *)); -extern void *fibheap_delete_node PARAMS ((fibheap_t, fibnode_t)); -extern void fibheap_delete PARAMS ((fibheap_t)); -extern fibheap_t fibheap_union PARAMS ((fibheap_t, fibheap_t)); +extern fibheap_t fibheap_new (void); +extern fibnode_t fibheap_insert (fibheap_t, fibheapkey_t, void *); +extern int fibheap_empty (fibheap_t); +extern fibheapkey_t fibheap_min_key (fibheap_t); +extern fibheapkey_t fibheap_replace_key (fibheap_t, fibnode_t, + fibheapkey_t); +extern void *fibheap_replace_key_data (fibheap_t, fibnode_t, + fibheapkey_t, void *); +extern void *fibheap_extract_min (fibheap_t); +extern void *fibheap_min (fibheap_t); +extern void *fibheap_replace_data (fibheap_t, fibnode_t, void *); +extern void *fibheap_delete_node (fibheap_t, fibnode_t); +extern void fibheap_delete (fibheap_t); +extern fibheap_t fibheap_union (fibheap_t, fibheap_t); + +#ifdef __cplusplus +} +#endif #endif /* _FIBHEAP_H_ */