diff --git a/libuavcan/test/transport/transfer_buffer.cpp b/libuavcan/test/transport/transfer_buffer.cpp index 0ae0b17b6b..8cd58527dc 100644 --- a/libuavcan/test/transport/transfer_buffer.cpp +++ b/libuavcan/test/transport/transfer_buffer.cpp @@ -14,18 +14,18 @@ static const std::string TEST_DATA = "pawnbroker, who had to be murdered too to get money from her trunk (for his career, you understand). " "Well, would he have brought himself to that if there had been no other means?"; -template -static bool allEqual(const T a) +template +static bool allEqual(const T (&a)[Size]) { - int n = sizeof(a) / sizeof(a[0]); - while (--n > 0 && a[n] == a[0]) { } + unsigned n = Size; + while ((--n > 0) && (a[n] == a[0])) { } return n == 0; } -template -static void fill(const T a, int value) +template +static void fill(T (&a)[Size], int value) { - for (unsigned i = 0; i < sizeof(a) / sizeof(a[0]); i++) + for (unsigned i = 0; i < Size; i++) { a[i] = value; }