Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int lfs_bd_erase(lfs_t *lfs, lfs_block_t block) {

// some operations on paths
static inline lfs_size_t lfs_path_namelen(const char *path) {
return strcspn(path, "/");
return (lfs_size_t)strcspn(path, "/");
}

static inline bool lfs_path_islast(const char *path) {
Expand Down Expand Up @@ -1501,7 +1501,7 @@ static lfs_stag_t lfs_dir_find(lfs_t *lfs, lfs_mdir_t *dir,
if (lfs_tag_type3(tag) == LFS_TYPE_DIR) {
name += strspn(name, "/");
}
lfs_size_t namelen = strcspn(name, "/");
lfs_size_t namelen = (lfs_size_t)strcspn(name, "/");

// skip '.'
if (namelen == 1 && memcmp(name, ".", 1) == 0) {
Expand All @@ -1520,7 +1520,7 @@ static lfs_stag_t lfs_dir_find(lfs_t *lfs, lfs_mdir_t *dir,
int depth = 1;
while (true) {
suffix += strspn(suffix, "/");
sufflen = strcspn(suffix, "/");
sufflen = (lfs_size_t)strcspn(suffix, "/");
if (sufflen == 0) {
break;
}
Expand Down Expand Up @@ -1761,7 +1761,7 @@ static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) {

commit->off = noff;
// perturb valid bit?
commit->ptag = ntag ^ ((0x80UL & ~eperturb) << 24);
commit->ptag = (lfs_tag_t)(ntag ^ ((0x80UL & ~eperturb) << 24));
// reset crc for next commit
commit->crc = 0xffffffff;

Expand Down