Dropped LFSR_TYPE_UNKNOWN

Returning the actual on-disk file type is probably more useful for users
as this gives them more information.

I was originally concerned about collisions with future internal types,
LFS_TYPE_TRAVERSAL, etc, needed for internal opened-list tracking, but
it turns out we can avoid problems by starting internal types at 0x80,
since on-disk file types are only 7-bits.

Code changes:

           code          stack
  before: 33710           2592
  after:  33694 (-0.0%)   2592 (+0.0%)
This commit is contained in:
Christopher Haster
2024-06-09 13:55:50 -05:00
parent 7fad472af5
commit 9886ebf51e
3 changed files with 4 additions and 9 deletions
-1
View File
@@ -114,7 +114,6 @@ enum lfs_error {
// File types
enum lfs_type {
// file types
LFS_TYPE_UNKNOWN = 0,
LFS_TYPE_REG = 1,
LFS_TYPE_DIR = 2,