-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iQue] Match some fs files #72
Conversation
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some small suggestions but I'll merge this anyway in a little while unless you want to make any further changes / discuss anything
src/bb/fs/fsclose.c
Outdated
BbFat16* fat; | ||
s32 rv; | ||
|
||
if ((u32)fd >= BB_INODE16_NUM) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((u32)fd >= BB_INODE16_NUM) { | |
if (fd < 0 || fd >= BB_INODE16_NUM) { |
This has matched elsewhere and is a bit more natural
src/bb/fs/fsdelete.c
Outdated
} | ||
|
||
bzero(&fat->inode[i], sizeof(fat->inode[i])); | ||
rv = __osBbFsSync(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rv = __osBbFsSync(0); | |
rv = __osBbFsSync(FALSE); |
src/bb/fs/fsdir.c
Outdated
} | ||
|
||
rv++; | ||
if ((d != NULL) && (j < count)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((d != NULL) && (j < count)) { | |
if (d != NULL && j < count) { |
imo parens should only be used where necessary or when operator precedence is unclear. Here it is clear that comparisons come before logical operators.
src/bb/fs/fsstat.c
Outdated
u16 b = in->block; | ||
i = 0; | ||
|
||
for (i = 0; b != 0xFFFF && i < listLen; i++) { | ||
blockList[i] = b; | ||
b = fat[b >> 0xC].entry[(b & 0xFFF)]; | ||
b = fat[b / 0x1000].entry[b % 0x1000]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In one of the fs files I worked on I was unable to get it to match with div and mod. I think we should use shift and mask and probably macro this whole expression, e.g. b = BBFS_NEXT_BLOCK(fat, b)
, since it comes up so often
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Matches
fsclose.c
,fsdelete.c
,fsdir.c
,fsread.c
,fsrename.c
andfswrite.c