diff options
author | Mitja Spes <mitja@lxnav.com> | 2023-09-21 08:06:21 (GMT) |
---|---|---|
committer | Mitja Spes <mitja@lxnav.com> | 2023-09-21 08:06:21 (GMT) |
commit | e27b194c2702f02cf033a32bb49978b8ff32aa15 (patch) | |
tree | 690d4bbe821c518ee81678bfdfe5c8158d34e4cc /googlemock/include/gmock | |
parent | adc514538678a61b13c240f7b41babbc03b2ac24 (diff) | |
download | googletest-e27b194c2702f02cf033a32bb49978b8ff32aa15.zip googletest-e27b194c2702f02cf033a32bb49978b8ff32aa15.tar.gz googletest-e27b194c2702f02cf033a32bb49978b8ff32aa15.tar.bz2 |
Fix compile warnings in gmock-function-mocker.hrefs/pull/4374/head
Template type int changed to size_t.
This fixes compile warning `conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result` in gmock-function-mocker.h.
Diffstat (limited to 'googlemock/include/gmock')
-rw-r--r-- | googlemock/include/gmock/gmock-function-mocker.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/googlemock/include/gmock/gmock-function-mocker.h b/googlemock/include/gmock/gmock-function-mocker.h index 1a1f126..30355fe 100644 --- a/googlemock/include/gmock/gmock-function-mocker.h +++ b/googlemock/include/gmock/gmock-function-mocker.h @@ -69,22 +69,22 @@ constexpr bool PrefixOf(const char* a, const char* b) { return *a == 0 || (*a == *b && internal::PrefixOf(a + 1, b + 1)); } -template <int N, int M> +template <size_t N, size_t M> constexpr bool StartsWith(const char (&prefix)[N], const char (&str)[M]) { return N <= M && internal::PrefixOf(prefix, str); } -template <int N, int M> +template <size_t N, size_t M> constexpr bool EndsWith(const char (&suffix)[N], const char (&str)[M]) { return N <= M && internal::PrefixOf(suffix, str + M - N); } -template <int N, int M> +template <size_t N, size_t M> constexpr bool Equals(const char (&a)[N], const char (&b)[M]) { return N == M && internal::PrefixOf(a, b); } -template <int N> +template <size_t N> constexpr bool ValidateSpec(const char (&spec)[N]) { return internal::Equals("const", spec) || internal::Equals("override", spec) || |