From 12ba778afdb797575e05284decd34cf2c27e3647 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Mon, 16 Jun 2014 10:13:40 +0200 Subject: include: Switch to #pragma once pattern Signed-off-by: Sylvain Munaut --- include/osmocom/core/application.h | 5 +---- include/osmocom/core/backtrace.h | 5 +---- include/osmocom/core/bits.h | 5 +---- include/osmocom/core/bitvec.h | 5 +---- include/osmocom/core/conv.h | 5 +---- include/osmocom/core/crc16.h | 5 +---- include/osmocom/core/crcXXgen.h.tpl | 5 +---- include/osmocom/core/crcgen.h | 5 +---- include/osmocom/core/defs.h | 5 +---- include/osmocom/core/gsmtap.h | 5 +---- include/osmocom/core/gsmtap_util.h | 5 +---- include/osmocom/core/linuxlist.h | 6 +----- include/osmocom/core/linuxrbtree.h | 5 +---- include/osmocom/core/logging.h | 5 +---- include/osmocom/core/loggingrb.h | 5 +---- include/osmocom/core/msgb.h | 5 +---- include/osmocom/core/msgfile.h | 5 +---- include/osmocom/core/panic.h | 5 +---- include/osmocom/core/plugin.h | 5 +---- include/osmocom/core/prim.h | 5 +---- include/osmocom/core/rate_ctr.h | 4 +--- include/osmocom/core/select.h | 5 +---- include/osmocom/core/serial.h | 5 +---- include/osmocom/core/signal.h | 5 +---- include/osmocom/core/socket.h | 5 +---- include/osmocom/core/statistics.h | 5 +---- include/osmocom/core/strrb.h | 5 +---- include/osmocom/core/talloc.h | 5 +---- include/osmocom/core/timer.h | 5 +---- include/osmocom/core/timer_compat.h | 5 +---- include/osmocom/core/utils.h | 5 +---- include/osmocom/core/write_queue.h | 5 +---- 32 files changed, 32 insertions(+), 128 deletions(-) (limited to 'include/osmocom/core') diff --git a/include/osmocom/core/application.h b/include/osmocom/core/application.h index 34571698..ecaeaa8a 100644 --- a/include/osmocom/core/application.h +++ b/include/osmocom/core/application.h @@ -1,5 +1,4 @@ -#ifndef OSMO_APPLICATION_H -#define OSMO_APPLICATION_H +#pragma once /*! * \file application.h @@ -19,5 +18,3 @@ void osmo_init_ignore_signals(void); int osmo_init_logging(const struct log_info *); int osmo_daemonize(void); - -#endif diff --git a/include/osmocom/core/backtrace.h b/include/osmocom/core/backtrace.h index a24290c5..0c9b6ef9 100644 --- a/include/osmocom/core/backtrace.h +++ b/include/osmocom/core/backtrace.h @@ -1,7 +1,4 @@ -#ifndef _OSMO_BACKTRACE_H_ -#define _OSMO_BACKTRACE_H_ +#pragma once void osmo_generate_backtrace(void); void osmo_log_backtrace(int subsys, int level); - -#endif diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 4c685321..d4ab5056 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -1,5 +1,4 @@ -#ifndef _OSMO_BITS_H -#define _OSMO_BITS_H +#pragma once #include @@ -74,5 +73,3 @@ uint32_t osmo_revbytebits_8(uint8_t x); void osmo_revbytebits_buf(uint8_t *buf, int len); /*! @} */ - -#endif /* _OSMO_BITS_H */ diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 9c000d02..31382260 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -1,5 +1,4 @@ -#ifndef _BITVEC_H -#define _BITVEC_H +#pragma once /* bit vector utility routines */ @@ -66,5 +65,3 @@ int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit); /*! @} */ - -#endif /* _BITVEC_H */ diff --git a/include/osmocom/core/conv.h b/include/osmocom/core/conv.h index 4cc791fa..e7f6bd6a 100644 --- a/include/osmocom/core/conv.h +++ b/include/osmocom/core/conv.h @@ -28,8 +28,7 @@ * Osmocom convolutional encoder and decoder */ -#ifndef __OSMO_CONV_H__ -#define __OSMO_CONV_H__ +#pragma once #include @@ -142,5 +141,3 @@ int osmo_conv_decode(const struct osmo_conv_code *code, /*! @} */ - -#endif /* __OSMO_CONV_H__ */ diff --git a/include/osmocom/core/crc16.h b/include/osmocom/core/crc16.h index 0e524176..83b2e5f7 100644 --- a/include/osmocom/core/crc16.h +++ b/include/osmocom/core/crc16.h @@ -15,8 +15,7 @@ * Version 2. See the file COPYING for more details. */ -#ifndef __CRC16_H -#define __CRC16_H +#pragma once #include @@ -30,5 +29,3 @@ static inline uint16_t osmo_crc16_byte(uint16_t crc, const uint8_t data) { return (crc >> 8) ^ osmo_crc16_table[(crc ^ data) & 0xff]; } - -#endif /* __CRC16_H */ diff --git a/include/osmocom/core/crcXXgen.h.tpl b/include/osmocom/core/crcXXgen.h.tpl index a931bc39..164f7201 100644 --- a/include/osmocom/core/crcXXgen.h.tpl +++ b/include/osmocom/core/crcXXgen.h.tpl @@ -20,8 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __OSMO_CRCXXGEN_H__ -#define __OSMO_CRCXXGEN_H__ +#pragma once /*! \addtogroup crcgen * @{ @@ -54,6 +53,4 @@ void osmo_crcXXgen_set_bits(const struct osmo_crcXXgen_code *code, /*! @} */ -#endif /* __OSMO_CRCXXGEN_H__ */ - /* vim: set syntax=c: */ diff --git a/include/osmocom/core/crcgen.h b/include/osmocom/core/crcgen.h index 69cef040..b39b55db 100644 --- a/include/osmocom/core/crcgen.h +++ b/include/osmocom/core/crcgen.h @@ -20,8 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __OSMO_CRCGEN_H__ -#define __OSMO_CRCGEN_H__ +#pragma once /*! \defgroup crcgen Osmocom generic CRC routines * @{ @@ -37,5 +36,3 @@ #include /*! @} */ - -#endif /* __OSMO_CRCGEN_H__ */ diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index 5ffee046..aebe9258 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -1,5 +1,4 @@ -#ifndef OSMOCORE_DEFS_H -#define OSMOCORE_DEFS_H +#pragma once /*! \defgroup utils General-purpose utility functions * @{ @@ -46,5 +45,3 @@ #undef _OSMO_HAS_ATTRIBUTE_DEPRECATED /*! @} */ - -#endif diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index 4694219a..69bd108e 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -1,5 +1,4 @@ -#ifndef _GSMTAP_H -#define _GSMTAP_H +#pragma once /* gsmtap header, pseudo-header in front of the actua GSM payload */ @@ -239,5 +238,3 @@ struct gsmtap_hdr { uint8_t res; /* reserved for future use (RFU) */ } __attribute__((packed)); - -#endif /* _GSMTAP_H */ diff --git a/include/osmocom/core/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h index eaa32a00..a5c03e77 100644 --- a/include/osmocom/core/gsmtap_util.h +++ b/include/osmocom/core/gsmtap_util.h @@ -1,5 +1,4 @@ -#ifndef _GSMTAP_UTIL_H -#define _GSMTAP_UTIL_H +#pragma once #include #include @@ -55,5 +54,3 @@ int gsmtap_send(struct gsmtap_inst *gti, uint16_t arfcn, uint8_t ts, unsigned int len); /*! @} */ - -#endif /* _GSMTAP_UTIL_H */ diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index fb99c5ec..b6841520 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -1,5 +1,4 @@ -#ifndef _LINUX_LLIST_H -#define _LINUX_LLIST_H +#pragma once #include @@ -355,6 +354,3 @@ static inline void llist_splice_init(struct llist_head *llist, #define llist_for_each_continue_rcu(pos, head) \ for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \ (pos) = (pos)->next, ({ smp_read_barrier_depends(); 0;}), prefetch((pos)->next)) - - -#endif diff --git a/include/osmocom/core/linuxrbtree.h b/include/osmocom/core/linuxrbtree.h index 079f440d..ef8bc153 100644 --- a/include/osmocom/core/linuxrbtree.h +++ b/include/osmocom/core/linuxrbtree.h @@ -91,8 +91,7 @@ static inline struct page * rb_insert_page_cache(struct inode * inode, ----------------------------------------------------------------------- */ -#ifndef _LINUX_RBTREE_H -#define _LINUX_RBTREE_H +#pragma once #include @@ -156,5 +155,3 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent, *rb_link = node; } - -#endif /* _LINUX_RBTREE_H */ diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 1d57e22c..caeea065 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -1,5 +1,4 @@ -#ifndef _OSMOCORE_LOGGING_H -#define _OSMOCORE_LOGGING_H +#pragma once /*! \defgroup logging Osmocom logging framework * @{ @@ -216,5 +215,3 @@ struct log_target *log_target_find(int type, const char *fname); extern struct llist_head osmo_log_target_list; /*! @} */ - -#endif /* _OSMOCORE_LOGGING_H */ diff --git a/include/osmocom/core/loggingrb.h b/include/osmocom/core/loggingrb.h index a6f377b1..acdccfb9 100644 --- a/include/osmocom/core/loggingrb.h +++ b/include/osmocom/core/loggingrb.h @@ -1,5 +1,4 @@ -#ifndef _LOGGINGRB_H -#define _LOGGINGRB_H +#pragma once /* (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved @@ -36,5 +35,3 @@ const char *log_target_rb_get(struct log_target const *target, size_t logindex); struct log_target *log_target_create_rb(size_t size); /*! @} */ - -#endif /* _LOGGINGRB_H */ diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 33e8081f..bf83d677 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -1,5 +1,4 @@ -#ifndef _MSGB_H -#define _MSGB_H +#pragma once /* (C) 2008 by Harald Welte * All Rights Reserved @@ -413,5 +412,3 @@ uint8_t *msgb_data(const struct msgb *msg); void msgb_set_talloc_ctx(void *ctx); /*! @} */ - -#endif /* _MSGB_H */ diff --git a/include/osmocom/core/msgfile.h b/include/osmocom/core/msgfile.h index c5e67a45..cab97b22 100644 --- a/include/osmocom/core/msgfile.h +++ b/include/osmocom/core/msgfile.h @@ -19,8 +19,7 @@ * */ -#ifndef MSG_FILE_H -#define MSG_FILE_H +#pragma once #include @@ -45,5 +44,3 @@ struct osmo_config_list { }; struct osmo_config_list* osmo_config_list_parse(void *ctx, const char *filename); - -#endif diff --git a/include/osmocom/core/panic.h b/include/osmocom/core/panic.h index fd5cf208..5d575c4b 100644 --- a/include/osmocom/core/panic.h +++ b/include/osmocom/core/panic.h @@ -1,5 +1,4 @@ -#ifndef OSMOCORE_PANIC_H -#define OSMOCORE_PANIC_H +#pragma once /*! \addtogroup utils * @{ @@ -16,5 +15,3 @@ extern void osmo_panic(const char *fmt, ...); extern void osmo_set_panic_handler(osmo_panic_handler_t h); /*! @} */ - -#endif /* OSMOCORE_PANIC_H */ diff --git a/include/osmocom/core/plugin.h b/include/osmocom/core/plugin.h index 6c0eccc6..aef1dfc9 100644 --- a/include/osmocom/core/plugin.h +++ b/include/osmocom/core/plugin.h @@ -1,6 +1,3 @@ -#ifndef _OSMO_PLUGIN_H -#define _OSMO_PLUGIN_H +#pragma once int osmo_plugin_load_all(const char *directory); - -#endif diff --git a/include/osmocom/core/prim.h b/include/osmocom/core/prim.h index f61d8084..935ce51a 100644 --- a/include/osmocom/core/prim.h +++ b/include/osmocom/core/prim.h @@ -1,5 +1,4 @@ -#ifndef OSMO_PRIMITIVE_H -#define OSMO_PRIMITIVE_H +#pragma once /*! \defgroup prim Osmocom primitives * @{ @@ -56,5 +55,3 @@ osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, typedef int (*osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx); /*! @} */ - -#endif /* OSMO_PRIMITIVE_H */ diff --git a/include/osmocom/core/rate_ctr.h b/include/osmocom/core/rate_ctr.h index 24577fdf..821c7cfd 100644 --- a/include/osmocom/core/rate_ctr.h +++ b/include/osmocom/core/rate_ctr.h @@ -1,5 +1,4 @@ -#ifndef _RATE_CTR_H -#define _RATE_CTR_H +#pragma once /*! \defgroup rate_ctr Rate counters * @{ @@ -85,4 +84,3 @@ struct rate_ctr_group *rate_ctr_get_group_by_name_idx(const char *name, const un const struct rate_ctr *rate_ctr_get_by_name(const struct rate_ctr_group *ctrg, const char *name); /*! @} */ -#endif /* RATE_CTR_H */ diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index efdd716f..b6b9e821 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -1,5 +1,4 @@ -#ifndef _BSC_SELECT_H -#define _BSC_SELECT_H +#pragma once #include @@ -41,5 +40,3 @@ void osmo_fd_unregister(struct osmo_fd *fd); int osmo_select_main(int polling); /*! @} */ - -#endif /* _BSC_SELECT_H */ diff --git a/include/osmocom/core/serial.h b/include/osmocom/core/serial.h index 1640a6da..e3f7a9ff 100644 --- a/include/osmocom/core/serial.h +++ b/include/osmocom/core/serial.h @@ -28,8 +28,7 @@ * Osmocom serial port helpers */ -#ifndef __OSMO_SERIAL_H__ -#define __OSMO_SERIAL_H__ +#pragma once #include @@ -39,5 +38,3 @@ int osmo_serial_set_custom_baudrate(int fd, int baudrate); int osmo_serial_clear_custom_baudrate(int fd); /*! @} */ - -#endif /* __OSMO_SERIAL_H__ */ diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index 19a2688f..6f56496a 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -1,5 +1,4 @@ -#ifndef OSMO_SIGNAL_H -#define OSMO_SIGNAL_H +#pragma once #include @@ -43,5 +42,3 @@ void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data); /*! @} */ - -#endif /* OSMO_SIGNAL_H */ diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index cb1b7a82..1df28c92 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -1,5 +1,4 @@ -#ifndef _OSMOCORE_SOCKET_H -#define _OSMOCORE_SOCKET_H +#pragma once /*! \defgroup socket Socket convenience functions * @{ @@ -37,5 +36,3 @@ int osmo_sock_unix_init_ofd(struct osmo_fd *ofd, uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags); /*! @} */ - -#endif /* _OSMOCORE_SOCKET_H */ diff --git a/include/osmocom/core/statistics.h b/include/osmocom/core/statistics.h index ade00748..de250bec 100644 --- a/include/osmocom/core/statistics.h +++ b/include/osmocom/core/statistics.h @@ -1,5 +1,4 @@ -#ifndef _STATISTICS_H -#define _STATISTICS_H +#pragma once /*! \file statistics.h * \brief Common routines regarding statistics */ @@ -49,5 +48,3 @@ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), * \returns pointer to counter (\ref osmo_counter) or NULL otherwise */ struct osmo_counter *osmo_counter_get_by_name(const char *name); - -#endif /* _STATISTICS_H */ diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h index cfc56dc0..c563d1b9 100644 --- a/include/osmocom/core/strrb.h +++ b/include/osmocom/core/strrb.h @@ -1,5 +1,4 @@ -#ifndef _STRRB_H -#define _STRRB_H +#pragma once /* (C) 2012-2013 by Katerina Barone-Adesi * All Rights Reserved @@ -54,5 +53,3 @@ size_t osmo_strrb_elements(const struct osmo_strrb *rb); int osmo_strrb_add(struct osmo_strrb *rb, const char *data); /*! @} */ - -#endif /* _STRRB_H */ diff --git a/include/osmocom/core/talloc.h b/include/osmocom/core/talloc.h index f7f7643b..dde102b2 100644 --- a/include/osmocom/core/talloc.h +++ b/include/osmocom/core/talloc.h @@ -1,5 +1,4 @@ -#ifndef _TALLOC_H_ -#define _TALLOC_H_ +#pragma once /* Unix SMB/CIFS implementation. Samba temporary memory allocation functions @@ -188,5 +187,3 @@ char *talloc_asprintf_append(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3 char *talloc_asprintf_append_buffer(char *s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); void talloc_set_abort_fn(void (*abort_fn)(const char *reason)); - -#endif diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index d37af806..d7343576 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -26,8 +26,7 @@ * \brief Osmocom timer handling routines */ -#ifndef TIMER_H -#define TIMER_H +#pragma once #include @@ -85,5 +84,3 @@ int osmo_timers_update(void); int osmo_timers_check(void); /*! @} */ - -#endif diff --git a/include/osmocom/core/timer_compat.h b/include/osmocom/core/timer_compat.h index d86c109e..fb2967ba 100644 --- a/include/osmocom/core/timer_compat.h +++ b/include/osmocom/core/timer_compat.h @@ -26,8 +26,7 @@ * \brief Compatibility header with some helpers */ -#ifndef TIMER_COMPAT_H -#define TIMER_COMPAT_H +#pragma once /* Convenience macros for operations on timevals. @@ -75,5 +74,3 @@ /*! @} */ - -#endif /* TIMER_COMPAT_H */ diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 2333de66..c08e7753 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -1,5 +1,4 @@ -#ifndef OSMOCORE_UTIL_H -#define OSMOCORE_UTIL_H +#pragma once #include @@ -62,5 +61,3 @@ do { \ /*! @} */ - -#endif diff --git a/include/osmocom/core/write_queue.h b/include/osmocom/core/write_queue.h index 816c0364..4e0fdf3d 100644 --- a/include/osmocom/core/write_queue.h +++ b/include/osmocom/core/write_queue.h @@ -20,8 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ -#ifndef OSMO_WQUEUE_H -#define OSMO_WQUEUE_H +#pragma once /*! \defgroup write_queue Osmocom msgb write queues * @{ @@ -59,5 +58,3 @@ int osmo_wqueue_enqueue(struct osmo_wqueue *queue, struct msgb *data); int osmo_wqueue_bfd_cb(struct osmo_fd *fd, unsigned int what); /*! @} */ - -#endif -- cgit v1.2.3