diff options
| author | Benjamin Kosnik <bkoz@redhat.com> | 2002-04-09 07:35:31 +0000 |
|---|---|---|
| committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2002-04-09 07:35:31 +0000 |
| commit | 1cb7f91f86f8393e3a7ee4e83fa489469cbb9788 (patch) | |
| tree | e31871986f6d2c806ff937ca58c503168d08d9d4 /libstdc++-v3/src | |
| parent | e70ed0d9a562f1c8f99e1a768938c0e36ae4e3c8 (diff) | |
| download | gcc-1cb7f91f86f8393e3a7ee4e83fa489469cbb9788.tar.gz gcc-1cb7f91f86f8393e3a7ee4e83fa489469cbb9788.tar.bz2 gcc-1cb7f91f86f8393e3a7ee4e83fa489469cbb9788.zip | |
bitset_members.cc: New test.
2002-04-09 Benjamin Kosnik <bkoz@redhat.com>
libstdc++/6124
* testsuite/23_containers/bitset_members.cc: New test.
* include/std/std_bitset.h (_Bit_count::_S_bit_count): Move..
(_S_bit_count): Here.
(_First_one::_S_first_one): Move...
(_S_first_one): Here.
Format.
* src/bitset.cc: Adjust.
* config/linker-map.gnu: Export.
From-SVN: r52066
Diffstat (limited to 'libstdc++-v3/src')
| -rw-r--r-- | libstdc++-v3/src/bitset.cc | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/libstdc++-v3/src/bitset.cc b/libstdc++-v3/src/bitset.cc index c0bec5d5b34..244f308924f 100644 --- a/libstdc++-v3/src/bitset.cc +++ b/libstdc++-v3/src/bitset.cc @@ -1,6 +1,6 @@ // Bitset definitions -*- C++ -*- -// Copyright (C) 2001 Free Software Foundation +// Copyright (C) 2001, 2002 Free Software Foundation // // This file is part of GNU CC. // @@ -59,7 +59,7 @@ std::_Base_bitset<1>::_M_do_find_first(std::size_t __not_found) const unsigned char __this_byte = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); if ( __this_byte ) - return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte]; + return __j * CHAR_BIT + _S_first_one[__this_byte]; __thisword >>= CHAR_BIT; } @@ -93,7 +93,7 @@ std::_Base_bitset<1>::_M_do_find_next(std::size_t __prev, unsigned char __this_byte = static_cast<unsigned char>(__thisword & (~(unsigned char)0)); if ( __this_byte ) - return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte]; + return __j * CHAR_BIT + _S_first_one[__this_byte]; __thisword >>= CHAR_BIT; } @@ -103,11 +103,10 @@ std::_Base_bitset<1>::_M_do_find_next(std::size_t __prev, return __not_found; } // end _M_do_find_next -// ------------------------------------------------------------ -// Lookup tables for find and count operations. -template<bool __dummy> -unsigned char std::_Bit_count<__dummy>::_S_bit_count[] = { +// Lookup tables for find and count operations. +unsigned char std::_S_bit_count[256] = +{ 0, /* 0 */ 1, /* 1 */ 1, /* 2 */ 2, /* 3 */ 1, /* 4 */ 2, /* 5 */ 2, /* 6 */ 3, /* 7 */ 1, /* 8 */ 2, /* 9 */ 2, /* 10 */ 3, /* 11 */ 2, /* 12 */ 3, /* 13 */ 3, /* 14 */ @@ -160,10 +159,10 @@ unsigned char std::_Bit_count<__dummy>::_S_bit_count[] = { 6, /* 245 */ 6, /* 246 */ 7, /* 247 */ 5, /* 248 */ 6, /* 249 */ 6, /* 250 */ 7, /* 251 */ 6, /* 252 */ 7, /* 253 */ 7, /* 254 */ 8 /* 255 */ -}; // end _Bit_count +}; // end _S_bit_count -template<bool __dummy> -unsigned char std::_First_one<__dummy>::_S_first_one[] = { +unsigned char std::_S_first_one[256] = +{ 0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 0, /* 3 */ 2, /* 4 */ 0, /* 5 */ 1, /* 6 */ 0, /* 7 */ 3, /* 8 */ 0, /* 9 */ 1, /* 10 */ 0, /* 11 */ 2, /* 12 */ 0, /* 13 */ 1, /* 14 */ @@ -216,12 +215,5 @@ unsigned char std::_First_one<__dummy>::_S_first_one[] = { 0, /* 245 */ 1, /* 246 */ 0, /* 247 */ 3, /* 248 */ 0, /* 249 */ 1, /* 250 */ 0, /* 251 */ 2, /* 252 */ 0, /* 253 */ 1, /* 254 */ 0, /* 255 */ -}; // end _First_one - -// Explicitly instantiate them. - -template unsigned char std::_Bit_count<false>::_S_bit_count[]; -template unsigned char std::_Bit_count<true>::_S_bit_count[]; +}; // end _S_first_one -template unsigned char std::_First_one<false>::_S_first_one[]; -template unsigned char std::_First_one<true>::_S_first_one[]; |
