~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_bitmap.cc

  • Committer: Monty Taylor
  • Date: 2009-05-08 19:07:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1009.
  • Revision ID: mordred@inaugust.com-20090508190739-rwas5y9xjg1a92p6
Reverted a crap-ton of padraig's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 * bitsets and methods for thread-safe bitsets.
30
30
 */
31
31
 
32
 
#include <drizzled/sql_bitmap.h>
 
32
#include "drizzled/sql_bitmap.h"
33
33
 
34
34
#include <bitset>
35
35
 
38
38
uint32_t setNextBit(bitset<MAX_FIELDS> &bitmap)
39
39
{
40
40
  uint32_t bit_found;
41
 
  if ((bit_found= getFirstBitPos(bitmap)) != BIT_NONE)
 
41
  if ((bit_found= getFirstBitPos(bitmap)) != MY_BIT_NONE)
42
42
    bitmap.set(bit_found);
43
43
  return bit_found;
44
44
}
45
45
 
46
46
uint32_t getFirstBitPos(const bitset<MAX_FIELDS> &bitmap)
47
47
{
48
 
  uint32_t first_bit= BIT_NONE;
 
48
  uint32_t first_bit= MY_BIT_NONE;
49
49
  for (int idx= 0; idx < MAX_FIELDS; idx++)
50
50
  {
51
51
    if (!bitmap.test(idx))
57
57
  return first_bit;
58
58
}
59
59
 
60
 
bool isBitmapOverlapping(const bitset<MAX_FIELDS> &map1, const bitset<MAX_FIELDS> &map2)
 
60
bool isBitmapOverlapping(const bitset<MAX_FIELDS> *map1, const bitset<MAX_FIELDS> *map2)
61
61
{
62
 
  bitset<MAX_FIELDS> tmp= map1 & map2;
 
62
  bitset<MAX_FIELDS> tmp= *map1 & *map2;
63
63
  return (tmp.any());
64
64
}