[libcamera-devel,RFC,2/6] cam: Remove using namespace in stream_options.h
diff mbox series

Message ID 20211005073114.3997303-3-hiroh@chromium.org
State Accepted
Headers show
Series
  • Remove using namespace in header files
Related show

Commit Message

Hirokazu Honda Oct. 5, 2021, 7:31 a.m. UTC
"using namespace" in a header file propagates the namespace to
the files including the header file. So it should be avoided.
This removes "using namespace" in stream_options.h

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/cam/stream_options.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart Oct. 5, 2021, 9:40 a.m. UTC | #1
Hi Hiro,

Thank you for the patch.

On Tue, Oct 05, 2021 at 04:31:10PM +0900, Hirokazu Honda wrote:
> "using namespace" in a header file propagates the namespace to
> the files including the header file. So it should be avoided.
> This removes "using namespace" in stream_options.h
> 
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/cam/stream_options.h | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/src/cam/stream_options.h b/src/cam/stream_options.h
> index 577391f0..fbbc13a3 100644
> --- a/src/cam/stream_options.h
> +++ b/src/cam/stream_options.h
> @@ -11,8 +11,6 @@
>  
>  #include "options.h"
>  
> -using namespace libcamera;
> -
>  class StreamKeyValueParser : public KeyValueParser
>  {
>  public:
> @@ -20,12 +18,12 @@ public:
>  
>  	KeyValueParser::Options parse(const char *arguments) override;
>  
> -	static StreamRoles roles(const OptionValue &values);
> -	static int updateConfiguration(CameraConfiguration *config,
> +	static libcamera::StreamRoles roles(const OptionValue &values);
> +	static int updateConfiguration(libcamera::CameraConfiguration *config,
>  				       const OptionValue &values);
>  
>  private:
> -	static bool parseRole(StreamRole *role,
> +	static bool parseRole(libcamera::StreamRole *role,
>  			      const KeyValueParser::Options &options);
>  };
>

Patch
diff mbox series

diff --git a/src/cam/stream_options.h b/src/cam/stream_options.h
index 577391f0..fbbc13a3 100644
--- a/src/cam/stream_options.h
+++ b/src/cam/stream_options.h
@@ -11,8 +11,6 @@ 
 
 #include "options.h"
 
-using namespace libcamera;
-
 class StreamKeyValueParser : public KeyValueParser
 {
 public:
@@ -20,12 +18,12 @@  public:
 
 	KeyValueParser::Options parse(const char *arguments) override;
 
-	static StreamRoles roles(const OptionValue &values);
-	static int updateConfiguration(CameraConfiguration *config,
+	static libcamera::StreamRoles roles(const OptionValue &values);
+	static int updateConfiguration(libcamera::CameraConfiguration *config,
 				       const OptionValue &values);
 
 private:
-	static bool parseRole(StreamRole *role,
+	static bool parseRole(libcamera::StreamRole *role,
 			      const KeyValueParser::Options &options);
 };