From 54292e0509650d8ca7731820ee16b1864142dec7 Mon Sep 17 00:00:00 2001 From: Paul Henning Date: Mon, 23 Sep 2019 14:42:30 -0600 Subject: [PATCH] Added missing field initializers and typeinfo include --- ujson/ujson.cpp | 8 ++++---- ujson/ujson.hpp | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ujson/ujson.cpp b/ujson/ujson.cpp index e6e7224..c4f40da 100644 --- a/ujson/ujson.cpp +++ b/ujson/ujson.cpp @@ -76,9 +76,9 @@ struct utf8_ranges_t { }; static const utf8_ranges_t utf8_ranges[] = { - { 0x7F, 0 }, - { 0xBF, 1 }, // 80-BF invalid continuation - { 0xC1, 1 }, // 0xC0-0xC1 invalid as first byte + { 0x7F, 0, {} }, + { 0xBF, 1, {} }, // 80-BF invalid continuation + { 0xC1, 1, {} }, // 0xC0-0xC1 invalid as first byte { 0xDF, 1, { { 0x80, 0xBF + 1 } } }, { 0xE0, 2, { { 0xA0, 0xBF + 1 }, { 0x80, 0xBF + 1 } } }, { 0xEC, 2, { { 0x80, 0xBF + 1 }, { 0x80, 0xBF + 1 } } }, @@ -87,7 +87,7 @@ static const utf8_ranges_t utf8_ranges[] = { { 0xF0, 3, { { 0x90, 0xBF + 1 }, { 0x80, 0xBF + 1 }, { 0x80, 0xBF + 1 } } }, { 0xF3, 3, { { 0x80, 0xBF + 1 }, { 0x80, 0xBF + 1 }, { 0x80, 0xBF + 1 } } }, { 0xF4, 3, { { 0x80, 0x8F + 1 }, { 0x80, 0xBF + 1 }, { 0x80, 0xBF + 1 } } }, - { 0xFF, 1 } // 0xF5-0xFF invalid as first byte + { 0xFF, 1, {} } // 0xF5-0xFF invalid as first byte }; static const std::size_t num_utf8_ranges = diff --git a/ujson/ujson.hpp b/ujson/ujson.hpp index dba7071..6b981c4 100644 --- a/ujson/ujson.hpp +++ b/ujson/ujson.hpp @@ -31,6 +31,7 @@ #include #include #include +#include #include namespace ujson { @@ -721,8 +722,8 @@ inline void swap(value &lhs, value &rhs) noexcept { lhs.swap(rhs); } inline bool operator==(const value &lhs, const value &rhs) { - auto lhs_impl = lhs.impl(); - auto rhs_impl = rhs.impl(); + auto const lhs_impl = lhs.impl(); + auto const rhs_impl = rhs.impl(); if (typeid(*lhs_impl) != typeid(*rhs_impl)) return false;