diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-08-31 01:20:18 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-31 12:20:59 +0100 |
commit | 5f941573b0040c1b27014b4756155c86fe896b9f (patch) | |
tree | 5f25a07ce76b2822fe906ae88def9bb16c24ee7a /include | |
parent | 30209cedddb3b6ece5614b40f65f6a04e84388b4 (diff) |
Use '#pragma once' instead of include guard
The most compilers today do support the '#pragma once', which is
designed to cause the current source file to be included only once
in a single compilation. One has several advantages, including:
less code, avoidance of name clashes, and sometimes improvement
in compilation speed.
See: https://en.wikipedia.org/wiki/Pragma_once for details.
Diffstat (limited to 'include')
-rw-r--r-- | include/gsmhr/gsmhr.h | 5 | ||||
-rw-r--r-- | include/osmocom/gapk/benchmark.h | 7 | ||||
-rw-r--r-- | include/osmocom/gapk/codecs.h | 5 | ||||
-rw-r--r-- | include/osmocom/gapk/formats.h | 5 | ||||
-rw-r--r-- | include/osmocom/gapk/get_cycles.h | 5 | ||||
-rw-r--r-- | include/osmocom/gapk/procqueue.h | 5 | ||||
-rw-r--r-- | include/osmocom/gapk/utils.h | 5 |
7 files changed, 8 insertions, 29 deletions
diff --git a/include/gsmhr/gsmhr.h b/include/gsmhr/gsmhr.h index 17d42cb..b2fa0da 100644 --- a/include/gsmhr/gsmhr.h +++ b/include/gsmhr/gsmhr.h @@ -17,8 +17,7 @@ * along with gapk. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GSM_HR_H__ -#define __GSM_HR_H__ +#pragma once #include <stdint.h> @@ -36,5 +35,3 @@ int gsmhr_decode(struct gsmhr *state, int16_t *pcm, const int16_t *hr_ #ifdef __cplusplus } #endif - -#endif /* __GSM_HR_H__ */ diff --git a/include/osmocom/gapk/benchmark.h b/include/osmocom/gapk/benchmark.h index b67af6f..c18d85e 100644 --- a/include/osmocom/gapk/benchmark.h +++ b/include/osmocom/gapk/benchmark.h @@ -1,6 +1,3 @@ -#ifndef _BENCHMARK_H -#define _BENCHMARK_H - /* * This file is part of gapk (GSM Audio Pocket Knife). * @@ -20,6 +17,8 @@ * (C) 2014 Harald Welte <laforge@gnumonks.org> */ +#pragma once + #include <osmocom/gapk/get_cycles.h> #include <osmocom/gapk/codecs.h> @@ -56,5 +55,3 @@ static inline void benchmark_stop(enum codec_type codec, int encode, unsigned lo } while (0) void benchmark_dump(void); - -#endif diff --git a/include/osmocom/gapk/codecs.h b/include/osmocom/gapk/codecs.h index 1ad4e73..f680460 100644 --- a/include/osmocom/gapk/codecs.h +++ b/include/osmocom/gapk/codecs.h @@ -17,8 +17,7 @@ * along with gapk. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GAPK_CODECS_H__ -#define __GAPK_CODECS_H__ +#pragma once #include <stdint.h> @@ -67,5 +66,3 @@ struct codec_desc { }; const struct codec_desc *codec_get_from_type(enum codec_type type); - -#endif /* __GAPK_CODECS_H__ */ diff --git a/include/osmocom/gapk/formats.h b/include/osmocom/gapk/formats.h index 7847782..4a3cb67 100644 --- a/include/osmocom/gapk/formats.h +++ b/include/osmocom/gapk/formats.h @@ -17,8 +17,7 @@ * along with gapk. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GAPK_FORMATS_H__ -#define __GAPK_FORMATS_H__ +#pragma once #include <stdint.h> @@ -90,5 +89,3 @@ struct format_desc { const struct format_desc *fmt_get_from_type(enum format_type type); const struct format_desc *fmt_get_from_name(const char *name); - -#endif /* __GAPK_FORMATS_H__ */ diff --git a/include/osmocom/gapk/get_cycles.h b/include/osmocom/gapk/get_cycles.h index 9eb7bc3..40ac570 100644 --- a/include/osmocom/gapk/get_cycles.h +++ b/include/osmocom/gapk/get_cycles.h @@ -33,8 +33,7 @@ * $Id$ */ -#ifndef GET_CLOCK_H -#define GET_CLOCK_H +#pragma once #if 0 @@ -134,5 +133,3 @@ static inline cycles_t get_cycles() #endif extern double get_cpu_mhz(void); - -#endif /* GET_CLOCK_H */ diff --git a/include/osmocom/gapk/procqueue.h b/include/osmocom/gapk/procqueue.h index d9a5546..708f767 100644 --- a/include/osmocom/gapk/procqueue.h +++ b/include/osmocom/gapk/procqueue.h @@ -17,8 +17,7 @@ * along with gapk. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GAPK_PROCQUEUE_H__ -#define __GAPK_PROCQUEUE_H__ +#pragma once #include <stdint.h> #include <stdio.h> /* for FILE */ @@ -68,5 +67,3 @@ int pq_queue_fmt_convert(struct pq *pq, const struct format_desc *fmt, int to_fr /* Codec */ struct codec_desc; int pq_queue_codec(struct pq *pq, const struct codec_desc *codec, int encode); - -#endif /* __GAPK_PROCQUEUE_H__ */ diff --git a/include/osmocom/gapk/utils.h b/include/osmocom/gapk/utils.h index 3b02049..0b8b75b 100644 --- a/include/osmocom/gapk/utils.h +++ b/include/osmocom/gapk/utils.h @@ -17,8 +17,7 @@ * along with gapk. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GAPK_UTILS_H__ -#define __GAPK_UTILS_H__ +#pragma once #include <stdint.h> @@ -100,5 +99,3 @@ lsb_clr_bit(uint8_t *buf, int bn) buf[pos_byte] &= ~(1 << pos_bit); } - -#endif /* __GAPK_UTILS_H__ */ |