Commit e725ea308468ab50751ba7f930842a4c061226e9

Authored by Jarryd Beck
1 parent d47101a1

Use unsigned type for integer digit

Fixes #109. Although we always used numbers in the ASCII range, it was
in a `size_t`, leading to a warning about possible loss of data on some
compilers.
CHANGELOG.md
... ... @@ -9,6 +9,10 @@ options. The project adheres to semantic versioning.
9 9  
10 10 * Allow integers to have leading zeroes.
11 11  
  12 +### Bug Fixes
  13 +
  14 +* Fix a warning about possible loss of data.
  15 +
12 16 ## 2.1.1
13 17  
14 18 ### Bug Fixes
... ...
include/cxxopts.hpp
... ... @@ -547,7 +547,7 @@ namespace cxxopts
547 547  
548 548 for (auto iter = value_match.first; iter != value_match.second; ++iter)
549 549 {
550   - size_t digit = 0;
  550 + US digit = 0;
551 551  
552 552 if (*iter >= '0' && *iter <= '9')
553 553 {
... ...