From 25c86bc1e7b02c2b58987e6f2bdbc25a9efb3e41 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 13 Oct 2026 11:20:19 +0200 Subject: [PATCH] Remove leading double underscores from header include guards --- AGENTS.md | 2 +- cmdline/app.h | 4 ++-- cmdline/bw.h | 4 ++-- cmdline/elem.h | 4 ++-- cmdline/handle.h | 4 ++-- cmdline/import.h | 4 ++-- cmdline/io.h | 4 ++-- cmdline/locate.h | 4 ++-- cmdline/memory.h | 4 ++-- cmdline/parity.h | 4 ++-- cmdline/search.h | 4 ++-- cmdline/snapraid.h | 4 ++-- cmdline/state.h | 4 ++-- cmdline/str.h | 4 ++-- cmdline/stream.h | 4 ++-- cmdline/support.h | 4 ++-- cmdline/thermal.h | 4 ++-- cmdline/util.h | 4 ++-- raid/combo.h | 4 ++-- raid/cpu.h | 4 ++-- raid/gf.h | 4 ++-- raid/helper.h | 4 ++-- raid/internal.h | 4 ++-- raid/memory.h | 4 ++-- raid/raid.h | 4 ++-- raid/test.h | 4 ++-- 26 files changed, 51 insertions(+), 51 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b0d4244e..bc96d77a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -107,7 +107,7 @@ SnapRAID is designed to recover from an interruption, including `SIGKILL`, at an - **Indentation**: Tabs for indentation, no alignment (existing codebase style) - **Comments**: Use `/** ... */` for multiline top comments preceding declarations and `/* ... */` for multiline comments within code. Use `/* first letter lowercase */` for single-line inline notes. - **Critical Comments**: Always add a comment at non-obvious critical points, especially around data-integrity invariants, crash recovery, fallback behavior, concurrency, and fatal versus best-effort error handling. Explain why the logic is required, not merely what the code does. -- **Headers**: All `.h` files have include guards (`#ifndef __NAME_H`) +- **Headers**: All `.h` files have include guards (`#ifndef NAME_H`) - **Preferences**: Use 0 instead of NULL and '\0' - **Preferences**: Use prefix ++variable and --variable instead of postfix variable++ and variable-- where both are equivalent - **Safety Checks**: Avoid adding safety checks for conditions that never happen diff --git a/cmdline/app.h b/cmdline/app.h index 4c3ceda2..69a2cdf4 100644 --- a/cmdline/app.h +++ b/cmdline/app.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2026 Andrea Mazzoleni -#ifndef __APP_H -#define __APP_H +#ifndef APP_H +#define APP_H #include "os/os.h" diff --git a/cmdline/bw.h b/cmdline/bw.h index 9ba69e12..482202a5 100644 --- a/cmdline/bw.h +++ b/cmdline/bw.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2016 Andrea Mazzoleni -#ifndef __BW_H -#define __BW_H +#ifndef BW_H +#define BW_H #include "state.h" #include "support.h" diff --git a/cmdline/elem.h b/cmdline/elem.h index fc253c14..85edbf05 100644 --- a/cmdline/elem.h +++ b/cmdline/elem.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __ELEM_H -#define __ELEM_H +#ifndef ELEM_H +#define ELEM_H #include "util.h" #include "support.h" diff --git a/cmdline/handle.h b/cmdline/handle.h index f117f6b8..757c939d 100644 --- a/cmdline/handle.h +++ b/cmdline/handle.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __HANDLE_H -#define __HANDLE_H +#ifndef HANDLE_H +#define HANDLE_H #include "state.h" #include "support.h" diff --git a/cmdline/import.h b/cmdline/import.h index 8aef9b0d..4676063f 100644 --- a/cmdline/import.h +++ b/cmdline/import.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __IMPORT_H -#define __IMPORT_H +#ifndef IMPORT_H +#define IMPORT_H #include "elem.h" #include "state.h" diff --git a/cmdline/io.h b/cmdline/io.h index df535946..92f4861b 100644 --- a/cmdline/io.h +++ b/cmdline/io.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2016 Andrea Mazzoleni -#ifndef __IO_H -#define __IO_H +#ifndef IO_H +#define IO_H #include "state.h" #include "support.h" diff --git a/cmdline/locate.h b/cmdline/locate.h index 57162559..dc3a6cf9 100644 --- a/cmdline/locate.h +++ b/cmdline/locate.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2026 Andrea Mazzoleni -#ifndef __LOCATE_H -#define __LOCATE_H +#ifndef LOCATE_H +#define LOCATE_H /****************************************************************************/ /* snapraid */ diff --git a/cmdline/memory.h b/cmdline/memory.h index ef3e187a..88e6e278 100644 --- a/cmdline/memory.h +++ b/cmdline/memory.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __MEMORY_H -#define __MEMORY_H +#ifndef MEMORY_H +#define MEMORY_H /****************************************************************************/ /* memory */ diff --git a/cmdline/parity.h b/cmdline/parity.h index dab95dd7..91140492 100644 --- a/cmdline/parity.h +++ b/cmdline/parity.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __PARITY_H -#define __PARITY_H +#ifndef PARITY_H +#define PARITY_H #include "support.h" #include "bw.h" diff --git a/cmdline/search.h b/cmdline/search.h index 55c8fef3..dc84747e 100644 --- a/cmdline/search.h +++ b/cmdline/search.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2014 Andrea Mazzoleni -#ifndef __SEARCH_H -#define __SEARCH_H +#ifndef SEARCH_H +#define SEARCH_H #include "elem.h" #include "state.h" diff --git a/cmdline/snapraid.h b/cmdline/snapraid.h index 3bff83ec..2b2c9eb4 100644 --- a/cmdline/snapraid.h +++ b/cmdline/snapraid.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __SNAPRAID_H -#define __SNAPRAID_H +#ifndef SNAPRAID_H +#define SNAPRAID_H /****************************************************************************/ /* snapraid */ diff --git a/cmdline/state.h b/cmdline/state.h index f9eb37ce..31215e86 100644 --- a/cmdline/state.h +++ b/cmdline/state.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __STATE_H -#define __STATE_H +#ifndef STATE_H +#define STATE_H #include "elem.h" diff --git a/cmdline/str.h b/cmdline/str.h index bbc4f072..976ae435 100644 --- a/cmdline/str.h +++ b/cmdline/str.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2025 Andrea Mazzoleni -#ifndef __STR_H -#define __STR_H +#ifndef STR_H +#define STR_H #include "app.h" #include "str.h" diff --git a/cmdline/stream.h b/cmdline/stream.h index 08377adc..b39b98c0 100644 --- a/cmdline/stream.h +++ b/cmdline/stream.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __STREAM_H -#define __STREAM_H +#ifndef STREAM_H +#define STREAM_H #include "support.h" #include "util.h" diff --git a/cmdline/support.h b/cmdline/support.h index 34f945b0..ec05ed9e 100644 --- a/cmdline/support.h +++ b/cmdline/support.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __SUPPORT_H -#define __SUPPORT_H +#ifndef SUPPORT_H +#define SUPPORT_H #include "app.h" #include "memory.h" diff --git a/cmdline/thermal.h b/cmdline/thermal.h index 5e23ddb3..5ae21587 100644 --- a/cmdline/thermal.h +++ b/cmdline/thermal.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2025 Andrea Mazzoleni -#ifndef __THERMAL_H -#define __THERMAL_H +#ifndef THERMAL_H +#define THERMAL_H #include "elem.h" diff --git a/cmdline/util.h b/cmdline/util.h index c3f282a7..b9b4f25e 100644 --- a/cmdline/util.h +++ b/cmdline/util.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later // Copyright (C) 2011 Andrea Mazzoleni -#ifndef __UTIL_H -#define __UTIL_H +#ifndef UTIL_H +#define UTIL_H #include "tommyds/tommytypes.h" diff --git a/raid/combo.h b/raid/combo.h index ff59be03..7c833430 100644 --- a/raid/combo.h +++ b/raid/combo.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_COMBO_H -#define __RAID_COMBO_H +#ifndef RAID_COMBO_H +#define RAID_COMBO_H #include diff --git a/raid/cpu.h b/raid/cpu.h index 0933133a..418c1c05 100644 --- a/raid/cpu.h +++ b/raid/cpu.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_CPU_H -#define __RAID_CPU_H +#ifndef RAID_CPU_H +#define RAID_CPU_H #ifdef CONFIG_X86 diff --git a/raid/gf.h b/raid/gf.h index 0e92d508..dce476cb 100644 --- a/raid/gf.h +++ b/raid/gf.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_GF_H -#define __RAID_GF_H +#ifndef RAID_GF_H +#define RAID_GF_H /* * Galois field operations. diff --git a/raid/helper.h b/raid/helper.h index f9ca609e..15cbaa46 100644 --- a/raid/helper.h +++ b/raid/helper.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_HELPER_H -#define __RAID_HELPER_H +#ifndef RAID_HELPER_H +#define RAID_HELPER_H /** * Inserts an integer in a sorted vector. diff --git a/raid/internal.h b/raid/internal.h index 0314c95a..3650665f 100644 --- a/raid/internal.h +++ b/raid/internal.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_INTERNAL_H -#define __RAID_INTERNAL_H +#ifndef RAID_INTERNAL_H +#define RAID_INTERNAL_H #if HAVE_CONFIG_H /* Includes the project configuration for HAVE_* defines */ diff --git a/raid/memory.h b/raid/memory.h index 19aa8af1..7d73e0b3 100644 --- a/raid/memory.h +++ b/raid/memory.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_MEMORY_H -#define __RAID_MEMORY_H +#ifndef RAID_MEMORY_H +#define RAID_MEMORY_H /** * Memory allocation and benchmark layout helpers. diff --git a/raid/raid.h b/raid/raid.h index d4595a87..544d7cda 100644 --- a/raid/raid.h +++ b/raid/raid.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_H -#define __RAID_H +#ifndef RAID_H +#define RAID_H #include diff --git a/raid/test.h b/raid/test.h index bda0b456..1c0c99b4 100644 --- a/raid/test.h +++ b/raid/test.h @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Copyright (C) 2013 Andrea Mazzoleni -#ifndef __RAID_TEST_H -#define __RAID_TEST_H +#ifndef RAID_TEST_H +#define RAID_TEST_H /** * Tests insertion function.