[libcamera-devel] libcamera: log: Fix miscellaneous coding style issues

Message ID 20181210220330.20774-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit ad8934db5b29810003a9a66b9c3a49f559ebff15
Headers show
Series
  • [libcamera-devel] libcamera: log: Fix miscellaneous coding style issues
Related show

Commit Message

Laurent Pinchart Dec. 10, 2018, 10:03 p.m. UTC
Those issues were pointed out during review.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/include/log.h | 2 +-
 src/libcamera/log.cpp       | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Jacopo Mondi Dec. 11, 2018, 8:14 a.m. UTC | #1
Hi Laurent,
   thanks

On Tue, Dec 11, 2018 at 12:03:30AM +0200, Laurent Pinchart wrote:
> Those issues were pointed out during review.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Acked-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

> ---
>  src/libcamera/include/log.h | 2 +-
>  src/libcamera/log.cpp       | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/libcamera/include/log.h b/src/libcamera/include/log.h
> index 76acd1520868..41f8a756bf0c 100644
> --- a/src/libcamera/include/log.h
> +++ b/src/libcamera/include/log.h
> @@ -33,6 +33,6 @@ private:
>
>  #define LOG(severity) LogMessage(__FILE__, __LINE__, Log##severity).stream()
>
> -};
> +} /* namespace libcamera */
>
>  #endif /* __LIBCAMERA_LOG_H__ */
> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
> index 18ccfa32d8b4..2a3824972c9a 100644
> --- a/src/libcamera/log.cpp
> +++ b/src/libcamera/log.cpp
> @@ -2,7 +2,7 @@
>  /*
>   * Copyright (C) 2018, Google Inc.
>   *
> - * log.h - Logging infrastructure
> + * log.cpp - Logging infrastructure
>   */
>
>  #include <cstdio>
> @@ -14,7 +14,7 @@
>  #include "utils.h"
>
>  /**
> - * \file log.h
> + * \file log.cpp
>   * \brief Logging infrastructure
>   */
>
> @@ -48,7 +48,7 @@ static const char *log_severity_name(LogSeverity severity)
>  		" ERR",
>  	};
>
> -	if ((unsigned int)severity < ARRAY_SIZE(names))
> +	if (static_cast<unsigned int>(severity) < ARRAY_SIZE(names))
>  		return names[severity];
>  	else
>  		return "UNKN";
> @@ -78,4 +78,4 @@ LogMessage::~LogMessage()
>  	fflush(stderr);
>  }
>
> -};
> +} /* namespace libcamera */
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/include/log.h b/src/libcamera/include/log.h
index 76acd1520868..41f8a756bf0c 100644
--- a/src/libcamera/include/log.h
+++ b/src/libcamera/include/log.h
@@ -33,6 +33,6 @@  private:
 
 #define LOG(severity) LogMessage(__FILE__, __LINE__, Log##severity).stream()
 
-};
+} /* namespace libcamera */
 
 #endif /* __LIBCAMERA_LOG_H__ */
diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index 18ccfa32d8b4..2a3824972c9a 100644
--- a/src/libcamera/log.cpp
+++ b/src/libcamera/log.cpp
@@ -2,7 +2,7 @@ 
 /*
  * Copyright (C) 2018, Google Inc.
  *
- * log.h - Logging infrastructure
+ * log.cpp - Logging infrastructure
  */
 
 #include <cstdio>
@@ -14,7 +14,7 @@ 
 #include "utils.h"
 
 /**
- * \file log.h
+ * \file log.cpp
  * \brief Logging infrastructure
  */
 
@@ -48,7 +48,7 @@  static const char *log_severity_name(LogSeverity severity)
 		" ERR",
 	};
 
-	if ((unsigned int)severity < ARRAY_SIZE(names))
+	if (static_cast<unsigned int>(severity) < ARRAY_SIZE(names))
 		return names[severity];
 	else
 		return "UNKN";
@@ -78,4 +78,4 @@  LogMessage::~LogMessage()
 	fflush(stderr);
 }
 
-};
+} /* namespace libcamera */