-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refactor Filesystem Code for Clarity #2766
Conversation
67f9ccc
to
e33a48d
Compare
d6c7262
to
8b4de45
Compare
Thanks for looking into improving the codebase! As a maintainer, I find this PR to be concerning. Every code change is risky to some degree (even innocent-seeming changes are occasionally risky, up to and including ABI breaks), and also costs time to review. With a brief glance at the changes, I can see that there's some good stuff here (e.g. I particularly like the use of the
|
d65967f
to
56d6012
Compare
69241b0
to
6734d90
Compare
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.
Thanks, this looks good! I found no correctness issues and only minor stylistic issues, so I'll go ahead and push changes for them.
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 general, I like this; however, comparing BOOL
against 0
is not good imo, and so I'm requesting that be changed.
Isn't that the convention? |
Co-authored-by: nicole mazzuca <[email protected]>
The STL maintainers talked about For ordinary integers, the convention is unchanged - always explicitly compare. I'll validate and push changes, and also resolve the merge conflict here. |
This also reverses the `DeviceIoControl()` test to become if-success.
@strega-nil-ms I pushed a merge with @AtariDreams Thanks for your patience - we should be able to merge this soon. The last thing is that we have to avoid significant changes to |
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.
Thanks, approved!
@@ -601,7 +596,7 @@ _Success_(return == __std_win_error::_Success) __std_win_error | |||
return {false, __std_win_error{GetLastError()}}; | |||
} | |||
// check if FILE_ATTRIBUTE_READONLY is set | |||
if (_Basic_info.FileAttributes & FILE_ATTRIBUTE_READONLY) { | |||
if ((_Basic_info.FileAttributes & FILE_ATTRIBUTE_READONLY) != 0u) { |
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.
I'm still curious why this is using 0u
instead of just 0
; no changes requested.
This is now Ready To Merge, but I'm marking it as Blocked until changes start flowing into VS 2022 17.4 Preview 2 in a couple of weeks. |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for finding and improving this filesystem code! 📂 ✅ 😸 |
Co-authored-by: Stephan T. Lavavej <[email protected]> Co-authored-by: nicole mazzuca <[email protected]>
This makes the code more readable as well as lowers operations to code paths that actually need them