From caf25dc5cfd11b965316f02610d49ae3d886716b Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 10 Jun 2019 22:25:49 +0100 Subject: libcamera: event_dispatcher_poll: Remove struct keyword from for-range When using -std=c++11, GCC versions 6.2 and 6.3 take objection to declaring a struct type when using a range based iterator: event_dispatcher_poll.cpp:231:13: error: types may not be defined in a for-range-declaration [-Werror] for (const struct pollfd &pfd : pollfds) { ^~~~~~ cc1plus: all warnings being treated as errors Removing the keyword 'struct' ensures that the compiler does not try to declare the type, and instead uses the type as already defined by the relevant poll.h header. This issue does not affect later compiler versions. Reported-by: [autobuild.buildroot.net] Thomas Petazzoni http://autobuild.buildroot.net/results/f6dd4c60c04892c8b1669e6000fce7edb2b6349e/ Fixes: 8356f8a6ab87 ("libcamera: Add a poll-based event dispatcher") Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/event_dispatcher_poll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp index 0ff99fce..df9dffb2 100644 --- a/src/libcamera/event_dispatcher_poll.cpp +++ b/src/libcamera/event_dispatcher_poll.cpp @@ -241,7 +241,7 @@ void EventDispatcherPoll::processNotifiers(const std::vector &pol { EventNotifier::Exception, POLLPRI }, }; - for (const struct pollfd &pfd : pollfds) { + for (const pollfd &pfd : pollfds) { auto iter = notifiers_.find(pfd.fd); ASSERT(iter != notifiers_.end()); -- cgit v1.2.1