mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 13:08:58 +00:00
Fix Windows warnings.
Cmake issued a warning when the variable is in quotation marks in an if statement. Visual Studio upgrades constants to int and issues a truncation warning, so inserted a cast. Change-Id: I60cdcb5c2565cd5e97f80b9c2ff1e6abc32b1deb Tested: Builds without warning on VS2015.
This commit is contained in:
@@ -148,12 +148,12 @@ static bool EscapeString(const String &s, std::string *_text, const IDLOptions&
|
||||
} else if (ucc <= 0x10FFFF) {
|
||||
// Encode Unicode SMP values to a surrogate pair using two \u escapes.
|
||||
uint32_t base = ucc - 0x10000;
|
||||
uint16_t highSurrogate = (base >> 10) + 0xD800;
|
||||
uint16_t lowSurrogate = (base & 0x03FF) + 0xDC00;
|
||||
auto high_surrogate = (base >> 10) + 0xD800;
|
||||
auto low_surrogate = (base & 0x03FF) + 0xDC00;
|
||||
text += "\\u";
|
||||
text += IntToStringHex(highSurrogate, 4);
|
||||
text += IntToStringHex(high_surrogate, 4);
|
||||
text += "\\u";
|
||||
text += IntToStringHex(lowSurrogate, 4);
|
||||
text += IntToStringHex(low_surrogate, 4);
|
||||
}
|
||||
// Skip past characters recognized.
|
||||
i = static_cast<uoffset_t>(utf8 - s.c_str() - 1);
|
||||
|
||||
Reference in New Issue
Block a user