OSDN Git Service
(root)
/
android-x86
/
external-exfat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b0e1b8f
)
Use bool type in fetch_next_entry().
author
relan
<relan@users.noreply.github.com>
Tue, 8 Jul 2014 12:27:54 +0000
(12:27 +0000)
committer
relan
<relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:17 +0000
(08:26 +0300)
libexfat/node.c
patch
|
blob
|
history
diff --git
a/libexfat/node.c
b/libexfat/node.c
index
8dd946f
..
96c312a
100644
(file)
--- a/
libexfat/node.c
+++ b/
libexfat/node.c
@@
-124,7
+124,7
@@
static void closedir(struct iterator* it)
it->chunk = NULL;
}
it->chunk = NULL;
}
-static
int
fetch_next_entry(struct exfat* ef, const struct exfat_node* parent,
+static
bool
fetch_next_entry(struct exfat* ef, const struct exfat_node* parent,
struct iterator* it)
{
/* move iterator to the next entry in the directory */
struct iterator* it)
{
/* move iterator to the next entry in the directory */
@@
-135,23
+135,23
@@
static int fetch_next_entry(struct exfat* ef, const struct exfat_node* parent,
/* reached the end of directory; the caller should check this
condition too */
if (it->offset >= parent->size)
/* reached the end of directory; the caller should check this
condition too */
if (it->offset >= parent->size)
- return
0
;
+ return
true
;
it->cluster = exfat_next_cluster(ef, parent, it->cluster);
if (CLUSTER_INVALID(it->cluster))
{
exfat_error("invalid cluster 0x%x while reading directory",
it->cluster);
it->cluster = exfat_next_cluster(ef, parent, it->cluster);
if (CLUSTER_INVALID(it->cluster))
{
exfat_error("invalid cluster 0x%x while reading directory",
it->cluster);
- return
1
;
+ return
false
;
}
if (exfat_pread(ef->dev, it->chunk, CLUSTER_SIZE(*ef->sb),
exfat_c2o(ef, it->cluster)) < 0)
{
exfat_error("failed to read the next directory cluster %#x",
it->cluster);
}
if (exfat_pread(ef->dev, it->chunk, CLUSTER_SIZE(*ef->sb),
exfat_c2o(ef, it->cluster)) < 0)
{
exfat_error("failed to read the next directory cluster %#x",
it->cluster);
- return
1
;
+ return
false
;
}
}
}
}
- return
0
;
+ return
true
;
}
static struct exfat_node* allocate_node(void)
}
static struct exfat_node* allocate_node(void)
@@
-355,7
+355,7
@@
static int readdir(struct exfat* ef, const struct exfat_node* parent,
if (!check_node(*node, actual_checksum, reference_checksum,
valid_size))
goto error;
if (!check_node(*node, actual_checksum, reference_checksum,
valid_size))
goto error;
- if (
fetch_next_entry(ef, parent, it) != 0
)
+ if (
!fetch_next_entry(ef, parent, it)
)
goto error;
return 0; /* entry completed */
}
goto error;
return 0; /* entry completed */
}
@@
-462,7
+462,7
@@
static int readdir(struct exfat* ef, const struct exfat_node* parent,
break;
}
break;
}
- if (
fetch_next_entry(ef, parent, it) != 0
)
+ if (
!fetch_next_entry(ef, parent, it)
)
goto error;
}
/* we never reach here */
goto error;
}
/* we never reach here */
@@
-832,7
+832,7
@@
static int find_slot(struct exfat* ef, struct exfat_node* dir,
return rc;
}
}
return rc;
}
}
- if (
fetch_next_entry(ef, dir, &it) != 0
)
+ if (
!fetch_next_entry(ef, dir, &it)
)
{
closedir(&it);
return -EIO;
{
closedir(&it);
return -EIO;
@@
-1192,7
+1192,7
@@
static int find_label(struct exfat* ef, cluster_t* cluster, off_t* offset)
return 0;
}
return 0;
}
- if (
fetch_next_entry(ef, ef->root, &it) != 0
)
+ if (
!fetch_next_entry(ef, ef->root, &it)
)
{
closedir(&it);
return -EIO;
{
closedir(&it);
return -EIO;