Message ID | 20210707021941.20804-23-laurent.pinchart@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
On 07/07/2021 03:19, Laurent Pinchart wrote: > The CamApp::cameraName() doesn't need to access any member of the CamApp > class. Make is static. While at is, drop an unneded const from the s/is/it/ /unneded/unneeded/ > return value. Hrm ... if this was the return value being const I would have expected const std::string. Is this const supposed to be declaring the member function as const on the class (not modifying the class) and perhaps misplaced? Either-way, Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > src/cam/main.cpp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/cam/main.cpp b/src/cam/main.cpp > index 19ed9837cf4f..03e62f305f24 100644 > --- a/src/cam/main.cpp > +++ b/src/cam/main.cpp > @@ -44,7 +44,7 @@ private: > int infoConfiguration(); > int run(); > > - std::string const cameraName(const Camera *camera); > + static std::string cameraName(const Camera *camera); > > static CamApp *app_; > OptionsParser::Options options_; > @@ -319,7 +319,7 @@ int CamApp::run() > return 0; > } > > -std::string const CamApp::cameraName(const Camera *camera) > +std::string CamApp::cameraName(const Camera *camera) > { > const ControlList &props = camera->properties(); > bool addModel = true; >
Hi Kieran, On Mon, Jul 12, 2021 at 04:50:01PM +0100, Kieran Bingham wrote: > On 07/07/2021 03:19, Laurent Pinchart wrote: > > The CamApp::cameraName() doesn't need to access any member of the CamApp > > class. Make is static. While at is, drop an unneded const from the > > s/is/it/ > > /unneded/unneeded/ > > > return value. > > Hrm ... if this was the return value being const I would have expected > const std::string. > > Is this const supposed to be declaring the member function as const on > the class (not modifying the class) and perhaps misplaced? It's misplaced indeed (not according to the C++ standard, but according to our coding style), but qualifies the return value and should thus have come first. > Either-way, > > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > src/cam/main.cpp | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/src/cam/main.cpp b/src/cam/main.cpp > > index 19ed9837cf4f..03e62f305f24 100644 > > --- a/src/cam/main.cpp > > +++ b/src/cam/main.cpp > > @@ -44,7 +44,7 @@ private: > > int infoConfiguration(); > > int run(); > > > > - std::string const cameraName(const Camera *camera); > > + static std::string cameraName(const Camera *camera); > > > > static CamApp *app_; > > OptionsParser::Options options_; > > @@ -319,7 +319,7 @@ int CamApp::run() > > return 0; > > } > > > > -std::string const CamApp::cameraName(const Camera *camera) > > +std::string CamApp::cameraName(const Camera *camera) > > { > > const ControlList &props = camera->properties(); > > bool addModel = true;
diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 19ed9837cf4f..03e62f305f24 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -44,7 +44,7 @@ private: int infoConfiguration(); int run(); - std::string const cameraName(const Camera *camera); + static std::string cameraName(const Camera *camera); static CamApp *app_; OptionsParser::Options options_; @@ -319,7 +319,7 @@ int CamApp::run() return 0; } -std::string const CamApp::cameraName(const Camera *camera) +std::string CamApp::cameraName(const Camera *camera) { const ControlList &props = camera->properties(); bool addModel = true;
The CamApp::cameraName() doesn't need to access any member of the CamApp class. Make is static. While at is, drop an unneded const from the return value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/cam/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)