mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Base bitset stuff.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
@@ -48,8 +48,8 @@ extern const char * const bitset_type_names[];
|
||||
enum bitset_alloc_type {BITSET_MALLOC, BITSET_OBALLOC};
|
||||
|
||||
/* Data type used to store a word of bits. */
|
||||
typedef unsigned long bitset_word;
|
||||
#define BITSET_WORD_BITS ((unsigned) (CHAR_BIT * sizeof (bitset_word)))
|
||||
typedef unsigned long int bitset_word;
|
||||
#define BITSET_WORD_BITS ((unsigned int) (CHAR_BIT * sizeof (bitset_word)))
|
||||
|
||||
/* Bit index. In theory we might need a type wider than size_t, but
|
||||
in practice we lose at most a factor of CHAR_BIT by going with
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* General bitsets.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
@@ -296,7 +296,7 @@ bitset_print (FILE *file, bitset bset, bool verbose)
|
||||
|
||||
if (verbose)
|
||||
fprintf (file, "n_bits = %lu, set = {",
|
||||
(unsigned long) bitset_size (bset));
|
||||
(unsigned long int) bitset_size (bset));
|
||||
|
||||
pos = 30;
|
||||
BITSET_FOR_EACH (iter, bset, i, 0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Bitset statistics.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
@@ -160,8 +160,8 @@ bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
|
||||
for (; i < n_bins; i++)
|
||||
fprintf (file, "%*lu-%lu\t%8u (%5.1f%%)\n",
|
||||
max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1),
|
||||
(unsigned long) 1 << (i - 1),
|
||||
((unsigned long) 1 << i) - 1,
|
||||
1UL << (i - 1),
|
||||
(1UL << i) - 1,
|
||||
bins[i],
|
||||
(100.0 * bins[i]) / total);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison.
|
||||
|
||||
@@ -57,7 +57,7 @@ bitsetv_matrix_dump (FILE * out, const char *title, bitsetv bset)
|
||||
/* Contents. */
|
||||
for (i = 0; bset[i]; ++i)
|
||||
{
|
||||
fprintf (out, "%2lu|", (unsigned long) i);
|
||||
fprintf (out, "%2lu|", (unsigned long int) i);
|
||||
for (j = 0; j < hsize; ++j)
|
||||
fputs (bitset_test (bset[i], j) ? "1" : " ", out);
|
||||
fputs ("|\n", out);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Bitset vectors.
|
||||
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@@ -149,7 +149,7 @@ bitsetv_dump (FILE *file, char const *title, char const *subtitle,
|
||||
fprintf (file, "%s\n", title);
|
||||
for (i = 0; bsetv[i]; i++)
|
||||
{
|
||||
fprintf (file, "%s %lu\n", subtitle, (unsigned long) i);
|
||||
fprintf (file, "%s %lu\n", subtitle, (unsigned long int) i);
|
||||
bitset_dump (file, bsetv[i]);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ debug_bitsetv (bitsetv bsetv)
|
||||
|
||||
for (i = 0; bsetv[i]; i++)
|
||||
{
|
||||
fprintf (stderr, "%lu: ", (unsigned long) i);
|
||||
fprintf (stderr, "%lu: ", (unsigned long int) i);
|
||||
debug_bitset (bsetv[i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Functions to support expandable bitsets.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
/* Number of bits stored in each element. */
|
||||
#define EBITSET_ELT_BITS \
|
||||
((unsigned) (EBITSET_ELT_WORDS * BITSET_WORD_BITS))
|
||||
((unsigned int) (EBITSET_ELT_WORDS * BITSET_WORD_BITS))
|
||||
|
||||
/* Ebitset element. We use an array of bits. */
|
||||
typedef struct ebitset_elt_struct
|
||||
@@ -216,7 +216,7 @@ ebitset_elt_alloc (void)
|
||||
|
||||
obstack_specify_allocation (&ebitset_obstack, OBSTACK_CHUNK_SIZE,
|
||||
__alignof__ (ebitset_elt),
|
||||
(void *(*)PARAMS ((long)))
|
||||
(void *(*)PARAMS ((long int)))
|
||||
OBSTACK_CHUNK_ALLOC,
|
||||
(void (*)PARAMS ((void *)))
|
||||
OBSTACK_CHUNK_FREE);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Functions to support link list bitsets.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003, 2004 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
|
||||
@@ -54,7 +54,7 @@ typedef bitset_word lbitset_word;
|
||||
|
||||
/* Number of bits stored in each element. */
|
||||
#define LBITSET_ELT_BITS \
|
||||
((unsigned) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS))
|
||||
((unsigned int) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS))
|
||||
|
||||
/* Lbitset element. We use an array of bits for each element.
|
||||
These are linked together in a doubly-linked list. */
|
||||
@@ -127,7 +127,7 @@ lbitset_elt_alloc (void)
|
||||
|
||||
obstack_specify_allocation (&lbitset_obstack, OBSTACK_CHUNK_SIZE,
|
||||
__alignof__ (lbitset_elt),
|
||||
(void *(*)PARAMS ((long)))
|
||||
(void *(*)PARAMS ((long int)))
|
||||
OBSTACK_CHUNK_ALLOC,
|
||||
(void (*)PARAMS ((void *)))
|
||||
OBSTACK_CHUNK_FREE);
|
||||
@@ -1390,7 +1390,7 @@ debug_lbitset (bitset bset)
|
||||
|
||||
for (elt = LBITSET_HEAD (bset); elt; elt = elt->next)
|
||||
{
|
||||
fprintf (stderr, "Elt %lu\n", (unsigned long) elt->index);
|
||||
fprintf (stderr, "Elt %lu\n", (unsigned long int) elt->index);
|
||||
for (i = 0; i < LBITSET_ELT_WORDS; i++)
|
||||
{
|
||||
unsigned int j;
|
||||
|
||||
Reference in New Issue
Block a user