mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 00:58:29 +00:00
Convert a few remaining C-style casts (for char) too static_cast
(cherry-picked from commit ce85c170200aee86ebd0b7a98ef7102a03e62dd5)
This commit is contained in:
parent
5250d970b3
commit
ee619b999f
@ -76,7 +76,7 @@ std::string format_version(const SDL_version& v)
|
||||
std::string format_openssl_patch_level(uint8_t p)
|
||||
{
|
||||
return p <= 26
|
||||
? std::string(1, 'a' + char(p) - 1)
|
||||
? std::string(1, 'a' + static_cast<char>(p) - 1)
|
||||
: "patch" + std::to_string(p);
|
||||
}
|
||||
|
||||
|
@ -1247,7 +1247,7 @@ std::ostream& operator<<(std::ostream& outstream, const config& cfg)
|
||||
}
|
||||
|
||||
for(int j = 0; j < i - 1; j++) {
|
||||
outstream << char(9);
|
||||
outstream << static_cast<char>(9);
|
||||
}
|
||||
|
||||
outstream << val.first << " = " << val.second << '\n';
|
||||
@ -1255,14 +1255,14 @@ std::ostream& operator<<(std::ostream& outstream, const config& cfg)
|
||||
|
||||
for(const config::any_child& child : cfg.all_children_range()) {
|
||||
for(int j = 0; j < i - 1; ++j) {
|
||||
outstream << char(9);
|
||||
outstream << static_cast<char>(9);
|
||||
}
|
||||
|
||||
outstream << "[" << child.key << "]\n";
|
||||
outstream << child.cfg;
|
||||
|
||||
for(int j = 0; j < i - 1; ++j) {
|
||||
outstream << char(9);
|
||||
outstream << static_cast<char>(9);
|
||||
}
|
||||
|
||||
outstream << "[/" << child.key << "]\n";
|
||||
|
@ -275,8 +275,8 @@ t_string_base::t_string_base(const std::string& string, const std::string& textd
|
||||
id = idi->second;
|
||||
}
|
||||
|
||||
value_ += char(id & 0xff);
|
||||
value_ += char(id >> 8);
|
||||
value_ += static_cast<char>(id & 0xff);
|
||||
value_ += static_cast<char>(id >> 8);
|
||||
value_ += string;
|
||||
}
|
||||
|
||||
@ -304,8 +304,8 @@ t_string_base::t_string_base(const std::string& sing, const std::string& pl, int
|
||||
id = idi->second;
|
||||
}
|
||||
|
||||
value_ += char(id & 0xff);
|
||||
value_ += char(id >> 8);
|
||||
value_ += static_cast<char>(id & 0xff);
|
||||
value_ += static_cast<char>(id >> 8);
|
||||
value_ += sing;
|
||||
value_ += PLURAL_PART;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user