Skip to content

Commit 2ceb327

Browse files
riptlripatel-fd
authored andcommitted
Fix include guards
Use check_include_guards.py script to fix up include guards
1 parent abc2b86 commit 2ceb327

File tree

146 files changed

+525
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+525
-321
lines changed

contrib/lint/check_include_guards.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def check_file(path):
11-
guard_name = "HEADER_fd_" + str(path).replace(".", "_").replace("/", "_")
11+
guard_name = "HEADER_fd_" + str(path).replace(".", "_").replace("/", "_").replace("-", "_")
1212
with open(path, "r") as f:
1313
# Skip whitespace lines
1414
while True:
@@ -27,6 +27,8 @@ def check_file(path):
2727
def main():
2828
# Recursive find .h files
2929
for path in Path("./src").rglob("*.h"):
30+
if ".pb.h" in path.name:
31+
continue
3032
try:
3133
check_file(path)
3234
except IOError:

src/app/firedancer-dev/commands/core_subtopo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef CORE_SUBTOPO_H
2-
#define CORE_SUBTOPO_H
1+
#ifndef HEADER_fd_src_app_firedancer_dev_commands_core_subtopo_h
2+
#define HEADER_fd_src_app_firedancer_dev_commands_core_subtopo_h
33

44
#include "../../shared/fd_config.h"
55
#include "../../../disco/topo/fd_topob.h"
@@ -79,4 +79,4 @@ fd_link_permit_no_consumers( fd_topo_t * topo, char * link_name ) {
7979
return found;
8080
}
8181

82-
#endif /* CORE_SUBTOPO_H */
82+
#endif /* HEADER_fd_src_app_firedancer_dev_commands_core_subtopo_h */

src/app/firedancer-dev/commands/gossip.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef FD_SRC_APP_FIREDANCER_DEV_COMMANDS_GOSSIP_H
2-
#define FD_SRC_APP_FIREDANCER_DEV_COMMANDS_GOSSIP_H
1+
#ifndef HEADER_fd_src_app_firedancer_dev_commands_gossip_h
2+
#define HEADER_fd_src_app_firedancer_dev_commands_gossip_h
33

44
#include "../../shared/fd_config.h"
55

@@ -14,4 +14,4 @@
1414
void
1515
fd_gossip_subtopo( config_t * config, ulong tile_to_cpu[ FD_TILE_MAX ] );
1616

17-
#endif /* FD_SRC_APP_FIREDANCER_DEV_COMMANDS_GOSSIP_H */
17+
#endif /* HEADER_fd_src_app_firedancer_dev_commands_gossip_h */

src/app/platform/fd_cap_chk.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef HEADER_fd_src_app_shared_fd_cap_chk_h
2-
#define HEADER_fd_src_app_shared_fd_cap_chk_h
1+
#ifndef HEADER_fd_src_app_platform_fd_cap_chk_h
2+
#define HEADER_fd_src_app_platform_fd_cap_chk_h
33

44
#include "../../util/fd_util_base.h"
55

@@ -106,4 +106,4 @@ fd_cap_chk_err( fd_cap_chk_t const * chk,
106106

107107
FD_PROTOTYPES_END
108108

109-
#endif /* HEADER_fd_src_app_shared_fd_cap_chk_h */
109+
#endif /* HEADER_fd_src_app_platform_fd_cap_chk_h */

src/app/platform/fd_config_extract.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef HEADER_fd_src_app_platform_fd_config_extract_h
2+
#define HEADER_fd_src_app_platform_fd_config_extract_h
3+
14
#include "../../util/fd_util.h"
25
#include "../../util/pod/fd_pod.h"
36

@@ -143,3 +146,5 @@ fdctl_cfg_get_float( float * out,
143146
}
144147

145148
FD_PROTOTYPES_END
149+
150+
#endif /* HEADER_fd_src_app_platform_fd_config_extract_h */

src/app/platform/fd_file_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef HEADER_fd_src_app_shared_fd_file_util_h
2-
#define HEADER_fd_src_app_shared_fd_file_util_h
1+
#ifndef HEADER_fd_src_app_platform_fd_file_util_h
2+
#define HEADER_fd_src_app_platform_fd_file_util_h
33

44
#include "../../util/fd_util.h"
55

@@ -87,4 +87,4 @@ char *
8787
fd_file_util_read_all( char const * path,
8888
ulong * out_sz );
8989

90-
#endif /* HEADER_fd_src_app_shared_fd_file_util_h */
90+
#endif /* HEADER_fd_src_app_platform_fd_file_util_h */

src/app/platform/fd_net_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef HEADER_fd_src_app_shared_fd_net_util_h
2-
#define HEADER_fd_src_app_shared_fd_net_util_h
1+
#ifndef HEADER_fd_src_app_platform_fd_net_util_h
2+
#define HEADER_fd_src_app_platform_fd_net_util_h
33

44
#include "../../util/fd_util.h"
55

@@ -72,4 +72,4 @@ int
7272
fd_net_util_if_addr( const char * interface,
7373
uint * addr );
7474

75-
#endif /* HEADER_fd_src_app_shared_fd_net_util_h */
75+
#endif /* HEADER_fd_src_app_platform_fd_net_util_h */

src/app/platform/fd_sys_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef HEADER_fd_src_app_shared_fd_sys_util_h
2-
#define HEADER_fd_src_app_shared_fd_sys_util_h
1+
#ifndef HEADER_fd_src_app_platform_fd_sys_util_h
2+
#define HEADER_fd_src_app_platform_fd_sys_util_h
33

44
#include "../../util/fd_util.h"
55

@@ -37,4 +37,4 @@ fd_sys_util_user_to_uid( char const * user,
3737
uint * uid,
3838
uint * gid );
3939

40-
#endif /* HEADER_fd_src_app_shared_fd_sys_util_h */
40+
#endif /* HEADER_fd_src_app_platform_fd_sys_util_h */

src/app/shared/commands/monitor/monitor.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#ifndef HEADER_fd_src_app_shared_commands_monitor_h
2-
#define HEADER_fd_src_app_shared_commands_monitor_h
1+
#ifndef HEADER_fd_src_app_shared_commands_monitor_monitor_h
2+
#define HEADER_fd_src_app_shared_commands_monitor_monitor_h
33

44
#include "../../fd_config.h"
5+
#include "../../fd_action.h"
56

67
FD_PROTOTYPES_BEGIN
78

@@ -13,4 +14,4 @@ FD_PROTOTYPES_END
1314

1415
extern action_t fd_action_monitor;
1516

16-
#endif /* HEADER_fd_src_app_shared_commands_monitor_h */
17+
#endif /* HEADER_fd_src_app_shared_commands_monitor_monitor_h */

src/app/shared_dev/commands/quic_trace/fd_quic_trace.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef HEADER_fd_src_app_fddev_quic_trace_fd_quic_trace_h
2-
#define HEADER_fd_src_app_fddev_quic_trace_fd_quic_trace_h
1+
#ifndef HEADER_fd_src_app_shared_dev_commands_quic_trace_fd_quic_trace_h
2+
#define HEADER_fd_src_app_shared_dev_commands_quic_trace_fd_quic_trace_h
33

44
#include "../../../shared/fd_config.h"
55
#include "../../../shared/fd_action.h"
@@ -101,4 +101,4 @@ FD_PROTOTYPES_END
101101

102102
extern action_t fd_action_quic_trace;
103103

104-
#endif /* HEADER_fd_src_app_fddev_quic_trace_fd_quic_trace_h */
104+
#endif /* HEADER_fd_src_app_shared_dev_commands_quic_trace_fd_quic_trace_h */

0 commit comments

Comments
 (0)