Page MenuHomePhabricator

[backport#15139] util: Make ToLower and ToUpper take a char
ClosedPublic

Authored by majcosta on May 29 2020, 18:04.

Details

Summary

Unfortunately, std::string elements are (bare) chars. As these
are the most likely type to be passed to these functions, make them use
char instead of unsigned char. This avoids some casts.

https://github.com/bitcoin/bitcoin/pull/15139/commits/332b3dd7c156daa08df347dc3359f0ee99ce4baa


Depends on D6294

Concludes backport of Core PR15139

Test Plan
ninja check

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

deadalnix requested changes to this revision.May 29 2020, 21:32
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/util/strencodings.h
224 ↗(On Diff #20708)

Please use char here as the intent is for this to be a character, not a signed 8bit integer.

Also, char signedness is plateform dependent.

This revision now requires changes to proceed.May 29 2020, 21:32

converted return type and parameter of ToUpper/ToLower functions to char as in the PR

This revision is now accepted and ready to land.May 31 2020, 21:57