From patchwork Fri Nov 30 11:07:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 21 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1650E60B0B for ; Fri, 30 Nov 2018 12:07:41 +0100 (CET) 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 76816562; Fri, 30 Nov 2018 12:07:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1543576060; bh=bly5moYCkW25Uj5HpasYJChECUX527JdNjzNFV/o8/w=; h=From:To:Cc:Subject:Date:From; b=bvsvZmdhX3BrSgNlMf+mJa+NoM/UxcQ3CKiT1N0ykuXVhW1wYCbFvivnsxghY7+F7 9KEW0854vLCKDFR6ddOfruhbPyAZQVZOqpLvO+3GMB0u3DCjQDYKXYD0WC+Q+2su9V H7vvTY7HaAmheKfXAlMgH0GKeSyB4uI4IpgXr7tM= From: Kieran Bingham To: LibCamera Devel Date: Fri, 30 Nov 2018 11:07:37 +0000 Message-Id: <20181130110737.18947-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH] lib: Fix class and namespace usage 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: Fri, 30 Nov 2018 11:07:41 -0000 The (dummy) init_lib function was linking correctly only due to a namespace 'collision' adding the init_lib to libcamera namespace, which is 'shared' by class libcamera. The init function was designed to be a class member function of the libcamera object - and is used as such in the existing test function. Instead of relying on the namespace collision - update the lib/main.cpp example file to correctly utilise the class header - and specify the function declaration, so that further implementations do not fall into the same bad habits. Reported-by: Jacopo Mondi Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- lib/main.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/main.cpp b/lib/main.cpp index 7b3da269f695..37f1ccce43cc 100644 --- a/lib/main.cpp +++ b/lib/main.cpp @@ -1,13 +1,10 @@ #include - -namespace libcamera { +#include using std::cout; using std::endl; -void init_lib(void) +void libcamera::init_lib(void) { cout << "Lib Camera Init" << endl; } - -};