Getting rid of compiler warning: C4310: cast truncates constant value

This commit is contained in:
Reijo Tomperi 2009-10-11 17:38:55 +03:00
parent 485f02642c
commit de70874084
1 changed files with 3 additions and 3 deletions

View File

@ -330,9 +330,9 @@ std::string Preprocessor::read(std::istream &istr)
static bool hasbom(const std::string &str)
{
return bool(str.size() > 3 &&
(char)str[0] == (char)0xef &&
(char)str[1] == (char)0xbb &&
(char)str[2] == (char)0xbf);
static_cast<unsigned char>(str[0]) == 0xef &&
static_cast<unsigned char>(str[1]) == 0xbb &&
static_cast<unsigned char>(str[2]) == 0xbf);
}