qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/5] misc: Enforce .[ch].inc extension for re-included .c/.h


From: Alex Bennée
Subject: Re: [PATCH 0/5] misc: Enforce .[ch].inc extension for re-included .c/.h files
Date: Tue, 06 Jun 2023 18:02:14 +0100
User-agent: mu4e 1.11.6; emacs 29.0.91

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Follow the convention to use the .inc extension for .c/.h files
> re-included, as docummented in Coding Style since commit 6a0057aa22:
>
>     If you do use template header files they should be named with
>     the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are
>     being included for expansion.
>
> Most of the codebase already uses this extension:
>
>   $ git ls-files | fgrep .inc | wc -l
>        155

Ahh prescient as I've just added this hack to the loc tool I'm using:

  modified   src/lib.rs
  @@ -338,7 +338,7 @@ pub fn lang_from_ext(filepath: &str) -> Lang {
           "at" => AmbientTalk,
           "awk" => Awk,
           "bat" | "btm" | "cmd" => Batch,
  -        "c" | "ec" | "pgc" => C,
  +        "c" | "ec" | "pgc" | "inc" => C,
           "cc" | "cpp" | "cxx" | "c++" | "pcc" => Cpp,
           "cfc" => ColdFusionScript,
           "cmake" => CMake,

while gathering loc stats for the project.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro



reply via email to

[Prev in Thread] Current Thread [Next in Thread]