Skip to content
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

Fix simple -Wsign-conversion cases. #1571

Merged
merged 2 commits into from
Mar 1, 2020
Merged

Conversation

refnum
Copy link
Contributor

@refnum refnum commented Mar 1, 2020

In both of these commits the variables can only hold positive values and are only passed to methods that take size_t parameters.

I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.

n is assigned a size_t, and only used for comparisons with j.

j is assigned 0, compared to n (size_t), and passed to basic_memory_buffer::operator[] (size_t).
num_bigits is initialised to 0, is only ever incremented, and is passed to basic_memory_buffer::operator[] (size_t) and basic_memory_buffer::resize (size_t).
@vitaut vitaut merged commit 58e6c84 into fmtlib:master Mar 1, 2020
@vitaut
Copy link
Contributor

vitaut commented Mar 1, 2020

Thanks!

sthagen added a commit to sthagen/fmtlib-fmt that referenced this pull request Mar 1, 2020
Fix simple -Wsign-conversion cases. (fmtlib#1571)
@refnum refnum deleted the sign_conversion branch March 2, 2020 14:01
teajay-fr pushed a commit to teajay-fr/fmt that referenced this pull request Mar 18, 2020
* Fix -Wsign-conversion in bigint::subtract_aligned.

n is assigned a size_t, and only used for comparisons with j.

j is assigned 0, compared to n (size_t), and passed to basic_memory_buffer::operator[] (size_t).

* Fix -Wsign-conversion in bigint::assign.

num_bigits is initialised to 0, is only ever incremented, and is passed to basic_memory_buffer::operator[] (size_t) and basic_memory_buffer::resize (size_t).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants