Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
81a13dd1
Commit
81a13dd1
authored
Jun 06, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch for bugs in bitmap (endian issue)
parent
db5c15f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
6 deletions
+41
-6
include/my_bitmap.h
include/my_bitmap.h
+41
-6
No files found.
include/my_bitmap.h
View file @
81a13dd1
...
@@ -84,15 +84,50 @@ extern void bitmap_lock_invert(MY_BITMAP *map);
...
@@ -84,15 +84,50 @@ extern void bitmap_lock_invert(MY_BITMAP *map);
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
#define no_words_in_map(map) (((map)->n_bits + 31)/32)
#define no_words_in_map(map) (((map)->n_bits + 31)/32)
#define bytes_word_aligned(bytes) (4*((bytes + 3)/4))
#define bytes_word_aligned(bytes) (4*((bytes + 3)/4))
#define bitmap_set_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] |= (1 << ((BIT) & 31)))
#define _bitmap_set_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
#define bitmap_flip_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] ^= (1 << ((BIT) & 31)))
|= (1 << ((BIT) & 7)))
#define bitmap_clear_bit(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] &= ~ (1 << ((BIT) & 31)))
#define _bitmap_flip_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
#define bitmap_is_set(MAP, BIT) ((MAP)->bitmap[(BIT) / 32] & (1 << ((BIT) & 31)))
^= (1 << ((BIT) & 7)))
#define _bitmap_clear_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
&= ~ (1 << ((BIT) & 7)))
#define _bitmap_is_set(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
& (1 << ((BIT) & 7)))
#ifndef DBUG_OFF
inline
uint32
bitmap_set_bit
(
MY_BITMAP
*
map
,
uint
bit
)
{
DBUG_ASSERT
(
bit
<
(
map
)
->
n_bits
);
return
_bitmap_set_bit
(
map
,
bit
);
}
inline
uint32
bitmap_flip_bit
(
MY_BITMAP
*
map
,
uint
bit
)
{
DBUG_ASSERT
(
bit
<
(
map
)
->
n_bits
);
return
_bitmap_flip_bit
(
map
,
bit
);
}
inline
uint32
bitmap_clear_bit
(
MY_BITMAP
*
map
,
uint
bit
)
{
DBUG_ASSERT
(
bit
<
(
map
)
->
n_bits
);
return
_bitmap_clear_bit
(
map
,
bit
);
}
inline
uint32
bitmap_is_set
(
const
MY_BITMAP
*
map
,
uint
bit
)
{
DBUG_ASSERT
(
bit
<
(
map
)
->
n_bits
);
return
_bitmap_is_set
(
map
,
bit
);
}
#else
#define bitmap_set_bit(MAP, BIT) _bitmap_set_bit(MAP, BIT)
#define bitmap_flip_bit(MAP, BIT) _bitmap_flip_bit(MAP, BIT)
#define bitmap_clear_bit(MAP, BIT) _bitmap_clear_bit(MAP, BIT)
#define bitmap_is_set(MAP, BIT) _bitmap_is_set(MAP, BIT)
#endif
#define bitmap_cmp(MAP1, MAP2) \
#define bitmap_cmp(MAP1, MAP2) \
(memcmp((MAP1)->bitmap, (MAP2)->bitmap, 4*no_words_in_map((MAP1)))==0)
(memcmp((MAP1)->bitmap, (MAP2)->bitmap, 4*no_words_in_map((MAP1)))==0)
#define bitmap_clear_all(MAP) \
#define bitmap_clear_all(MAP) \
memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); \
{
memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); \
*(MAP)->last_word_ptr|= (MAP)->last_word_mask
*(MAP)->last_word_ptr|= (MAP)->last_word_mask
; }
#define bitmap_set_all(MAP) \
#define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment