From 5deecdf636ed293459b96db54c68c63ea99abadf Mon Sep 17 00:00:00 2001 From: resver Date: Sat, 8 Dec 2012 11:51:34 +0000 Subject: [PATCH] Use bool type. git-svn-id: http://exfat.googlecode.com/svn/trunk@302 60bc1c72-a15a-11de-b98f-4500b42dc123 --- libexfat/exfat.h | 3 ++- libexfat/lookup.c | 8 ++++---- libexfat/mount.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libexfat/exfat.h b/libexfat/exfat.h index 119798d..223b55d 100644 --- a/libexfat/exfat.h +++ b/libexfat/exfat.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include "exfatfs.h" @@ -104,7 +105,7 @@ struct exfat uid_t uid; gid_t gid; int ro; - int noatime; + bool noatime; }; /* in-core nodes iterator */ diff --git a/libexfat/lookup.c b/libexfat/lookup.c index d650976..8c889b2 100644 --- a/libexfat/lookup.c +++ b/libexfat/lookup.c @@ -145,14 +145,14 @@ int exfat_lookup(struct exfat* ef, struct exfat_node** node, 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; } -static int is_allowed(const char* comp, size_t length) +static bool is_allowed(const char* comp, size_t length) { size_t i; @@ -169,9 +169,9 @@ static int is_allowed(const char* comp, size_t length) case '<': case '>': case '|': - return 0; + return false; } - return 1; + return true; } int exfat_split(struct exfat* ef, struct exfat_node** parent, diff --git a/libexfat/mount.c b/libexfat/mount.c index 925ec85..afdcb54 100644 --- a/libexfat/mount.c +++ b/libexfat/mount.c @@ -61,7 +61,7 @@ static int get_int_option(const char* options, const char* option_name, 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); @@ -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')) - return 1; - return 0; + return true; + return false; } static void parse_options(struct exfat* ef, const char* options) -- 2.11.0