diff options
Diffstat (limited to 'src/core/json/json_reader.c')
-rw-r--r-- | src/core/json/json_reader.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/json/json_reader.c b/src/core/json/json_reader.c index 5ea4e9569c..c14094c290 100644 --- a/src/core/json/json_reader.c +++ b/src/core/json/json_reader.c @@ -151,7 +151,7 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) { case GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL: case GRPC_JSON_STATE_VALUE_NUMBER_ZERO: case GRPC_JSON_STATE_VALUE_NUMBER_EPM: - success = json_reader_set_number(reader); + success = (gpr_uint32)json_reader_set_number(reader); if (!success) return GRPC_JSON_PARSE_ERROR; json_reader_string_clear(reader); reader->state = GRPC_JSON_STATE_VALUE_END; @@ -177,7 +177,7 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) { case GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL: case GRPC_JSON_STATE_VALUE_NUMBER_ZERO: case GRPC_JSON_STATE_VALUE_NUMBER_EPM: - success = json_reader_set_number(reader); + success = (gpr_uint32)json_reader_set_number(reader); if (!success) return GRPC_JSON_PARSE_ERROR; json_reader_string_clear(reader); reader->state = GRPC_JSON_STATE_VALUE_END; @@ -410,8 +410,8 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) { } else { return GRPC_JSON_PARSE_ERROR; } - reader->unicode_char <<= 4; - reader->unicode_char |= c; + reader->unicode_char = (gpr_uint16)(reader->unicode_char << 4); + reader->unicode_char = (gpr_uint16)(reader->unicode_char | c); switch (reader->state) { case GRPC_JSON_STATE_STRING_ESCAPE_U1: @@ -438,8 +438,8 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) { if (reader->unicode_high_surrogate == 0) return GRPC_JSON_PARSE_ERROR; utf32 = 0x10000; - utf32 += (reader->unicode_high_surrogate - 0xd800) * 0x400; - utf32 += reader->unicode_char - 0xdc00; + utf32 += (gpr_uint32)((reader->unicode_high_surrogate - 0xd800) * 0x400); + utf32 += (gpr_uint32)(reader->unicode_char - 0xdc00); json_reader_string_add_utf32(reader, utf32); reader->unicode_high_surrogate = 0; } else { |