-
Notifications
You must be signed in to change notification settings - Fork 224
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
audiomixerboard size_t clean-up #2893
audiomixerboard size_t clean-up #2893
Conversation
df596ec
to
4aa32ab
Compare
e4d9a57
to
06a05cc
Compare
06a05cc
to
f2d0dbb
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.
Is there any valid reason why size_t is prefered by Qt? I doubt we get over the positive integer range anywhere.
563f2f1
to
02c7128
Compare
09f1fc4
to
85ef075
Compare
85ef075
to
fee011a
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.
Approving based on reading.
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 don't see anything wrong here, but I can't say that I'm able to assess that everything is right... ;)
Fixes warnings in Qt Creator in one file. Warnings of a similar nature are also available.
What are those warnings?
I wish cut-n-paste from the warnings was simple. They seemed to be Qt IDE rather than Compiler warnings (so the compile output didn't show them). Whilst correct (i.e. size_t can hold a larger number than int as it's unsigned), the int usage is also correct in places (we use -1 as an invalid index into an array or list, which has an index type of size_t, so doing something like
will get a warning, as someArray could be so big that even taking one off the size is still too large a positive number for the int to hold. In practice, we generally use no extent over about 256 (sound card buffer size is probably the worst - maybe 4K? - still well under the number an int can hold). |
fee011a
to
ce34498
Compare
Short description of changes
Small patch to
audiomixerboard.cpp
to clean up warnings in Qt Creator. Changesint
tosize_t
where appropriate and handles any casts required.CHANGELOG: Refactor: use
size_t
for vector and array indexes that must not be negativeContext: Fixes an issue?
Fixes warnings in Qt Creator in one file. Warnings of a similar nature are also available.
Does this change need documentation? What needs to be documented and how?
No.
Status of this Pull Request
I use it in the client I run when jamming and it seems okay.
What is missing until this pull request can be merged?
Needs a review.
Checklist
AUTOBUILD: Please build all targets