aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2022-11-07 22:54:59 -0500
committerBruce Hill <bruce@bruce-hill.com>2022-11-07 22:54:59 -0500
commit3ed2c195940de9fd2aa320147d1beaa8a0c98654 (patch)
tree9b87c3945fdfa986c6be77c77a8740f7d773ff0f
parent372eb2647f04c8789679a7fd80a0e91a65e47941 (diff)
Use `#pragma once`
-rw-r--r--files.h4
-rw-r--r--json.h4
-rw-r--r--match.h4
-rw-r--r--pattern.h4
-rw-r--r--printmatch.h4
-rw-r--r--utf8.h4
-rw-r--r--utils.h4
7 files changed, 7 insertions, 21 deletions
diff --git a/files.h b/files.h
index 358fcd8..2b2b64c 100644
--- a/files.h
+++ b/files.h
@@ -1,8 +1,7 @@
//
// files.h - Definitions of an API for loading files.
//
-#ifndef FILES__H
-#define FILES__H
+#pragma once
#include <stdio.h>
#include <unistd.h>
@@ -32,5 +31,4 @@ size_t get_line_column(file_t *f, const char *p);
__attribute__((pure, nonnull))
const char *get_line(file_t *f, size_t line_number);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
diff --git a/json.h b/json.h
index 538caa6..4af41bf 100644
--- a/json.h
+++ b/json.h
@@ -1,8 +1,7 @@
//
// json.h - Header file for JSON output.
//
-#ifndef JSON__H
-#define JSON__H
+#pragma once
#include <stdbool.h>
@@ -11,5 +10,4 @@
__attribute__((nonnull))
void json_match(const char *text, match_t *m, bool verbose);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
diff --git a/match.h b/match.h
index c873420..eba4e66 100644
--- a/match.h
+++ b/match.h
@@ -1,8 +1,7 @@
//
// match.h - Header file for BP virtual machine.
//
-#ifndef MATCH__H
-#define MATCH__H
+#pragma once
#include <stdbool.h>
#include <stdio.h>
@@ -39,5 +38,4 @@ match_t *get_numbered_capture(match_t *m, int n);
__attribute__((nonnull, pure))
match_t *get_named_capture(match_t *m, const char *name, ssize_t namelen);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
diff --git a/pattern.h b/pattern.h
index a36885e..0543244 100644
--- a/pattern.h
+++ b/pattern.h
@@ -1,8 +1,7 @@
//
// pattern.h - Header file for BP pattern compilation.
//
-#ifndef PATTERN__H
-#define PATTERN__H
+#pragma once
#include <stdbool.h>
#include <stdint.h>
@@ -127,5 +126,4 @@ void free_all_pats(void);
__attribute__((nonnull))
void delete_pat(pat_t **at_pat, bool recursive);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
diff --git a/printmatch.h b/printmatch.h
index f6a894d..2c4b3ce 100644
--- a/printmatch.h
+++ b/printmatch.h
@@ -1,8 +1,7 @@
//
// Debug visualization of matches
//
-#ifndef EXPLAIN__H
-#define EXPLAIN__H
+#pragma once
#include "match.h"
@@ -18,5 +17,4 @@ void fprint_match(FILE *out, const char *file_start, match_t *m, print_options_t
__attribute__((nonnull))
void explain_match(match_t *m);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
diff --git a/utf8.h b/utf8.h
index 243acd3..f5c251f 100644
--- a/utf8.h
+++ b/utf8.h
@@ -1,8 +1,7 @@
//
// utf8.h - UTF8 helper functions
//
-#ifndef UTF8__H
-#define UTF8__H
+#pragma once
#include <stdbool.h>
@@ -17,5 +16,4 @@ bool isidstart(const char *str, const char *end);
__attribute__((nonnull, pure))
bool isidcontinue(const char *str, const char *end);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
diff --git a/utils.h b/utils.h
index dae247b..0973926 100644
--- a/utils.h
+++ b/utils.h
@@ -1,8 +1,7 @@
//
// utils.h - Some utility and printing functions.
//
-#ifndef UTILS__H
-#define UTILS__H
+#pragma once
#include <err.h>
#include <stdarg.h>
@@ -58,5 +57,4 @@ bool matchstr(const char **str, const char *target, bool skip_nl, const char *en
__attribute__((nonnull))
void delete(void *p);
-#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0