Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSketchyLizard2021-11-17 09:01:12 -0500
committerMartin Hořeňovský2021-11-20 21:38:01 +0100
commit2db1cf34047f76cb2679a3804b476881536ad27b (patch)
tree201d8e5283d9cc7dfe2ce38879c85da7164f85b6
parentfabe614ba8fced5f0a6aedaa2e3b4e657bda4764 (diff)
downloadcatch3-2db1cf34047f76cb2679a3804b476881536ad27b.tar.gz
Fix template args to avoid conversion warnings
Fix avoids a warning about sign conversion when included from a file compiled with -Werror=sign-conversion.
-rw-r--r--src/catch2/catch_tostring.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/catch2/catch_tostring.hpp b/src/catch2/catch_tostring.hpp
index 0bbf989c..9182a119 100644
--- a/src/catch2/catch_tostring.hpp
+++ b/src/catch2/catch_tostring.hpp
@@ -205,7 +205,7 @@ namespace Catch {
};
#endif // CATCH_CONFIG_WCHAR
- template<int SZ>
+ template<size_t SZ>
struct StringMaker<char[SZ]> {
static std::string convert(char const* str) {
// Note that `strnlen` is not actually part of standard C++,
@@ -214,7 +214,7 @@ namespace Catch {
StringRef( str, strnlen( str, SZ ) ) );
}
};
- template<int SZ>
+ template<size_t SZ>
struct StringMaker<signed char[SZ]> {
static std::string convert(signed char const* str) {
// See the plain `char const*` overload
@@ -223,7 +223,7 @@ namespace Catch {
StringRef(reinterpreted, strnlen(reinterpreted, SZ)));
}
};
- template<int SZ>
+ template<size_t SZ>
struct StringMaker<unsigned char[SZ]> {
static std::string convert(unsigned char const* str) {
// See the plain `char const*` overload
@@ -522,7 +522,7 @@ namespace Catch {
}
};
- template <typename T, int SZ>
+ template <typename T, size_t SZ>
struct StringMaker<T[SZ]> {
static std::string convert(T const(&arr)[SZ]) {
return rangeToString(arr);