1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 21:19:24 +00:00

Start using bool.

This commit is contained in:
Bruno Haible
2002-11-19 12:55:48 +00:00
parent 4cda19576b
commit 2cd11405ed
15 changed files with 81 additions and 51 deletions

View File

@@ -38,18 +38,19 @@ Bool_Array::Bool_Array (unsigned int size)
_size, (unsigned int) (_size * sizeof (_storage_array[0])));
}
/* Sets the specified bit to one. Returns its previous value (0 or 1). */
INLINE int
/* Sets the specified bit to true.
Returns its previous value (false or true). */
INLINE bool
Bool_Array::set_bit (unsigned int index)
{
if (_storage_array[index] == _iteration_number)
/* The bit was set since the last clear() call. */
return 1;
return true;
else
{
/* The last operation on this bit was clear(). Set it now. */
_storage_array[index] = _iteration_number;
return 0;
return false;
}
}