-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improved comments in enginecontrol and use of std::size_t for bufferSize accross the codebase #13819
Improved comments in enginecontrol and use of std::size_t for bufferSize accross the codebase #13819
Conversation
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.
two quick notes:
- I'm fairly certain
size_t
is the C nomenclature, the proper C++ name/type live instd
, sostd::size_t
. - While I prefer to use
std::size_t
when doing indexing especially in realtime code for compatibility withstd
containers, it does go against Qt's mantra of usingint
(at least in their external APIs). Previous experiments have also shown that MSVC is apparently worse at autovectorizing buffer indexes that usesize_t
s rather thanint
s, which was the reason to typedefSINT
toint
rather thansize_t
.
I'd prefer if you can take care of 1.
2. I just wanted to mention so you're aware even though I don't personally think its a strong argument against size_t
.
539df3f
to
748163d
Compare
748163d
to
7f2247f
Compare
Line 13 in edae0ca
And Qt used int in Qt5 an ssize_t form Qt6 We have also a pending discussion to pass all buffers as a std::span, wich includes std::size_t a size. This however goes against our alternative attempt to pass buffers without the stereo assumption. This issue is also visible in the #13654 So maybe we want an own span type with a frame size? |
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.
couple more comments. LGTM otherwise though
src/encoder/encodersndfileflac.cpp
Outdated
SINT numSamplesLeft = bufferSize; | ||
while (numSamplesLeft > 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.
was this a confused clang-format or where is the bogus indentation from?
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 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 will not address this in this PR!
Not forcing you to, though I wonder whether it makes sense to just enforce yourself and skip clang-format...
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.
This I can do, but not fixing the script
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.
Done! CI fails now as expected.
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.
yeah thats fine for me. Since it only runs on the diff we shouldn't be bothered by it again after the merge, right?
In the long-term, yes. As I pointed out previously |
I think transitioning to |
…f the name at many related parts of the code
7f2247f
to
220ce2e
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.
LGTM otherwise. Thank you.
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.
Thank you. LGTM.
This is a spin-off of #13172 (comment) to keep the changes not related to Macros out of that PR.