From patchwork Tue Jun 25 13:15:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1517 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3BD1C61583 for ; Tue, 25 Jun 2019 15:15:23 +0200 (CEST) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 721CE510; Tue, 25 Jun 2019 15:15:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1561468522; bh=DSIf8lUFdbrUOxDDE9+b809NIHbVNaeTeYb9jN92LlU=; h=From:To:Cc:Subject:Date:From; b=JLjprkjQY3j7aTn3aHnWmk3q3aM1HPks9UacwTdWeFdT+GIjlaaz+g8oWYWypx3VM 8i1tIZoybHkkT5oIDsciavRrtTNkzd6vUYkPblsv9CVlu5SVRKVtXfgMJ1UXqWMlVG 4yEr3QcNy3upJclWRQA4uWfmJ0FjbLsSly+gW8F8= From: Kieran Bingham To: LibCamera Devel Cc: Kieran Bingham , "[autobuild.buildroot.net] Thomas Petazzoni" Date: Tue, 25 Jun 2019 14:15:08 +0100 Message-Id: <20190625131508.31263-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: event_dispatcher_poll: Simplify range iterator X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2019 13:15:23 -0000 GCCv6 and GCCv7 take objections to declaring a struct type when using a range based iterator. This issue does not appear in GCCv8 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. Reported-by: [autobuild.buildroot.net] Thomas Petazzoni Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/event_dispatcher_poll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/event_dispatcher_poll.cpp b/src/libcamera/event_dispatcher_poll.cpp index 0ff99fce47ab..df9dffb2326c 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());