diff --git a/include/dpp/stringops.h b/include/dpp/stringops.h index cd99d9cc4f..31b86d1443 100644 --- a/include/dpp/stringops.h +++ b/include/dpp/stringops.h @@ -24,6 +24,7 @@ #pragma once #include +#include #include #include #include @@ -42,7 +43,7 @@ namespace dpp { template std::basic_string lowercase(const std::basic_string& s) { std::basic_string s2 = s; - std::transform(s2.begin(), s2.end(), s2.begin(), tolower); + std::transform(s2.begin(), s2.end(), s2.begin(), [](unsigned char c){ return std::tolower(c); }); return s2; } @@ -56,7 +57,7 @@ template std::basic_string lowercase(const std::basic_string& template std::basic_string uppercase(const std::basic_string& s) { std::basic_string s2 = s; - std::transform(s2.begin(), s2.end(), s2.begin(), toupper); + std::transform(s2.begin(), s2.end(), s2.begin(), [](unsigned char c){ return std::toupper(c); }); return s2; } diff --git a/src/dpp/cluster/confirmation.cpp b/src/dpp/cluster/confirmation.cpp index 6e48b138a2..56e8904adf 100644 --- a/src/dpp/cluster/confirmation.cpp +++ b/src/dpp/cluster/confirmation.cpp @@ -93,7 +93,7 @@ std::vector find_errors_in_object(const std::string& obj, const st if (obj.empty()) { field = current_field; - } else if (isdigit(*current_field.c_str())) { + } else if (isdigit(static_cast(*current_field.c_str()))) { /* An element of an array, e.g. an element of a slash command vector for global_bulk_slash_command_create */ field = obj; field += '['; @@ -130,7 +130,7 @@ error_info confirmation_callback_t::get_error() const { json &errors = j["errors"]; for (auto obj = errors.begin(); obj != errors.end(); ++obj) { std::vector sub_errors; - std::string field = isdigit(*obj.key().c_str()) ? "[" + obj.key() + "]" : obj.key(); + std::string field = isdigit(static_cast(*obj.key().c_str())) ? "[" + obj.key() + "]" : obj.key(); sub_errors = find_errors_in_object({}, field, *obj);