[PATCH v2 4/5] libcamera: base: Fix formatting in thread.cpp

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Feb 24 20:59:59 CET 2025


Hi Milan,

Thank you for the patch.

On Mon, Feb 24, 2025 at 07:52:34PM +0100, Milan Zamazal wrote:
> Let's make the autoformatter happy with thread.cpp formatting.
> 
> Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
> ---
>  src/libcamera/base/thread.cpp | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/libcamera/base/thread.cpp b/src/libcamera/base/thread.cpp
> index 319bfda9..02128f23 100644
> --- a/src/libcamera/base/thread.cpp
> +++ b/src/libcamera/base/thread.cpp
> @@ -5,8 +5,6 @@
>   * Thread support
>   */
>  
> -#include <libcamera/base/thread.h>
> -

This is done on purpose, see Documentation/coding-style.rst:

  For .cpp files, if the file implements an API declared in a header
  file, that header file shall be included first in order to ensure it
  is self-contained.

>  #include <atomic>
>  #include <list>
>  #include <optional>
> @@ -20,6 +18,7 @@
>  #include <libcamera/base/message.h>
>  #include <libcamera/base/mutex.h>
>  #include <libcamera/base/object.h>
> +#include <libcamera/base/thread.h>
>  
>  /**
>   * \page thread Thread Support
> @@ -657,7 +656,7 @@ void Thread::dispatchMessages(Message::Type type)
>  	 * the outer calls.
>  	 */
>  	if (!--data_->messages_.recursion_) {
> -		for (auto iter = messages.begin(); iter != messages.end(); ) {
> +		for (auto iter = messages.begin(); iter != messages.end();) {

Hmmmm... I thought we standardized on the style with a space, but we
have 6 occurrences with a space, and 15 without. Among those 15, 10 are
in the software ISP though :-)

I find the space more readable, but if there's no way to make
clang-format happy about it, I'm OK dropping it.

>  			if (!*iter)
>  				iter = messages.erase(iter);
>  			else

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list