X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/040984073a54b4c603172be3c3f44b908ea5deb9..f16b08196c780556cbf50691e2944960aebc46f6:/lib/bitset_stats.c diff --git a/lib/bitset_stats.c b/lib/bitset_stats.c index bc771584..a7f53fbc 100644 --- a/lib/bitset_stats.c +++ b/lib/bitset_stats.c @@ -1,10 +1,10 @@ /* Bitset statistics. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). - This program is free software; you can redistribute it and/or modify + This program 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 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -13,28 +13,24 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ + along with this program. If not, see . */ /* This file is a wrapper bitset implementation for the other bitset implementations. It provides bitset compatibility checking and statistics gathering without having to instrument the bitset implementations. When statistics gathering is enabled, the bitset operations get vectored through here and we then call the appropriate - routines. -*/ + routines. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include + +#include "bitset_stats.h" #include "bbitset.h" #include "abitset.h" #include "ebitset.h" #include "lbitset.h" #include "vbitset.h" -#include "bitset_stats.h" #include #include #include @@ -241,17 +237,17 @@ bitset_stats_disable (void) /* Read bitset statistics file. */ void -bitset_stats_read (const char *filename) +bitset_stats_read (const char *file_name) { FILE *file; if (!bitset_stats_info) return; - if (!filename) - filename = BITSET_STATS_FILE; + if (!file_name) + file_name = BITSET_STATS_FILE; - file = fopen (filename, "r"); + file = fopen (file_name, "r"); if (file) { if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data), @@ -271,17 +267,17 @@ bitset_stats_read (const char *filename) /* Write bitset statistics file. */ void -bitset_stats_write (const char *filename) +bitset_stats_write (const char *file_name) { FILE *file; if (!bitset_stats_info) return; - if (!filename) - filename = BITSET_STATS_FILE; + if (!file_name) + file_name = BITSET_STATS_FILE; - file = fopen (filename, "w"); + file = fopen (file_name, "w"); if (file) { if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data), @@ -696,6 +692,9 @@ bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type) we are a wrapper over. */ switch (type) { + default: + abort (); + case BITSET_ARRAY: bytes = abitset_bytes (n_bits); sbset = xcalloc (1, bytes); @@ -719,9 +718,6 @@ bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type) sbset = xcalloc (1, bytes); vbitset_init (sbset, n_bits); break; - - default: - abort (); } bset->s.bset = sbset;