OSDN Git Service

Use bool type.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Sat, 8 Dec 2012 11:51:34 +0000 (11:51 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Sat, 8 Dec 2012 11:51:34 +0000 (11:51 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@302 60bc1c72-a15a-11de-b98f-4500b42dc123

libexfat/exfat.h
libexfat/lookup.c
libexfat/mount.c

index 119798d..223b55d 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
+#include <stdbool.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include "exfatfs.h"
 #include <sys/stat.h>
 #include <sys/types.h>
 #include "exfatfs.h"
@@ -104,7 +105,7 @@ struct exfat
        uid_t uid;
        gid_t gid;
        int ro;
        uid_t uid;
        gid_t gid;
        int ro;
-       int noatime;
+       bool noatime;
 };
 
 /* in-core nodes iterator */
 };
 
 /* in-core nodes iterator */
index d650976..8c889b2 100644 (file)
@@ -145,14 +145,14 @@ int exfat_lookup(struct exfat* ef, struct exfat_node** node,
        return 0;
 }
 
        return 0;
 }
 
-static int is_last_comp(const char* comp, size_t length)
+static bool is_last_comp(const char* comp, size_t length)
 {
        const char* p = comp + length;
 
        return get_comp(p, &p) == 0;
 }
 
 {
        const char* p = comp + length;
 
        return get_comp(p, &p) == 0;
 }
 
-static int is_allowed(const char* comp, size_t length)
+static bool is_allowed(const char* comp, size_t length)
 {
        size_t i;
 
 {
        size_t i;
 
@@ -169,9 +169,9 @@ static int is_allowed(const char* comp, size_t length)
                case '<':
                case '>':
                case '|':
                case '<':
                case '>':
                case '|':
-                       return 0;
+                       return false;
                }
                }
-       return 1;
+       return true;
 }
 
 int exfat_split(struct exfat* ef, struct exfat_node** parent,
 }
 
 int exfat_split(struct exfat* ef, struct exfat_node** parent,
index 925ec85..afdcb54 100644 (file)
@@ -61,7 +61,7 @@ static int get_int_option(const char* options, const char* option_name,
        return strtol(p, NULL, base);
 }
 
        return strtol(p, NULL, base);
 }
 
-static int match_option(const char* options, const char* option_name)
+static bool match_option(const char* options, const char* option_name)
 {
        const char* p;
        size_t length = strlen(option_name);
 {
        const char* p;
        size_t length = strlen(option_name);
@@ -69,8 +69,8 @@ static int match_option(const char* options, const char* option_name)
        for (p = strstr(options, option_name); p; p = strstr(p + 1, option_name))
                if ((p == options || p[-1] == ',') &&
                                (p[length] == ',' || p[length] == '\0'))
        for (p = strstr(options, option_name); p; p = strstr(p + 1, option_name))
                if ((p == options || p[-1] == ',') &&
                                (p[length] == ',' || p[length] == '\0'))
-                       return 1;
-       return 0;
+                       return true;
+       return false;
 }
 
 static void parse_options(struct exfat* ef, const char* options)
 }
 
 static void parse_options(struct exfat* ef, const char* options)