OSDN Git Service

Use bool type.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Wed, 12 Dec 2012 19:16:42 +0000 (19:16 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Wed, 12 Dec 2012 19:16:42 +0000 (19:16 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@308 60bc1c72-a15a-11de-b98f-4500b42dc123

dump/main.c
libexfat/cluster.c
libexfat/exfat.h

index 07c8b05..d7ea2a3 100644 (file)
@@ -112,7 +112,7 @@ static void dump_sectors(struct exfat* ef)
        puts("");
 }
 
-static int dump_full(const char* spec, int used_sectors)
+static int dump_full(const char* spec, bool used_sectors)
 {
        struct exfat ef;
        uint32_t free_clusters;
@@ -148,8 +148,8 @@ int main(int argc, char* argv[])
 {
        char** pp;
        const char* spec = NULL;
-       int sb_only = 0;
-       int used_sectors = 0;
+       bool sb_only = false;
+       bool used_sectors = false;
 
        printf("dumpexfat %u.%u.%u\n",
                        EXFAT_VERSION_MAJOR, EXFAT_VERSION_MINOR, EXFAT_VERSION_PATCH);
@@ -157,9 +157,9 @@ int main(int argc, char* argv[])
        for (pp = argv + 1; *pp; pp++)
        {
                if (strcmp(*pp, "-s") == 0)
-                       sb_only = 1;
+                       sb_only = true;
                else if (strcmp(*pp, "-u") == 0)
-                       used_sectors = 1;
+                       used_sectors = true;
                else if (strcmp(*pp, "-v") == 0)
                {
                        puts("Copyright (C) 2011, 2012  Andrew Nayenko");
index 4928ef5..e123eaa 100644 (file)
@@ -148,7 +148,7 @@ void exfat_flush_cmap(struct exfat* ef)
 {
        exfat_pwrite(ef->dev, ef->cmap.chunk, (ef->cmap.chunk_size + 7) / 8,
                        exfat_c2o(ef, ef->cmap.start_cluster));
-       ef->cmap.dirty = 0;
+       ef->cmap.dirty = false;
 }
 
 static void set_next_cluster(const struct exfat* ef, int contiguous,
@@ -182,7 +182,7 @@ static cluster_t allocate_cluster(struct exfat* ef, cluster_t hint)
                return EXFAT_CLUSTER_END;
        }
 
-       ef->cmap.dirty = 1;
+       ef->cmap.dirty = true;
        return cluster;
 }
 
@@ -195,7 +195,7 @@ static void free_cluster(struct exfat* ef, cluster_t cluster)
                                ef->cmap.size);
 
        BMAP_CLR(ef->cmap.chunk, cluster - EXFAT_FIRST_DATA_CLUSTER);
-       ef->cmap.dirty = 1;
+       ef->cmap.dirty = true;
 }
 
 static void make_noncontiguous(const struct exfat* ef, cluster_t first,
index 7eb1fa6..d9f5cae 100644 (file)
@@ -95,7 +95,7 @@ struct exfat
                uint32_t size;                          /* in bits */
                uint8_t* chunk;
                uint32_t chunk_size;            /* in bits */
-               int dirty;
+               bool dirty;
        }
        cmap;
        char label[EXFAT_ENAME_MAX * 6 + 1]; /* a character can occupy up to