Skip to content

Commit 5ab488e

Browse files
committed
Fixed build issues (not done yet)
One json test (to_string_escaped_chars) still fails.
1 parent 103f55c commit 5ab488e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Release/src/json/json_parsing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,21 +810,21 @@ bool JSON_StringParser<CharType>::CompleteStringLiteral(typename JSON_Parser<Cha
810810
}
811811

812812
template <typename CharType>
813-
bool JSON_StringParser<CharType>::finish_parsing_string_with_unescape_char(Token &token)
813+
bool JSON_StringParser<CharType>::finish_parsing_string_with_unescape_char(typename JSON_Parser<CharType>::Token &token)
814814
{
815815
// This function handles parsing the string when an unescape character is encountered.
816816
// It is called once the part before the unescape char is copied to the token.spelling string
817817

818818
CharType ch;
819819

820-
if (!handle_unescape_char(token))
820+
if (!JSON_StringParser<CharType>::handle_unescape_char(token))
821821
return false;
822822

823823
while ((ch = JSON_StringParser<CharType>::NextCharacter()) != '"')
824824
{
825825
if (ch == '\\')
826826
{
827-
if (!handle_unescape_char(token))
827+
if (!JSON_StringParser<CharType>::handle_unescape_char(token))
828828
return false;
829829
}
830830
else
@@ -836,7 +836,7 @@ bool JSON_StringParser<CharType>::finish_parsing_string_with_unescape_char(Token
836836
}
837837
}
838838

839-
token.kind = Token::TKN_StringLiteral;
839+
token.kind = JSON_StringParser<CharType>::Token::TKN_StringLiteral;
840840
token.end.m_column = this->m_currentColumn;
841841
token.end.m_line = this->m_currentLine;
842842

Release/src/json/json_serialization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void web::json::details::_Number::format(std::basic_string<char>& stream) const
154154
_itoa_s(m_intval, tempBuffer, tempSize, 10);
155155
const auto numChars = strnlen_s(tempBuffer, tempSize);
156156
#else
157-
const auto numChars = std::snprintf(tempBuffer, tempSize, "i", m_value);
157+
const auto numChars = std::snprintf(tempBuffer, tempSize, "%i", m_intval);
158158
#endif
159159
stream.append(tempBuffer, numChars);
160160
}
@@ -263,7 +263,7 @@ bool web::json::details::_String::has_escape_chars(const _String &str)
263263
{
264264
if (str.is_wide())
265265
{
266-
const wchar_t *escapes = L"\"\\\b\f\r\n\t";
266+
const utf16char *escapes = u"\"\\\b\f\r\n\t";
267267
return str.m_wstring->find_first_of(escapes) != std::wstring::npos;
268268
}
269269
else
@@ -382,7 +382,7 @@ bool json::value::operator==(const json::value &other) const
382382
case Array:
383383
return static_cast<const json::details::_Array*>(this->m_value.get())->is_equal(static_cast<const json::details::_Array*>(other.m_value.get()));
384384
}
385-
return false;
385+
UNREACHABLE;
386386
}
387387

388388
web::json::value& web::json::value::operator [] (const utility::string_t &key)

0 commit comments

Comments
 (0)