From 120205ac5a61d7e715f184fce0328ac5eb3d6712 Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Wed, 15 Mar 2023 07:09:09 +1100 Subject: [PATCH] Fix cast warning in Unicode function Fixes #339. Fixes a sign conversion warning in a function compiled by -DCXXOPTS_USE_UNICODE_HELP=1. --- CHANGELOG.md | 1 + include/cxxopts.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e96499..782f4d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ options. The project adheres to semantic versioning. ### Bug Fixes * Fixed version number in header. +* Fixed cast warning in Unicode function. ## 3.1 diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 6721342..2d3f4e8 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -230,10 +230,10 @@ stringAppend(String& s, Iterator begin, Iterator end) } inline -std::size_t +size_t stringLength(const String& s) { - return s.length(); + return static_cast(s.length()); } inline