mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
Warning fix for VS2017, don't call toupper/tolower as they're int -> int
This commit is contained in:
@@ -47,10 +47,21 @@ uint32_t strhash(const char *str, uint32_t seed)
|
||||
return hash;
|
||||
}
|
||||
|
||||
// since tolower is int -> int, this warns below. make a char -> char alternative
|
||||
char toclower(char c)
|
||||
{
|
||||
return (char)tolower(c);
|
||||
}
|
||||
|
||||
char tocupper(char c)
|
||||
{
|
||||
return (char)toupper(c);
|
||||
}
|
||||
|
||||
string strlower(const string &str)
|
||||
{
|
||||
string newstr(str);
|
||||
transform(newstr.begin(), newstr.end(), newstr.begin(), tolower);
|
||||
transform(newstr.begin(), newstr.end(), newstr.begin(), toclower);
|
||||
return newstr;
|
||||
}
|
||||
|
||||
@@ -64,7 +75,7 @@ wstring strlower(const wstring &str)
|
||||
string strupper(const string &str)
|
||||
{
|
||||
string newstr(str);
|
||||
transform(newstr.begin(), newstr.end(), newstr.begin(), toupper);
|
||||
transform(newstr.begin(), newstr.end(), newstr.begin(), tocupper);
|
||||
return newstr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user