diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-30 09:26:42 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-30 10:01:22 +0300 |
commit | a8ec7845e0bdb9e63e9d3dbd7f4cd7caad36b5a2 (patch) | |
tree | 4531232281ddc4cda4df3fb1ccc0822018fe5682 /source/blender/blenlib/BLI_bitmap.h | |
parent | af3aaf80344e745e6c207102941513cb631194c3 (diff) |
Cleanup: use "num" as a suffix in: source/blender/blenlib
Also replace "num" with:
- "number" when it's not used to denote the number of items.
- "digits" when digits in a string are being manipulated.
Diffstat (limited to 'source/blender/blenlib/BLI_bitmap.h')
-rw-r--r-- | source/blender/blenlib/BLI_bitmap.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h index 38c44193ab3..ca11cd6574e 100644 --- a/source/blender/blenlib/BLI_bitmap.h +++ b/source/blender/blenlib/BLI_bitmap.h @@ -25,33 +25,33 @@ typedef unsigned int BLI_bitmap; #define _BITMAP_MASK 31 /** - * Number of blocks needed to hold '_tot' bits. + * Number of blocks needed to hold '_num' bits. */ -#define _BITMAP_NUM_BLOCKS(_tot) (((_tot) >> _BITMAP_POWER) + 1) +#define _BITMAP_NUM_BLOCKS(_num) (((_num) >> _BITMAP_POWER) + 1) /** - * Size (in bytes) used to hold '_tot' bits. + * Size (in bytes) used to hold '_num' bits. */ -#define BLI_BITMAP_SIZE(_tot) ((size_t)(_BITMAP_NUM_BLOCKS(_tot)) * sizeof(BLI_bitmap)) +#define BLI_BITMAP_SIZE(_num) ((size_t)(_BITMAP_NUM_BLOCKS(_num)) * sizeof(BLI_bitmap)) /** - * Allocate memory for a bitmap with '_tot' bits; free with MEM_freeN(). + * Allocate memory for a bitmap with '_num' bits; free with MEM_freeN(). */ -#define BLI_BITMAP_NEW(_tot, _alloc_string) \ - ((BLI_bitmap *)MEM_callocN(BLI_BITMAP_SIZE(_tot), _alloc_string)) +#define BLI_BITMAP_NEW(_num, _alloc_string) \ + ((BLI_bitmap *)MEM_callocN(BLI_BITMAP_SIZE(_num), _alloc_string)) /** * Allocate a bitmap on the stack. */ -#define BLI_BITMAP_NEW_ALLOCA(_tot) \ - ((BLI_bitmap *)memset(alloca(BLI_BITMAP_SIZE(_tot)), 0, BLI_BITMAP_SIZE(_tot))) +#define BLI_BITMAP_NEW_ALLOCA(_num) \ + ((BLI_bitmap *)memset(alloca(BLI_BITMAP_SIZE(_num)), 0, BLI_BITMAP_SIZE(_num))) /** * Allocate using given MemArena. */ -#define BLI_BITMAP_NEW_MEMARENA(_mem, _tot) \ +#define BLI_BITMAP_NEW_MEMARENA(_mem, _num) \ (CHECK_TYPE_INLINE(_mem, MemArena *), \ - ((BLI_bitmap *)BLI_memarena_calloc(_mem, BLI_BITMAP_SIZE(_tot)))) + ((BLI_bitmap *)BLI_memarena_calloc(_mem, BLI_BITMAP_SIZE(_num)))) /** * Get the value of a single bit at '_index'. @@ -107,12 +107,12 @@ typedef unsigned int BLI_bitmap; (void)0 /** - * Resize bitmap to have space for '_tot' bits. + * Resize bitmap to have space for '_num' bits. */ -#define BLI_BITMAP_RESIZE(_bitmap, _tot) \ +#define BLI_BITMAP_RESIZE(_bitmap, _num) \ { \ CHECK_TYPE(_bitmap, BLI_bitmap *); \ - (_bitmap) = MEM_recallocN(_bitmap, BLI_BITMAP_SIZE(_tot)); \ + (_bitmap) = MEM_recallocN(_bitmap, BLI_BITMAP_SIZE(_num)); \ } \ (void)0 |