From 7fbcae267919a71b613187f493ec2d4de4182fb8 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 9 Jul 2020 22:17:59 +0200 Subject: [PATCH] :rotating_light: fix a warning --- include/nlohmann/detail/input/lexer.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index b18893a4d..5c9d5ed5c 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -936,7 +936,7 @@ class lexer : public lexer_base while (*p >= '0' and * p <= '9') { - val = (10 * val) + (*p - '0'); + val = (10U * val) + static_cast((*p - '0')); p++; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 18ec30246..b04619fe1 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -9048,7 +9048,7 @@ class lexer : public lexer_base while (*p >= '0' and * p <= '9') { - val = (10 * val) + (*p - '0'); + val = (10U * val) + static_cast((*p - '0')); p++; }