Skip to contentSkip to conversation

include: Rename some expanded headers using '.h.inc' suffix

PATCH Superseded Philippe Mathieu-Daudé 1 participant 3 messages Apr 18, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover include: Rename some expanded headers using '.h.inc' suffix

Per our Coding Style:

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.

Rename elf_ops.h and host/load-extract/store-insert headers.

Philippe Mathieu-Daudé (2):
hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc accel/tcg: Rename load-extract/store-insert headers using .h.inc
suffix

 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 .../host/{store-insert-al16.h => store-insert-al16.h.inc}     | 0
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 .../host/{store-insert-al16.h => store-insert-al16.h.inc}     | 0
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 .../host/{store-insert-al16.h => store-insert-al16.h.inc}     | 0
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 include/hw/{elf_ops.h => elf_ops.h.inc}                       | 0
 bsd-user/elfload.c                                            | 2 +-
 hw/core/loader.c                                              | 4 ++--
 linux-user/elfload.c                                          | 2 +-
 accel/tcg/ldst_atomicity.c.inc                                | 4 ++--
 12 files changed, 6 insertions(+), 6 deletions(-)
 rename host/include/aarch64/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename host/include/aarch64/host/{store-insert-al16.h => store-insert-al16.h.inc} (100%)
 rename host/include/generic/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename host/include/generic/host/{store-insert-al16.h => store-insert-al16.h.inc} (100%)
 rename host/include/loongarch64/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename host/include/loongarch64/host/{store-insert-al16.h => store-insert-al16.h.inc} (100%)
 rename host/include/x86_64/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename include/hw/{elf_ops.h => elf_ops.h.inc} (100%)
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/2 hw/elf_ops: Rename elf_ops.h -> elf_ops.h.inc

Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.

Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented in the Coding Style:

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.

Therefore rename "hw/elf_ops.h" as "hw/elf_ops.h.inc".

---
 include/hw/{elf_ops.h => elf_ops.h.inc} | 0
 bsd-user/elfload.c                      | 2 +-
 hw/core/loader.c                        | 4 ++--
 linux-user/elfload.c                    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename include/hw/{elf_ops.h => elf_ops.h.inc} (100%)
include/hw/elf_ops.h.inc renamed from include/hw/elf_ops.h +0 -0
similarity index 100%
rename from include/hw/elf_ops.h
rename to include/hw/elf_ops.h.inc
bsd-user/elfload.c +1 -1
index baf2f63d2f..833fa3bd05 100644
@@ -383,7 +383,7 @@ static const char *lookup_symbolxx(struct syminfo *s, uint64_t orig_addr)
     return "";
 }
 
-/* FIXME: This should use elf_ops.h  */
+/* FIXME: This should use elf_ops.h.inc  */
 static int symcmp(const void *s0, const void *s1)
 {
     struct elf_sym *sym0 = (struct elf_sym *)s0;
hw/core/loader.c +2 -2
index b8e52f3fb0..2f8105d7de 100644
@@ -305,7 +305,7 @@ static void *load_at(int fd, off_t offset, size_t size)
 #define elf_word        uint32_t
 #define elf_sword       int32_t
 #define bswapSZs        bswap32s
-#include "hw/elf_ops.h"
+#include "hw/elf_ops.h.inc"
 
 #undef elfhdr
 #undef elf_phdr
@@ -327,7 +327,7 @@ static void *load_at(int fd, off_t offset, size_t size)
 #define elf_sword       int64_t
 #define bswapSZs        bswap64s
 #define SZ              64
-#include "hw/elf_ops.h"
+#include "hw/elf_ops.h.inc"
 
 const char *load_elf_strerror(ssize_t error)
 {
linux-user/elfload.c +1 -1
index 28d9e8a9a5..fc60c01d57 100644
@@ -3672,7 +3672,7 @@ static const char *lookup_symbolxx(struct syminfo *s, uint64_t orig_addr)
     return "";
 }
 
-/* FIXME: This should use elf_ops.h  */
+/* FIXME: This should use elf_ops.h.inc  */
 static int symcmp(const void *s0, const void *s1)
 {
     struct elf_sym *sym0 = (struct elf_sym *)s0;
Signature · 1 line
2.41.0
#2 lore raw

PATCH 2/2 accel/tcg: Rename load-extract/store-insert headers using .h.inc suffix

In reply to Philippe Mathieu-Daudé

Since commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.

Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented in the Coding Style:

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.

Therefore rename 'store-insert-al16.h' as 'store-insert-al16.h.inc' and 'load-extract-al16-al8.h' as 'load-extract-al16-al8.h.inc'.

---
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 .../host/{store-insert-al16.h => store-insert-al16.h.inc}     | 0
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 .../host/{store-insert-al16.h => store-insert-al16.h.inc}     | 0
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 .../host/{store-insert-al16.h => store-insert-al16.h.inc}     | 0
 .../{load-extract-al16-al8.h => load-extract-al16-al8.h.inc}  | 0
 accel/tcg/ldst_atomicity.c.inc                                | 4 ++--
 8 files changed, 2 insertions(+), 2 deletions(-)
 rename host/include/aarch64/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename host/include/aarch64/host/{store-insert-al16.h => store-insert-al16.h.inc} (100%)
 rename host/include/generic/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename host/include/generic/host/{store-insert-al16.h => store-insert-al16.h.inc} (100%)
 rename host/include/loongarch64/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
 rename host/include/loongarch64/host/{store-insert-al16.h => store-insert-al16.h.inc} (100%)
 rename host/include/x86_64/host/{load-extract-al16-al8.h => load-extract-al16-al8.h.inc} (100%)
host/include/aarch64/host/load-extract-al16-al8.h.inc renamed from host/include/aarch64/host/load-extract-al16-al8.h +0 -0
similarity index 100%
rename from host/include/aarch64/host/load-extract-al16-al8.h
rename to host/include/aarch64/host/load-extract-al16-al8.h.inc
host/include/aarch64/host/store-insert-al16.h.inc renamed from host/include/aarch64/host/store-insert-al16.h +0 -0
similarity index 100%
rename from host/include/aarch64/host/store-insert-al16.h
rename to host/include/aarch64/host/store-insert-al16.h.inc
host/include/generic/host/load-extract-al16-al8.h.inc renamed from host/include/generic/host/load-extract-al16-al8.h +0 -0
similarity index 100%
rename from host/include/generic/host/load-extract-al16-al8.h
rename to host/include/generic/host/load-extract-al16-al8.h.inc
host/include/generic/host/store-insert-al16.h.inc renamed from host/include/generic/host/store-insert-al16.h +0 -0
similarity index 100%
rename from host/include/generic/host/store-insert-al16.h
rename to host/include/generic/host/store-insert-al16.h.inc
host/include/loongarch64/host/load-extract-al16-al8.h.inc renamed from host/include/loongarch64/host/load-extract-al16-al8.h +0 -0
similarity index 100%
rename from host/include/loongarch64/host/load-extract-al16-al8.h
rename to host/include/loongarch64/host/load-extract-al16-al8.h.inc
host/include/loongarch64/host/store-insert-al16.h.inc renamed from host/include/loongarch64/host/store-insert-al16.h +0 -0
similarity index 100%
rename from host/include/loongarch64/host/store-insert-al16.h
rename to host/include/loongarch64/host/store-insert-al16.h.inc
host/include/x86_64/host/load-extract-al16-al8.h.inc renamed from host/include/x86_64/host/load-extract-al16-al8.h +0 -0
similarity index 100%
rename from host/include/x86_64/host/load-extract-al16-al8.h
rename to host/include/x86_64/host/load-extract-al16-al8.h.inc
accel/tcg/ldst_atomicity.c.inc +2 -2
index 97dae70d53..134da3c1da 100644
@@ -9,8 +9,8 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include "host/load-extract-al16-al8.h"
-#include "host/store-insert-al16.h"
+#include "host/load-extract-al16-al8.h.inc"
+#include "host/store-insert-al16.h.inc"
 
 #ifdef CONFIG_ATOMIC64
 # define HAVE_al8          true
Signature · 1 line
2.41.0