Skip to content

Commit

Permalink
[libromdata] PlayStationDisc::extURLs(): Use a lambda function instea…
Browse files Browse the repository at this point in the history
…d of ::toupper().

::toupper() might be a macro in some cases.

PlayStationDiscPrivate::parse_system_cnf(): `char`, not `unsigned char`.
  • Loading branch information
GerbilSoft committed Nov 1, 2024
1 parent d2a88e1 commit 8c7e792
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libromdata/Console/PlayStationDisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int PlayStationDiscPrivate::parse_system_cnf(void *user, const char *section, co
// Save the value for later.
string s_name(name);
std::transform(s_name.begin(), s_name.end(), s_name.begin(),
[](unsigned char c) noexcept -> char { return std::toupper(c); });
[](char c) noexcept -> char { return std::toupper(c); });

PlayStationDiscPrivate *const d = static_cast<PlayStationDiscPrivate*>(user);
auto ret = d->system_cnf.emplace(std::move(s_name), value);
Expand Down Expand Up @@ -946,7 +946,8 @@ int PlayStationDisc::extURLs(ImageType imageType, vector<ExtURL> *pExtURLs, int
// Boot filename format: SLUS_207.18
// Using the first part as the region code.
string gameID = d->boot_filename;
std::transform(gameID.begin(), gameID.end(), gameID.begin(), ::toupper);
std::transform(gameID.begin(), gameID.end(), gameID.begin(),
[](char c) noexcept -> char { return std::toupper(c); });
string region_code;
size_t pos = gameID.find('_');
if (pos != string::npos) {
Expand Down

0 comments on commit 8c7e792

Please sign in to comment.