Skip to content

Commit

Permalink
Refine comment in last commit, 24ebadc (thanks @mbeutel)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmoene committed Apr 18, 2023
1 parent 24ebadc commit 84b401c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/lest/lest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ inline std::string transformed( char chr )
return tr.str;
}

auto unprintable = [](char c){ return 0 <= static_cast<signed char>(c) && c < ' '; }; // the cast is necessary on architectures where char is unsigned
// The cast below helps suppress warnings ("-Wtype-limits" on GCC) on architectures where `char` is unsigned.
auto unprintable = [](char c){ return 0 <= static_cast<signed char>(c) && c < ' '; };

auto to_hex_string = [](char c)
{
Expand Down
6 changes: 5 additions & 1 deletion include/lest/lest_cpp03.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ inline void inform( location where, text expr )

// Expression decomposition:

inline bool unprintable( char c ) { return 0 <= static_cast<signed char>(c) && c < ' '; } // the cast is necessary on architectures where char is unsigned
inline bool unprintable( char c )
{
// The cast helps suppress warnings ("-Wtype-limits" on GCC) on architectures where `char` is unsigned.
return 0 <= static_cast<signed char>(c) && c < ' ';
}

inline std::string to_hex_string(char c)
{
Expand Down

0 comments on commit 84b401c

Please sign in to comment.