diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h
index 52301254c..2b761436a 100644
--- a/include/libcamera/base/utils.h
+++ b/include/libcamera/base/utils.h
@@ -246,7 +246,7 @@ private:
public:
using difference_type = typename std::iterator_traits::difference_type;
- using value_type = std::pair;
+ using value_type = std::pair;
using pointer = value_type *;
using reference = value_type &;
using iterator_category = std::input_iterator_tag;
@@ -275,7 +275,7 @@ public:
private:
Base current_;
- difference_type pos_;
+ std::size_t pos_;
};
template
diff --git a/test/utils.cpp b/test/utils.cpp
index d7f810e95..d65467b51 100644
--- a/test/utils.cpp
+++ b/test/utils.cpp
@@ -77,8 +77,8 @@ protected:
int testEnumerate()
{
- std::vector integers{ 1, 2, 3, 4, 5 };
- int i = 0;
+ std::vector integers{ 1, 2, 3, 4, 5 };
+ unsigned int i = 0;
for (auto [index, value] : utils::enumerate(integers)) {
if (index != i || value != i + 1) {
@@ -93,12 +93,12 @@ protected:
++i;
}
- if (integers != std::vector{ 0, 1, 2, 3, 4 }) {
+ if (integers != std::vector{ 0, 1, 2, 3, 4 }) {
cerr << "Failed to modify container in enumerated range loop" << endl;
return TestFail;
}
- Span span{ integers };
+ Span span{ integers };
i = 0;
for (auto [index, value] : utils::enumerate(span)) {
@@ -112,7 +112,7 @@ protected:
++i;
}
- const int array[] = { 0, 2, 4, 6, 8 };
+ const unsigned int array[] = { 0, 2, 4, 6, 8 };
i = 0;
for (auto [index, value] : utils::enumerate(array)) {