From 62f81a60d7a9d62ee2fcf2569b8f4a7aceea5551 Mon Sep 17 00:00:00 2001 From: Niels Date: Fri, 29 Apr 2016 21:23:13 +0200 Subject: [PATCH] hopefully fixed a warning --- src/json.hpp | 6 ++++-- src/json.hpp.re2c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 57a8f4c7..65ced730 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -6078,9 +6078,11 @@ class basic_json { // convert a number 0..15 to its hex representation // (0..f) - auto hexify = [](const char v) -> char + const auto hexify = [](const int v) -> char { - return (v < 10) ? ('0' + v) : ('a' + v - 10); + return (v < 10) + ? ('0' + static_cast(v)) + : ('a' + static_cast(v - 10)); }; // print character c as \uxxxx diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index cdd96ee9..0aa8321e 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -6078,9 +6078,11 @@ class basic_json { // convert a number 0..15 to its hex representation // (0..f) - auto hexify = [](const char v) -> char + const auto hexify = [](const int v) -> char { - return (v < 10) ? ('0' + v) : ('a' + v - 10); + return (v < 10) + ? ('0' + static_cast(v)) + : ('a' + static_cast(v - 10)); }; // print character c as \uxxxx