Skip to content

Commit 9d1f94f

Browse files
authored
Merge pull request #275 from P403n1x87/chore/pragma-once
chore: migrate to pragma once
2 parents 9a25233 + c96a223 commit 9d1f94f

32 files changed

+32
-128
lines changed

src/argparse.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef ARGPARSE_H
24-
#define ARGPARSE_H
23+
#pragma once
2524

2625
#include <stdio.h>
2726
#include <stdlib.h>
@@ -69,5 +68,3 @@ int
6968
parse_args(int argc, char** argv);
7069

7170
// TODO: Implement error.
72-
73-
#endif

src/austin.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef AUSTIN_H
24-
#define AUSTIN_H
23+
#pragma once
2524

2625
#include "platform.h"
2726

@@ -36,5 +35,3 @@ print(f'#define VERSION "{version()}"')
3635
]]] */
3736
#define VERSION "3.7.0"
3837
// [[[end]]]
39-
40-
#endif

src/cache.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef CACHE_H
24-
#define CACHE_H
23+
#pragma once
2524

2625
#include <stdint.h>
2726
#include <stdlib.h>
@@ -498,5 +497,3 @@ lookup__clear(lookup_t*);
498497
*/
499498
void
500499
lookup__destroy(lookup_t*);
501-
502-
#endif

src/error.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef ERROR_H
24-
#define ERROR_H
23+
#pragma once
2524

2625
#include <errno.h>
2726

@@ -116,5 +115,3 @@ const int is_fatal(error_t);
116115
austin_errno = (x); \
117116
log_error(); \
118117
}
119-
120-
#endif // ERROR_H

src/heap.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef HEAP_H
24-
#define HEAP_H
23+
#pragma once
2524

2625
#include <sys/types.h>
2726

@@ -38,5 +37,3 @@ typedef struct {
3837
} _heap_t;
3938

4039
#define NULL_MEM_BLOCK ((_mem_block_t){(void*)-1, NULL, (void*)-1, NULL})
41-
42-
#endif

src/hints.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef HINTS_H
24-
#define HINTS_H
23+
#pragma once
2524

2625
#define SUCCESS return 0
2726
#define FAIL return 1
@@ -48,5 +47,3 @@
4847
#ifndef unlikely
4948
#define unlikely(x) __builtin_expect(!!(x), 0)
5049
#endif
51-
52-
#endif

src/linux/vm-range-tree.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef VM_RANGE_TREE_H
24-
#define VM_RANGE_TREE_H
23+
#pragma once
2524

2625
#include <stdint.h>
2726
#include <stdlib.h>
@@ -221,5 +220,3 @@ vm_range_tree__find(vm_range_tree_t* self, addr_t addr) {
221220
}
222221

223222
#endif // PY_THREAD_C
224-
225-
#endif

src/logging.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef LOGGING_H
24-
#define LOGGING_H
23+
#pragma once
2524

2625
#ifdef TRACE
2726
#define DEBUG
@@ -158,5 +157,3 @@ logger_close(void);
158157

159158
void
160159
log_meta_header(void);
161-
162-
#endif // LOGGING_H

src/mojo.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef MOJO_H
24-
#define MOJO_H
23+
#pragma once
2524

2625
#include <stdio.h>
2726

@@ -133,5 +132,3 @@ mojo_integer(mojo_int_t integer, int sign) {
133132
#define mojo_string_ref(key) \
134133
mojo_event(MOJO_STRING_REF); \
135134
mojo_ref(key);
136-
137-
#endif

src/msg.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef MSG_H
24-
#define MSG_H
23+
#pragma once
2524

2625
#include <stdarg.h>
2726
#include <stdio.h>
@@ -96,5 +95,3 @@ _msg(const char* fmt, ...) {
9695

9796
fputs(".\n", stderr);
9897
}
99-
100-
#endif // MSG_H

src/platform.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef PLATFORM_H
24-
#define PLATFORM_H
23+
#pragma once
2524

2625
#include <stddef.h>
2726

@@ -84,5 +83,3 @@ typedef HANDLE proc_ref_t;
8483
*/
8584
size_t
8685
pid_max();
87-
88-
#endif

src/py_proc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef PY_PROC_H
24-
#define PY_PROC_H
23+
#pragma once
2524

2625
#include <sys/types.h>
2726

@@ -240,5 +239,3 @@ py_proc__terminate(py_proc_t*);
240239

241240
void
242241
py_proc__destroy(py_proc_t*);
243-
244-
#endif // PY_PROC_H

src/py_proc_list.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef PY_PROC_LIST_H
24-
#define PY_PROC_LIST_H
23+
#pragma once
2524

2625
#include "cache.h"
2726
#include "py_proc.h"
@@ -124,5 +123,3 @@ py_proc_list__destroy(py_proc_list_t*);
124123

125124
CLEANUP_TYPE(py_proc_list_t, py_proc_list__destroy);
126125
#define cu_py_proc_list_t __attribute__((cleanup(py_proc_list__destroyt))) py_proc_list_t
127-
128-
#endif

src/py_string.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef PY_STRING_H
24-
#define PY_STRING_H
23+
#pragma once
2524

2625
#include <stdlib.h>
2726
#include <string.h>
@@ -162,5 +161,3 @@ _bytes_from_raddr(proc_ref_t pref, void* raddr, ssize_t* size, python_v* py_v) {
162161
sfree(array);
163162
return NULL;
164163
}
165-
166-
#endif

src/python/abi.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
// You should have received a copy of the GNU General Public License
2121
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
#ifndef PYTHON_ABI_H
24-
#define PYTHON_ABI_H
23+
#pragma once
2524

2625
#include "code.h"
2726
#include "frame.h"
@@ -31,5 +30,3 @@
3130
#include "runtime.h"
3231
#include "string.h"
3332
#include "thread.h"
34-
35-
#endif

src/python/ceval.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_CEVAL_H
29-
#define PYTHON_CEVAL_H
28+
#pragma once
3029

3130
#include "gil.h"
3231
#include "misc.h"
@@ -35,5 +34,3 @@ struct _ceval_runtime_state3_11 {
3534
_Py_atomic_int signals_pending;
3635
struct _gil_runtime_state3_11 gil;
3736
};
38-
39-
#endif

src/python/cframe.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_CFRAME_H
29-
#define PYTHON_CFRAME_H
28+
#pragma once
3029

3130
#include <stdint.h>
3231

@@ -49,5 +48,3 @@ typedef union {
4948
_PyCFrame3_11 v3_11;
5049
_PyCFrame3_12 v3_12;
5150
} PyCFrame;
52-
53-
#endif

src/python/code.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_CODE_H
29-
#define PYTHON_CODE_H
28+
#pragma once
3029

3130
#include "object.h"
3231

@@ -143,5 +142,3 @@ typedef union {
143142
PyCodeObject3_11 v3_11;
144143
PyCodeObject3_12 v3_12;
145144
} PyCodeObject;
146-
147-
#endif

src/python/frame.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_FRAME_H
29-
#define PYTHON_FRAME_H
28+
#pragma once
3029

3130
#include "code.h"
3231
#include "object.h"
@@ -73,5 +72,3 @@ typedef union {
7372
PyFrameObject3_7 v3_7;
7473
PyFrameObject3_10 v3_10;
7574
} PyFrameObject;
76-
77-
#endif

src/python/gc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_GC_H
29-
#define PYTHON_GC_H
28+
#pragma once
3029

3130
#include <stdint.h>
3231

@@ -108,5 +107,3 @@ typedef union {
108107
struct _gc_runtime_state3_8 v3_8;
109108
struct _gc_runtime_state3_12 v3_12;
110109
} GCRuntimeState;
111-
112-
#endif

src/python/gil.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_GIL_H
29-
#define PYTHON_GIL_H
28+
#pragma once
3029

3130
#include "interp.h"
3231
#include "misc.h"
@@ -45,5 +44,3 @@ struct _gil_runtime_state3_11 {
4544
};
4645

4746
typedef struct _gil_runtime_state3_11 gil_state_t;
48-
49-
#endif

src/python/iframe.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_IFRAME_H
29-
#define PYTHON_IFRAME_H
28+
#pragma once
3029

3130
#include <stdint.h>
3231

@@ -88,5 +87,3 @@ typedef union {
8887
_PyInterpreterFrame3_11 v3_11;
8988
_PyInterpreterFrame3_12 v3_12;
9089
} PyInterpreterFrame;
91-
92-
#endif

src/python/interp.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_INTERP_H
29-
#define PYTHON_INTERP_H
28+
#pragma once
3029

3130
#include <stdbool.h>
3231
#include <stdint.h>
@@ -176,5 +175,3 @@ typedef union {
176175
PyInterpreterState3_11 v3_11;
177176
PyInterpreterState3_12 v3_12;
178177
} PyInterpreterState;
179-
180-
#endif

src/python/misc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
// Python. The authors of those sources hold the copyright
2626
// for most of the content of this header file.
2727

28-
#ifndef PYTHON_MISC_H
29-
#define PYTHON_MISC_H
28+
#pragma once
3029

3130
#include <stdint.h>
3231

@@ -133,5 +132,3 @@ typedef struct _stack_chunk {
133132
size_t top;
134133
PyObject* data[1]; /* Variable sized */
135134
} _PyStackChunk;
136-
137-
#endif

0 commit comments

Comments
 (0)