From 7a3c343cb89327bee581c48ee5c9f6f30b9f3deb Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 30 Aug 2018 03:38:28 +0900 Subject: [PATCH] tree-wide: use '#pragma once' for header guard Follow-up for a2b635eb3940f33f5dd308d85ba416f0630d152b (#9959). --- src/basic/MurmurHash2.h | 5 +---- src/basic/securebits.h | 5 +---- src/basic/sparse-endian.h | 5 +---- src/boot/efi/console.h | 5 +---- src/boot/efi/disk.h | 5 +---- src/boot/efi/graphics.h | 5 +---- src/boot/efi/linux.h | 5 +---- src/boot/efi/measure.h | 5 +---- src/boot/efi/pe.h | 5 +---- src/boot/efi/shim.h | 6 +----- src/boot/efi/splash.h | 5 +---- src/boot/efi/util.h | 6 +----- src/journal/fsprg.h | 6 +----- src/shared/initreq.h | 5 +---- 14 files changed, 14 insertions(+), 59 deletions(-) diff --git a/src/basic/MurmurHash2.h b/src/basic/MurmurHash2.h index 6104b4fbe6..1aef3afba0 100644 --- a/src/basic/MurmurHash2.h +++ b/src/basic/MurmurHash2.h @@ -2,8 +2,7 @@ // MurmurHash2 was written by Austin Appleby, and is placed in the public // domain. The author hereby disclaims copyright to this source code. -#ifndef _MURMURHASH2_H_ -#define _MURMURHASH2_H_ +#pragma once //----------------------------------------------------------------------------- // Platform-specific functions and macros @@ -29,5 +28,3 @@ typedef unsigned __int64 uint64_t; uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed ); //----------------------------------------------------------------------------- - -#endif // _MURMURHASH2_H_ diff --git a/src/basic/securebits.h b/src/basic/securebits.h index 98fbe0d433..e3b7538b0c 100644 --- a/src/basic/securebits.h +++ b/src/basic/securebits.h @@ -1,5 +1,4 @@ -#ifndef _LINUX_SECUREBITS_H -#define _LINUX_SECUREBITS_H 1 +#pragma once /* This is minimal version of Linux' linux/securebits.h header file, * which is licensed GPL2 */ @@ -41,5 +40,3 @@ issecure_mask(SECURE_NO_SETUID_FIXUP) | \ issecure_mask(SECURE_KEEP_CAPS)) #define SECURE_ALL_LOCKS (SECURE_ALL_BITS << 1) - -#endif /* !_LINUX_SECUREBITS_H */ diff --git a/src/basic/sparse-endian.h b/src/basic/sparse-endian.h index 5e59de5437..8540ccd0ba 100644 --- a/src/basic/sparse-endian.h +++ b/src/basic/sparse-endian.h @@ -20,8 +20,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -#ifndef SPARSE_ENDIAN_H -#define SPARSE_ENDIAN_H +#pragma once #include #include @@ -89,5 +88,3 @@ static inline uint64_t be64toh(be64_t value) { return bswap_64_on_le((uint64_t _ #undef __sd_bitwise #undef __sd_force - -#endif /* SPARSE_ENDIAN_H */ diff --git a/src/boot/efi/console.h b/src/boot/efi/console.h index 3643d3dec4..10c5ce4ebd 100644 --- a/src/boot/efi/console.h +++ b/src/boot/efi/console.h @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __SDBOOT_CONSOLE_H -#define __SDBOOT_CONSOLE_H +#pragma once #define EFI_SHIFT_STATE_VALID 0x80000000 #define EFI_RIGHT_CONTROL_PRESSED 0x00000004 @@ -24,4 +22,3 @@ enum console_mode_change_type { EFI_STATUS console_key_read(UINT64 *key, BOOLEAN wait); EFI_STATUS console_set_mode(UINTN *mode, enum console_mode_change_type how); -#endif diff --git a/src/boot/efi/disk.h b/src/boot/efi/disk.h index dfd9200ae1..2a0b8ff2a7 100644 --- a/src/boot/efi/disk.h +++ b/src/boot/efi/disk.h @@ -1,7 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __SDBOOT_DISK_H -#define __SDBOOT_DISK_H +#pragma once EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[37]); -#endif diff --git a/src/boot/efi/graphics.h b/src/boot/efi/graphics.h index 56a3ebdd9d..809e878d16 100644 --- a/src/boot/efi/graphics.h +++ b/src/boot/efi/graphics.h @@ -3,9 +3,6 @@ * Copyright © 2013 Intel Corporation * Authored by Joonas Lahtinen */ - -#ifndef __SDBOOT_GRAPHICS_H -#define __SDBOOT_GRAPHICS_H +#pragma once EFI_STATUS graphics_mode(BOOLEAN on); -#endif diff --git a/src/boot/efi/linux.h b/src/boot/efi/linux.h index 54140a2207..2458a2fbd0 100644 --- a/src/boot/efi/linux.h +++ b/src/boot/efi/linux.h @@ -1,10 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __SDBOOT_kernel_H -#define __SDBOOT_kernel_H +#pragma once EFI_STATUS linux_exec(EFI_HANDLE *image, CHAR8 *cmdline, UINTN cmdline_size, UINTN linux_addr, UINTN initrd_addr, UINTN initrd_size, BOOLEAN secure); -#endif diff --git a/src/boot/efi/measure.h b/src/boot/efi/measure.h index e04ee127a3..ebb6406eca 100644 --- a/src/boot/efi/measure.h +++ b/src/boot/efi/measure.h @@ -1,7 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef __SDBOOT_MEASURE_H -#define __SDBOOT_MEASURE_H +#pragma once EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UINTN buffer_size, const CHAR16 *description); - -#endif diff --git a/src/boot/efi/pe.h b/src/boot/efi/pe.h index d3fc8ecf6b..bfbb8d9baf 100644 --- a/src/boot/efi/pe.h +++ b/src/boot/efi/pe.h @@ -1,10 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __SDBOOT_PEFILE_H -#define __SDBOOT_PEFILE_H +#pragma once EFI_STATUS pe_memory_locate_sections(CHAR8 *base, CHAR8 **sections, UINTN *addrs, UINTN *offsets, UINTN *sizes); EFI_STATUS pe_file_locate_sections(EFI_FILE *dir, CHAR16 *path, CHAR8 **sections, UINTN *addrs, UINTN *offsets, UINTN *sizes); -#endif diff --git a/src/boot/efi/shim.h b/src/boot/efi/shim.h index c847ae97a4..6b3b78c175 100644 --- a/src/boot/efi/shim.h +++ b/src/boot/efi/shim.h @@ -7,9 +7,7 @@ * Copyright © 2012 * https://github.com/mjg59/efitools */ - -#ifndef __SDBOOT_SHIM_H -#define __SDBOOT_SHIM_H +#pragma once BOOLEAN shim_loaded(void); @@ -18,5 +16,3 @@ BOOLEAN secure_boot_enabled(void); EFI_STATUS security_policy_install(void); EFI_STATUS security_policy_uninstall(void); - -#endif diff --git a/src/boot/efi/splash.h b/src/boot/efi/splash.h index f194a33aec..8928b069a2 100644 --- a/src/boot/efi/splash.h +++ b/src/boot/efi/splash.h @@ -1,7 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __SDBOOT_SPLASH_H -#define __SDBOOT_SPLASH_H +#pragma once EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background); -#endif diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index 3baec8cd41..8a3e0520fc 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __SDBOOT_UTIL_H -#define __SDBOOT_UTIL_H +#pragma once #include #include @@ -39,5 +37,3 @@ static inline void FreePoolp(void *p) { #define _cleanup_(x) __attribute__((cleanup(x))) #define _cleanup_freepool_ _cleanup_(FreePoolp) - -#endif diff --git a/src/journal/fsprg.h b/src/journal/fsprg.h index fc95b3be7c..33412675b8 100644 --- a/src/journal/fsprg.h +++ b/src/journal/fsprg.h @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ - -#ifndef __fsprgh__ -#define __fsprgh__ +#pragma once /* * fsprg v0.1 - (seekable) forward-secure pseudorandom generator @@ -62,5 +60,3 @@ void FSPRG_GetKey(const void *state, void *key, size_t keylen, uint32_t idx); #ifdef __cplusplus } #endif - -#endif diff --git a/src/shared/initreq.h b/src/shared/initreq.h index e3ab3032cb..1d7ff81df1 100644 --- a/src/shared/initreq.h +++ b/src/shared/initreq.h @@ -11,8 +11,7 @@ * Version: @(#)initreq.h 1.28 31-Mar-2004 MvS */ -#ifndef _INITREQ_H -#define _INITREQ_H +#pragma once #include @@ -72,5 +71,3 @@ struct init_request { char data[368]; } i; }; - -#endif