OSDN Git Service

Move bitmap macros to header to be used by other units.
authorrelan <relan@users.noreply.github.com>
Tue, 9 Nov 2010 15:16:29 +0000 (15:16 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:12 +0000 (08:26 +0300)
fsck/main.c
libexfat/cluster.c
libexfat/exfat.h

index 27ced56..fb69df1 100644 (file)
@@ -28,8 +28,6 @@
 
 #define MB (1024 * 1024)
 
-#define BMAP_GET(bitmap, index) ((bitmap)[(index) / 8] & (1u << ((index) % 8)))
-
 uint64_t files_count, directories_count;
 
 static uint64_t bytes2mb(uint64_t bytes)
index 0f2d76a..3618ce5 100644 (file)
 #include <errno.h>
 #include <string.h>
 
-#define BMAP_GET(bitmap, index) ((bitmap)[(index) / 8] & (1u << ((index) % 8)))
-#define BMAP_SET(bitmap, index) (bitmap)[(index) / 8] |= (1u << ((index) % 8))
-#define BMAP_CLR(bitmap, index) (bitmap)[(index) / 8] &= ~(1u << ((index) % 8))
-
 /*
  * Block to absolute offset.
  */
index 0f9d3e4..a5614b2 100644 (file)
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 #define DIV_ROUND_UP(x, d) (((x) + (d) - 1) / (d))
 
+#define BMAP_GET(bitmap, index) \
+       (((uint8_t*) bitmap)[(index) / 8] & (1u << ((index) % 8)))
+#define BMAP_SET(bitmap, index) \
+       ((uint8_t*) bitmap)[(index) / 8] |= (1u << ((index) % 8))
+#define BMAP_CLR(bitmap, index) \
+       ((uint8_t*) bitmap)[(index) / 8] &= ~(1u << ((index) % 8))
+
 struct exfat_node
 {
        struct exfat_node* parent;