[{"id":538,"web_url":"https://patchwork.libcamera.org/comment/538/","msgid":"<20190123155126.GB31885@pendragon.ideasonboard.com>","date":"2019-01-23T15:51:26","subject":"Re: [libcamera-devel] [PATCH] libcamera: fix odd include file\n\thierarchy","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Wed, Jan 23, 2019 at 12:29:57PM +0100, Niklas Söderlund wrote:\n> There is no need for pipeline_handler.h to include camera.h, instead it\n> should be included in the source file which needs it;\n> camera_manager.cpp. Fix this by adding a forward declaration of Camera\n> in pipeline_handler.h and include the header in the correct file.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/camera_manager.cpp         | 1 +\n>  src/libcamera/include/pipeline_handler.h | 3 +--\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n> index 37ccbd533790856a..4ea7ed44cc31f747 100644\n> --- a/src/libcamera/camera_manager.cpp\n> +++ b/src/libcamera/camera_manager.cpp\n> @@ -5,6 +5,7 @@\n>   * camera_manager.h - Camera management\n>   */\n>  \n> +#include <libcamera/camera.h>\n>  #include <libcamera/camera_manager.h>\n>  #include <libcamera/event_dispatcher.h>\n>  \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index f05f201f7ca824eb..87dc3debd795eb3e 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -11,10 +11,9 @@\n>  #include <string>\n>  #include <vector>\n>  \n> -#include <libcamera/camera.h>\n> -\n>  namespace libcamera {\n>  \n> +class Camera;\n\nIn the master branch this isn't needed, you can drop the forward\ndeclaration (please make sure everything compiles :-))..\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  class CameraManager;\n>  class DeviceEnumerator;\n>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E23E160C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 16:51:27 +0100 (CET)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BCEF23D;\n\tWed, 23 Jan 2019 16:51:27 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548258687;\n\tbh=OG1oRIAtt0XJ75KlKTgRHBGFh6HqdxiC//3Kn0+EUiE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=RbVPh2w6dEQNFz1N266nQIlF6C2WVj5MIehizQCf7QIj/CieRr//viRmA6AsIdD+U\n\tSEK0O2wBk27mgC2COXPfIeb0IUcQy2y4cgBEe1QIHR0BXcyfeF/5UtbKw+UshP/oz0\n\tVbWheMp/OnP6zcY6YHwnYtbqUfyJIwq9SnsWqKWA=","Date":"Wed, 23 Jan 2019 17:51:26 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190123155126.GB31885@pendragon.ideasonboard.com>","References":"<20190123112957.25580-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190123112957.25580-1-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] libcamera: fix odd include file\n\thierarchy","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":"Wed, 23 Jan 2019 15:51:28 -0000"}},{"id":539,"web_url":"https://patchwork.libcamera.org/comment/539/","msgid":"<20190123160308.GQ4127@bigcity.dyn.berto.se>","date":"2019-01-23T16:03:08","subject":"Re: [libcamera-devel] [PATCH] libcamera: fix odd include file\n\thierarchy","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nOn 2019-01-23 17:51:26 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Wed, Jan 23, 2019 at 12:29:57PM +0100, Niklas Söderlund wrote:\n> > There is no need for pipeline_handler.h to include camera.h, instead it\n> > should be included in the source file which needs it;\n> > camera_manager.cpp. Fix this by adding a forward declaration of Camera\n> > in pipeline_handler.h and include the header in the correct file.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/libcamera/camera_manager.cpp         | 1 +\n> >  src/libcamera/include/pipeline_handler.h | 3 +--\n> >  2 files changed, 2 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n> > index 37ccbd533790856a..4ea7ed44cc31f747 100644\n> > --- a/src/libcamera/camera_manager.cpp\n> > +++ b/src/libcamera/camera_manager.cpp\n> > @@ -5,6 +5,7 @@\n> >   * camera_manager.h - Camera management\n> >   */\n> >  \n> > +#include <libcamera/camera.h>\n> >  #include <libcamera/camera_manager.h>\n> >  #include <libcamera/event_dispatcher.h>\n> >  \n> > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > index f05f201f7ca824eb..87dc3debd795eb3e 100644\n> > --- a/src/libcamera/include/pipeline_handler.h\n> > +++ b/src/libcamera/include/pipeline_handler.h\n> > @@ -11,10 +11,9 @@\n> >  #include <string>\n> >  #include <vector>\n> >  \n> > -#include <libcamera/camera.h>\n> > -\n> >  namespace libcamera {\n> >  \n> > +class Camera;\n> \n> In the master branch this isn't needed, you can drop the forward\n> declaration (please make sure everything compiles :-))..\n\nYou are correct, I guess that is what I get by writing fix-up patches on \ntop of my devel branches :-)\n\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks, with the forward declaration removed (code+commit message) and \nmaking sure everything compiles pushed to master.\n\n> \n> >  class CameraManager;\n> >  class DeviceEnumerator;\n> >  \n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x135.google.com (mail-lf1-x135.google.com\n\t[IPv6:2a00:1450:4864:20::135])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 720D960B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 17:03:10 +0100 (CET)","by mail-lf1-x135.google.com with SMTP id a16so1972204lfg.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 08:03:10 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tt81sm547489lfe.84.2019.01.23.08.03.08\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 23 Jan 2019 08:03:08 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=2KppCG1tyqZSj4nrmjSQ+65l0nY0RZS2y4m4+vlA/bg=;\n\tb=JBsPfcwMjkT49/bfL25R255gfL2tTMmLWbrTOJcSTu8ckziK0vRoCpcqltK05YwPq5\n\t0ReSYophuXPSiOY0I80sXPM39hod7w1QRXS9kCVGiqpPiR8M3zZMOvfBRPhqZakJHFEM\n\t8VCwmgSUOuabgCiT2bT858WVAdTI/ebacdPuK5Wb1hr5FgioaAByOjqNZo+oN1qVhRUd\n\tp8UHGPYzdYnMpZEgy2uVadxoujAmeKKrMwOZZ36ZSMGT52OJKetYWuLY6oX3NGWbxBDX\n\tUbYQJ/TNQuOwrhXq4+774an0K8a6vd8eEAcxqIK4oFjmiJ/XS1ysnHyNLkWvA+49rCd4\n\tjGXA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=2KppCG1tyqZSj4nrmjSQ+65l0nY0RZS2y4m4+vlA/bg=;\n\tb=JbEBNqG3AbLRMP1AEcq5KIbveQnsVw5vkU6pQL+tNQQh8UsHu5F4Mr+L5ck6pEZItz\n\tkSEBq6gz5FFcxcu9GCpKlDz9+xsITxMgpm27YmqSrSJUvYmhqZ8ceKHqQ61AKRpqn8ej\n\txoLfWAeXjN7m5d2fHpjj9od8QYFfHDbeQY+pQk1cscwGYOqPtfAeEL2uYDQU2NFQE9My\n\tjm7PnVVdW8ktt6Fd94A67mxLiFM8OlJmmycuIj0Y67hpkVwl01ENVHqyEHO0tnpFShLb\n\tHruP9luGtFli3oAstiX6VrKG/yBzt1rYF+3UHz/pG9vfbgEfhxxbWVeFG70GPmQE5OIT\n\tvfPA==","X-Gm-Message-State":"AJcUuke0ZkqC8BfkYAbhxFsEgu5yLUvZSzm8Frp58Es/VMH+ncjLvwhH\n\twZquzn71xz8QOv8lNmiHjV3hCRfcTeU=","X-Google-Smtp-Source":"ALg8bN5epaFnPJGNALiNii2sc8X6eHsSWgf97DZRy4IcDN4xdhLZOIgMGUNBqrhhLu7leaHhAHqEWw==","X-Received":"by 2002:a19:2906:: with SMTP id p6mr2285209lfp.17.1548259389626; \n\tWed, 23 Jan 2019 08:03:09 -0800 (PST)","Date":"Wed, 23 Jan 2019 17:03:08 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190123160308.GQ4127@bigcity.dyn.berto.se>","References":"<20190123112957.25580-1-niklas.soderlund@ragnatech.se>\n\t<20190123155126.GB31885@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190123155126.GB31885@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] libcamera: fix odd include file\n\thierarchy","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":"Wed, 23 Jan 2019 16:03:10 -0000"}}]