From 52581c718c5cd55595ca032a56f1e194c5716456 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 6 May 2022 15:49:08 +0200 Subject: Clean up header guards that don't match their file name Header guard symbols should match their file name to make guard collisions less likely. Cleaned up with scripts/clean-header-guards.pl, followed by some renaming of new guard symbols picked by the script to better ones. Signed-off-by: Markus Armbruster Message-Id: <20220506134911.2856099-2-armbru@redhat.com> Reviewed-by: Richard Henderson [Change to generated file ebpf/rss.bpf.skeleton.h backed out] --- include/qemu/help-texts.h | 4 ++-- include/qemu/qemu-plugin.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/help-texts.h b/include/qemu/help-texts.h index ba32cc8..4f265fe 100644 --- a/include/qemu/help-texts.h +++ b/include/qemu/help-texts.h @@ -1,5 +1,5 @@ -#ifndef QEMU_COMMON_H -#define QEMU_COMMON_H +#ifndef QEMU_HELP_TEXTS_H +#define QEMU_HELP_TEXTS_H /* Copyright string for -version arguments, About dialogs, etc */ #define QEMU_COPYRIGHT "Copyright (c) 2003-2022 " \ diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 535ddbf..d0e9d03 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -7,8 +7,9 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef QEMU_PLUGIN_API_H -#define QEMU_PLUGIN_API_H + +#ifndef QEMU_QEMU_PLUGIN_H +#define QEMU_QEMU_PLUGIN_H #include #include @@ -624,4 +625,4 @@ uint64_t qemu_plugin_end_code(void); */ uint64_t qemu_plugin_entry_code(void); -#endif /* QEMU_PLUGIN_API_H */ +#endif /* QEMU_QEMU_PLUGIN_H */ -- cgit v1.1 From 9c0928045ce4b97fc59cb285b7a4b559d21e5da0 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 6 May 2022 15:49:09 +0200 Subject: Clean up ill-advised or unusual header guards Leading underscores are ill-advised because such identifiers are reserved. Trailing underscores are merely ugly. Strip both. Our header guards commonly end in _H. Normalize the exceptions. Macros should be ALL_CAPS. Normalize the exception. Done with scripts/clean-header-guards.pl. include/hw/xen/interface/ and tools/virtiofsd/ left alone, because these were imported from Xen and libfuse respectively. Signed-off-by: Markus Armbruster Message-Id: <20220506134911.2856099-3-armbru@redhat.com> Reviewed-by: Richard Henderson --- include/qemu/cpu-float.h | 6 +++--- include/qemu/crc-ccitt.h | 6 +++--- include/qemu/keyval.h | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/cpu-float.h b/include/qemu/cpu-float.h index 9110994..a26b9fa 100644 --- a/include/qemu/cpu-float.h +++ b/include/qemu/cpu-float.h @@ -1,5 +1,5 @@ -#ifndef QEMU_CPU_FLOAT_H_ -#define QEMU_CPU_FLOAT_H_ +#ifndef QEMU_CPU_FLOAT_H +#define QEMU_CPU_FLOAT_H #include "fpu/softfloat-types.h" @@ -61,4 +61,4 @@ typedef union { #endif } CPU_QuadU; -#endif /* QEMU_CPU_FLOAT_H_ */ +#endif /* QEMU_CPU_FLOAT_H */ diff --git a/include/qemu/crc-ccitt.h b/include/qemu/crc-ccitt.h index 06ee55b..d6eb491 100644 --- a/include/qemu/crc-ccitt.h +++ b/include/qemu/crc-ccitt.h @@ -11,8 +11,8 @@ * SPDX-License-Identifier: GPL-2.0 */ -#ifndef _CRC_CCITT_H -#define _CRC_CCITT_H +#ifndef CRC_CCITT_H +#define CRC_CCITT_H extern uint16_t const crc_ccitt_table[256]; extern uint16_t const crc_ccitt_false_table[256]; @@ -30,4 +30,4 @@ static inline uint16_t crc_ccitt_false_byte(uint16_t crc, const uint8_t c) return (crc << 8) ^ crc_ccitt_false_table[(crc >> 8) ^ c]; } -#endif /* _CRC_CCITT_H */ +#endif /* CRC_CCITT_H */ diff --git a/include/qemu/keyval.h b/include/qemu/keyval.h index 2d26328..1187b68 100644 --- a/include/qemu/keyval.h +++ b/include/qemu/keyval.h @@ -2,8 +2,9 @@ * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#ifndef KEYVAL_H_ -#define KEYVAL_H_ + +#ifndef KEYVAL_H +#define KEYVAL_H QDict *keyval_parse_into(QDict *qdict, const char *params, const char *implied_key, bool *p_help, Error **errp); @@ -11,4 +12,4 @@ QDict *keyval_parse(const char *params, const char *implied_key, bool *help, Error **errp); void keyval_merge(QDict *old, const QDict *new, Error **errp); -#endif /* KEYVAL_H_ */ +#endif /* KEYVAL_H */ -- cgit v1.1 From ea9cea93c69d508a333dd1b0cb1a44f6daf80b63 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 6 May 2022 15:49:11 +0200 Subject: Clean up decorations and whitespace around header guards Cleaned up with scripts/clean-header-guards.pl. Signed-off-by: Markus Armbruster Message-Id: <20220506134911.2856099-5-armbru@redhat.com> Reviewed-by: Richard Henderson --- include/qemu/plugin-memory.h | 2 +- include/qemu/selfmap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/qemu') diff --git a/include/qemu/plugin-memory.h b/include/qemu/plugin-memory.h index 0f59226..8ad13c1 100644 --- a/include/qemu/plugin-memory.h +++ b/include/qemu/plugin-memory.h @@ -37,4 +37,4 @@ struct qemu_plugin_hwaddr { bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx, bool is_store, struct qemu_plugin_hwaddr *data); -#endif /* _PLUGIN_MEMORY_H_ */ +#endif /* PLUGIN_MEMORY_H */ diff --git a/include/qemu/selfmap.h b/include/qemu/selfmap.h index 80cf920..3479a2a 100644 --- a/include/qemu/selfmap.h +++ b/include/qemu/selfmap.h @@ -41,4 +41,4 @@ GSList *read_self_maps(void); */ void free_self_maps(GSList *info); -#endif /* _SELFMAP_H_ */ +#endif /* SELFMAP_H */ -- cgit v1.1