From 626172a16bba9a601c7652569ce9410631c1e6c0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 8 May 2024 19:28:06 +0300 Subject: libcamera: Drop file name from header comment blocks Source files in libcamera start by a comment block header, which includes the file name and a one-line description of the file contents. While the latter is useful to get a quick overview of the file contents at a glance, the former is mostly a source of inconvenience. The name in the comments can easily get out of sync with the file name when files are renamed, and copy & paste during development have often lead to incorrect names being used to start with. Readers of the source code are expected to know which file they're looking it. Drop the file name from the header comment block. The change was generated with the following script: ---------------------------------------- dirs="include/libcamera src test utils" declare -rA patterns=( ['c']=' \* ' ['cpp']=' \* ' ['h']=' \* ' ['py']='# ' ['sh']='# ' ) for ext in ${!patterns[@]} ; do files=$(for dir in $dirs ; do find $dir -name "*.${ext}" ; done) pattern=${patterns[${ext}]} for file in $files ; do name=$(basename ${file}) sed -i "s/^\(${pattern}\)${name} - /\1/" "$file" done done ---------------------------------------- This misses several files that are out of sync with the comment block header. Those will be addressed separately and manually. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Scally --- src/apps/common/dng_writer.cpp | 2 +- src/apps/common/dng_writer.h | 2 +- src/apps/common/event_loop.cpp | 2 +- src/apps/common/event_loop.h | 2 +- src/apps/common/image.cpp | 2 +- src/apps/common/image.h | 2 +- src/apps/common/options.cpp | 2 +- src/apps/common/options.h | 2 +- src/apps/common/ppm_writer.cpp | 2 +- src/apps/common/ppm_writer.h | 2 +- src/apps/common/stream_options.cpp | 2 +- src/apps/common/stream_options.h | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/apps/common') diff --git a/src/apps/common/dng_writer.cpp b/src/apps/common/dng_writer.cpp index 82bc065a..59f1fa23 100644 --- a/src/apps/common/dng_writer.cpp +++ b/src/apps/common/dng_writer.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Raspberry Pi Ltd * - * dng_writer.cpp - DNG writer + * DNG writer */ #include "dng_writer.h" diff --git a/src/apps/common/dng_writer.h b/src/apps/common/dng_writer.h index 38f38f62..917713e6 100644 --- a/src/apps/common/dng_writer.h +++ b/src/apps/common/dng_writer.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Raspberry Pi Ltd * - * dng_writer.h - DNG writer + * DNG writer */ #pragma once diff --git a/src/apps/common/event_loop.cpp b/src/apps/common/event_loop.cpp index cb83845c..f7f9afa0 100644 --- a/src/apps/common/event_loop.cpp +++ b/src/apps/common/event_loop.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * event_loop.cpp - cam - Event loop + * cam - Event loop */ #include "event_loop.h" diff --git a/src/apps/common/event_loop.h b/src/apps/common/event_loop.h index ef79e8e5..ef129b9a 100644 --- a/src/apps/common/event_loop.h +++ b/src/apps/common/event_loop.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * event_loop.h - cam - Event loop + * cam - Event loop */ #pragma once diff --git a/src/apps/common/image.cpp b/src/apps/common/image.cpp index fe2cc6da..a2a0f58f 100644 --- a/src/apps/common/image.cpp +++ b/src/apps/common/image.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2021, Ideas on Board Oy * - * image.cpp - Multi-planar image with access to pixel data + * Multi-planar image with access to pixel data */ #include "image.h" diff --git a/src/apps/common/image.h b/src/apps/common/image.h index 7953b177..e47e446b 100644 --- a/src/apps/common/image.h +++ b/src/apps/common/image.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2021, Ideas on Board Oy * - * image.h - Multi-planar image with access to pixel data + * Multi-planar image with access to pixel data */ #pragma once diff --git a/src/apps/common/options.cpp b/src/apps/common/options.cpp index 4f7e8691..ab19aa3d 100644 --- a/src/apps/common/options.cpp +++ b/src/apps/common/options.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * options.cpp - cam - Options parsing + * cam - Options parsing */ #include diff --git a/src/apps/common/options.h b/src/apps/common/options.h index 4ddd4987..9771aa7a 100644 --- a/src/apps/common/options.h +++ b/src/apps/common/options.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * options.h - cam - Options parsing + * cam - Options parsing */ #pragma once diff --git a/src/apps/common/ppm_writer.cpp b/src/apps/common/ppm_writer.cpp index a8ccf67a..d6c8641d 100644 --- a/src/apps/common/ppm_writer.cpp +++ b/src/apps/common/ppm_writer.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2024 Red Hat, Inc. * - * ppm_writer.cpp - PPM writer + * PPM writer */ #include "ppm_writer.h" diff --git a/src/apps/common/ppm_writer.h b/src/apps/common/ppm_writer.h index 4c38f5ce..8c8d2e15 100644 --- a/src/apps/common/ppm_writer.h +++ b/src/apps/common/ppm_writer.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2024, Red Hat, Inc. * - * ppm_writer.h - PPM writer + * PPM writer */ #pragma once diff --git a/src/apps/common/stream_options.cpp b/src/apps/common/stream_options.cpp index 663b979a..99239e07 100644 --- a/src/apps/common/stream_options.cpp +++ b/src/apps/common/stream_options.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Raspberry Pi Ltd * - * stream_options.cpp - Helper to parse options for streams + * Helper to parse options for streams */ #include "stream_options.h" diff --git a/src/apps/common/stream_options.h b/src/apps/common/stream_options.h index a5f3bde0..a93f104c 100644 --- a/src/apps/common/stream_options.h +++ b/src/apps/common/stream_options.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2020, Raspberry Pi Ltd * - * stream_options.h - Helper to parse options for streams + * Helper to parse options for streams */ #pragma once -- cgit v1.2.1