@@ -1427,6 +1427,7 @@ static int lfs_dir_getinfo(lfs_t *lfs, lfs_mdir_t *dir,
1427
1427
1428
1428
if (lfs_tag_type3 (tag ) == LFS_TYPE_CTZSTRUCT
1429
1429
|| lfs_tag_type3 (tag ) == LFS_TYPE_FLATSTRUCT ) {
1430
+ LFS_ASSERT (lfs_tag_type3 (tag ) != LFS_TYPE_FLATSTRUCT );
1430
1431
info -> size = ctz .size ;
1431
1432
} else if (lfs_tag_type3 (tag ) == LFS_TYPE_INLINESTRUCT ) {
1432
1433
info -> size = lfs_tag_size (tag );
@@ -3133,6 +3134,7 @@ static int lfs_file_rawopencfg(lfs_t *lfs, lfs_file_t *file,
3133
3134
} else if (lfs_tag_type3 (tag ) == LFS_TYPE_FLATSTRUCT ) {
3134
3135
// mark this as a flat file
3135
3136
LFS_ASSERT ((file -> flags & LFS_F_INLINE ) == 0 );
3137
+ LFS_ASSERT (false);
3136
3138
file -> flags |= LFS_F_FLAT ;
3137
3139
}
3138
3140
@@ -3273,6 +3275,7 @@ static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
3273
3275
if (file -> flags & LFS_F_FLAT ) {
3274
3276
// flat file access not yet implemented
3275
3277
LFS_ASSERT ((file -> flags & LFS_F_INLINE ) == 0 );
3278
+ LFS_ASSERT (false);
3276
3279
return LFS_ERR_INVAL ;
3277
3280
}
3278
3281
@@ -3368,6 +3371,7 @@ static int lfs_file_rawsync(lfs_t *lfs, lfs_file_t *file) {
3368
3371
if (file -> flags & LFS_F_FLAT ) {
3369
3372
// update the flat file reference
3370
3373
LFS_ASSERT ((file -> flags & LFS_F_INLINE ) == 0 );
3374
+ LFS_ASSERT (false);
3371
3375
type = LFS_TYPE_FLATSTRUCT ;
3372
3376
ctz = file -> ctz ;
3373
3377
lfs_ctz_tole32 (& ctz );
@@ -3426,6 +3430,7 @@ static lfs_ssize_t lfs_file_flushedread(lfs_t *lfs, lfs_file_t *file,
3426
3430
if (file -> flags & LFS_F_FLAT ) {
3427
3431
// reading flat files is not yet implemented
3428
3432
LFS_ASSERT ((file -> flags & LFS_F_INLINE ) == 0 );
3433
+ LFS_ASSERT (false);
3429
3434
return LFS_ERR_INVAL ;
3430
3435
}
3431
3436
if (!(file -> flags & LFS_F_INLINE )) {
@@ -3657,6 +3662,7 @@ static lfs_soff_t lfs_file_rawseek(lfs_t *lfs, lfs_file_t *file,
3657
3662
if (file -> flags & LFS_F_FLAT ) {
3658
3663
// seeking flat files is not yet implemented
3659
3664
LFS_ASSERT ((file -> flags & LFS_F_INLINE ) == 0 );
3665
+ LFS_ASSERT (false);
3660
3666
return LFS_ERR_INVAL ;
3661
3667
}
3662
3668
@@ -3705,6 +3711,7 @@ static int lfs_file_rawtruncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size) {
3705
3711
3706
3712
if (file -> flags & LFS_F_FLAT ) {
3707
3713
LFS_ASSERT ((file -> flags & LFS_F_INLINE ) == 0 );
3714
+ LFS_ASSERT (false);
3708
3715
if (size == oldsize ) {
3709
3716
// noop
3710
3717
return 0 ;
@@ -4585,6 +4592,7 @@ int lfs_fs_rawtraverse(lfs_t *lfs,
4585
4592
return err ;
4586
4593
}
4587
4594
} else if (lfs_tag_type3 (tag ) == LFS_TYPE_FLATSTRUCT ) {
4595
+ LFS_ASSERT (false);
4588
4596
if (ctz .size ) {
4589
4597
lfs_size_t nblocks = ((ctz .size - 1 ) / lfs -> cfg -> block_size ) + 1 ;
4590
4598
lfs_block_t bend = ctz .head + nblocks ;
@@ -4616,6 +4624,7 @@ int lfs_fs_rawtraverse(lfs_t *lfs,
4616
4624
}
4617
4625
4618
4626
if (f -> flags & LFS_F_FLAT ) {
4627
+ LFS_ASSERT (false);
4619
4628
if (f -> flags & LFS_F_DIRTY ) {
4620
4629
if (f -> ctz .size ) {
4621
4630
lfs_size_t nblocks = ((f -> ctz .size - 1 ) / lfs -> cfg -> block_size ) + 1 ;
0 commit comments