[{"id":28,"web_url":"https://patchwork.libcamera.org/comment/28/","msgid":"<1565775.hpMEbT7qVJ@avalon>","date":"2018-11-30T19:56:42","subject":"Re: [libcamera-devel] [PATCH] lib: Fix class and namespace usage","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Friday, 30 November 2018 13:07:37 EET Kieran Bingham wrote:\n> The (dummy) init_lib function was linking correctly only due to a\n> namespace 'collision' adding the init_lib to libcamera namespace, which\n> is 'shared' by class libcamera.\n> \n> The init function was designed to be a class member function of the\n> libcamera object - and is used as such in the existing test function.\n> \n> Instead of relying on the namespace collision - update the lib/main.cpp\n> example file to correctly utilise the class header - and specify the\n> function declaration, so that further implementations do not fall into\n> the same bad habits.\n> \n> Reported-by: Jacopo Mondi <jacopo@mondi.org>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nThis looks good to me, feel free to merge with \n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\neven if the code will go away very soon.\n\n> ---\n>  lib/main.cpp | 7 ++-----\n>  1 file changed, 2 insertions(+), 5 deletions(-)\n> \n> diff --git a/lib/main.cpp b/lib/main.cpp\n> index 7b3da269f695..37f1ccce43cc 100644\n> --- a/lib/main.cpp\n> +++ b/lib/main.cpp\n> @@ -1,13 +1,10 @@\n>  #include <iostream>\n> -\n> -namespace libcamera {\n> +#include <libcamera/libcamera.h>\n> \n>  using std::cout;\n>  using std::endl;\n> \n> -void init_lib(void)\n> +void libcamera::init_lib(void)\n>  {\n>  \tcout << \"Lib Camera Init\" << endl;\n>  }\n> -\n> -};","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A3EBA60B0C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Nov 2018 20:56:15 +0100 (CET)","from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1693A562;\n\tFri, 30 Nov 2018 20:56:12 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1543607772;\n\tbh=axDz7k1wpSqpIiZJURnzKns+sw1MuK+Mapu/ALD3mNE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=k7nz73HOA+kqEk0blnyUXspRA84tmLB98MXwWTmgTzNnUeul44Pq3Rg3QpDR50C0z\n\tveomnYo3iXhajEYM971KaotJhVETG7Ez8hEUU8ALXVguBCujSlkYFVu0gT5ooBFuoq\n\tDtUgw1hFlbKklDWtl1nUMwINVuhbT+NyBjRuG1iY=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 30 Nov 2018 21:56:42 +0200","Message-ID":"<1565775.hpMEbT7qVJ@avalon>","Organization":"Ideas on Board Oy","In-Reply-To":"<20181130110737.18947-1-kieran.bingham@ideasonboard.com>","References":"<20181130110737.18947-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"7Bit","Content-Type":"text/plain; charset=\"us-ascii\"","Subject":"Re: [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":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 30 Nov 2018 19:56:15 -0000"}}]