X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/7fe11bb55c1ca7e08f392b8bf413d18062019dd3..72cd9a913f6d282c5e24990505c2c820bda2bf1b:/src/Sbitset.c diff --git a/src/Sbitset.c b/src/Sbitset.c index 0c1fedfc..ce65f37f 100644 --- a/src/Sbitset.c +++ b/src/Sbitset.c @@ -1,6 +1,6 @@ /* A simple, memory-efficient bitset implementation. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2012 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -33,9 +33,9 @@ Sbitset__new (Sbitset__Index nbits) Sbitset Sbitset__new_on_obstack (Sbitset__Index nbits, struct obstack *obstackp) { - char *result; - char *ptr; - char *end; + Sbitset result; + Sbitset ptr; + Sbitset end; aver (nbits); result = obstack_alloc (obstackp, Sbitset__nbytes (nbits)); for (ptr = result, end = result + Sbitset__nbytes (nbits); ptr < end; ++ptr) @@ -52,7 +52,7 @@ Sbitset__delete (Sbitset self) bool Sbitset__isEmpty (Sbitset self, Sbitset__Index nbits) { - char *last = self + Sbitset__nbytes (nbits) - 1; + Sbitset last = self + Sbitset__nbytes (nbits) - 1; for (; self < last; ++self) if (*self != 0) return false; @@ -65,14 +65,16 @@ Sbitset__fprint(Sbitset self, Sbitset__Index nbits, FILE *file) Sbitset__Index i; Sbitset itr; bool first = true; - fprintf (file, "nbits = %d, set = {", nbits); + fprintf (file, + "nbits = %" SBITSET__INDEX__CONVERSION_SPEC ", set = {", + nbits); SBITSET__FOR_EACH (self, nbits, itr, i) { if (first) first = false; else fprintf (file, ","); - fprintf (file, " %d", i); + fprintf (file, " %" SBITSET__INDEX__CONVERSION_SPEC, i); } fprintf (file, " }"); }