From fe0ab491b4defd343ce4324c2b7af8046e94b99e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 22 Aug 2022 14:23:04 -0400 Subject: [PATCH] Clean up include guards The previous style(s) used in most places here violates the C standard, and in practice can trigger -Wreserved-id-macro in clang for client code. So, switch to a conventional style that doesn't trigger warnings (and is supported by tools like clang-tidy). --- control.h | 6 +++--- intclient.h | 6 +++--- jack.h | 6 +++--- jslist.h | 6 +++--- metadata.h | 6 +++--- midiport.h | 7 ++++--- ringbuffer.h | 6 +++--- session.h | 7 ++++--- statistics.h | 6 +++--- systemdeps.h | 6 +++--- thread.h | 6 +++--- transport.h | 6 +++--- types.h | 6 +++--- uuid.h | 6 +++--- weakjack.h | 6 +++--- weakmacros.h | 6 +++--- 16 files changed, 50 insertions(+), 48 deletions(-) diff --git a/control.h b/control.h index 7493b0c..c073aca 100644 --- a/control.h +++ b/control.h @@ -23,8 +23,8 @@ * */ -#ifndef __jack_control_h__ -#define __jack_control_h__ +#ifndef JACK_CONTROL_H +#define JACK_CONTROL_H #include @@ -559,4 +559,4 @@ jack_log( } /* extern "C" */ #endif -#endif /* __jack_control_h__ */ +#endif /* JACK_CONTROL_H */ diff --git a/intclient.h b/intclient.h index e6d0392..d0f9b2e 100644 --- a/intclient.h +++ b/intclient.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_intclient_h__ -#define __jack_intclient_h__ +#ifndef JACK_INTCLIENT_H +#define JACK_INTCLIENT_H #ifdef __cplusplus extern "C" { @@ -134,4 +134,4 @@ jack_status_t jack_internal_client_unload (jack_client_t *client, } #endif -#endif /* __jack_intclient_h__ */ +#endif /* JACK_INTCLIENT_H */ diff --git a/jack.h b/jack.h index 4a87c63..c44605f 100644 --- a/jack.h +++ b/jack.h @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_h__ -#define __jack_h__ +#ifndef JACK_JACK_H +#define JACK_JACK_H #ifdef __cplusplus extern "C" { @@ -1334,4 +1334,4 @@ void jack_free(void* ptr) JACK_OPTIONAL_WEAK_EXPORT; } #endif -#endif /* __jack_h__ */ +#endif /* JACK_JACK_H */ diff --git a/jslist.h b/jslist.h index 755b31a..4860835 100644 --- a/jslist.h +++ b/jslist.h @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_jslist_h__ -#define __jack_jslist_h__ +#ifndef JACK_JSLIST_H +#define JACK_JSLIST_H #include @@ -299,4 +299,4 @@ jack_slist_sort (JSList *list, compare_func); } -#endif /* __jack_jslist_h__ */ +#endif /* JACK_JSLIST_H */ diff --git a/metadata.h b/metadata.h index 8dc3e9b..c9bec36 100644 --- a/metadata.h +++ b/metadata.h @@ -24,8 +24,8 @@ * */ -#ifndef __jack_metadata_h__ -#define __jack_metadata_h__ +#ifndef JACK_METADATA_H +#define JACK_METADATA_H #include @@ -319,4 +319,4 @@ extern const char* JACK_METADATA_SIGNAL_TYPE; } /* namespace */ #endif -#endif /* __jack_metadata_h__ */ +#endif /* JACK_METADATA_H */ diff --git a/midiport.h b/midiport.h index b8d79ec..72fb6b8 100644 --- a/midiport.h +++ b/midiport.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __JACK_MIDIPORT_H -#define __JACK_MIDIPORT_H +#ifndef JACK_MIDIPORT_H +#define JACK_MIDIPORT_H #ifdef __cplusplus extern "C" { @@ -166,5 +166,6 @@ jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_E } #endif +#endif /* JACK_MIDIPORT_H */ + -#endif /* __JACK_MIDIPORT_H */ diff --git a/ringbuffer.h b/ringbuffer.h index 4d4db80..c9df182 100644 --- a/ringbuffer.h +++ b/ringbuffer.h @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _RINGBUFFER_H -#define _RINGBUFFER_H +#ifndef JACK_RINGBUFFER_H +#define JACK_RINGBUFFER_H #ifdef __cplusplus extern "C" { @@ -231,4 +231,4 @@ size_t jack_ringbuffer_write_space(const jack_ringbuffer_t *rb); } #endif -#endif +#endif /* JACK_RINGBUFFER_H */ diff --git a/session.h b/session.h index 608e622..27db425 100644 --- a/session.h +++ b/session.h @@ -18,8 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_session_h__ -#define __jack_session_h__ +#ifndef JACK_SESSION_H +#define JACK_SESSION_H #ifdef __cplusplus extern "C" { @@ -299,4 +299,5 @@ jack_client_has_session_callback (jack_client_t *client, const char *client_name #ifdef __cplusplus } #endif -#endif + +#endif /* JACK_SESSION_H */ diff --git a/statistics.h b/statistics.h index 3457d4a..1382738 100644 --- a/statistics.h +++ b/statistics.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __statistics_h__ -#define __statistics_h__ +#ifndef JACK_STATISTICS_H +#define JACK_STATISTICS_H #ifdef __cplusplus extern "C" { @@ -51,4 +51,4 @@ void jack_reset_max_delayed_usecs (jack_client_t *client); } #endif -#endif /* __statistics_h__ */ +#endif /* JACK_STATISTICS_H */ diff --git a/systemdeps.h b/systemdeps.h index c991da8..93c3429 100644 --- a/systemdeps.h +++ b/systemdeps.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_systemdeps_h__ -#define __jack_systemdeps_h__ +#ifndef JACK_SYSTEMDEPS_H +#define JACK_SYSTEMDEPS_H #ifndef POST_PACKED_STRUCTURE @@ -137,4 +137,4 @@ #define JACK_LIB_EXPORT #endif -#endif /* __jack_systemdeps_h__ */ +#endif /* JACK_SYSTEMDEPS_H */ diff --git a/thread.h b/thread.h index b426baa..bb3d47e 100644 --- a/thread.h +++ b/thread.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_thread_h__ -#define __jack_thread_h__ +#ifndef JACK_THREAD_H +#define JACK_THREAD_H #ifdef __cplusplus extern "C" { @@ -133,4 +133,4 @@ void jack_set_thread_creator (jack_thread_creator_t creator) JACK_OPTIONAL_WEAK_ } #endif -#endif /* __jack_thread_h__ */ +#endif /* JACK_THREAD_H */ diff --git a/transport.h b/transport.h index 54b7b44..25f6ce6 100644 --- a/transport.h +++ b/transport.h @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_transport_h__ -#define __jack_transport_h__ +#ifndef JACK_TRANSPORT_H +#define JACK_TRANSPORT_H #ifdef __cplusplus extern "C" { @@ -536,4 +536,4 @@ void jack_set_transport_info (jack_client_t *client, } #endif -#endif /* __jack_transport_h__ */ +#endif /* JACK_TRANSPORT_H */ diff --git a/types.h b/types.h index fa84994..d92e54f 100644 --- a/types.h +++ b/types.h @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_types_h__ -#define __jack_types_h__ +#ifndef JACK_TYPES_H +#define JACK_TYPES_H #include #include @@ -526,4 +526,4 @@ enum JackPortFlags { }; -#endif /* __jack_types_h__ */ +#endif /* JACK_TYPES_H */ diff --git a/uuid.h b/uuid.h index 1fb440f..c81af23 100644 --- a/uuid.h +++ b/uuid.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __jack_uuid_h__ -#define __jack_uuid_h__ +#ifndef JACK_UUID_H +#define JACK_UUID_H #include @@ -45,4 +45,4 @@ extern int jack_uuid_empty (jack_uuid_t); } /* namespace */ #endif -#endif /* __jack_uuid_h__ */ +#endif /* JACK_UUID_H */ diff --git a/weakjack.h b/weakjack.h index f967149..c7279af 100644 --- a/weakjack.h +++ b/weakjack.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __weakjack_h__ -#define __weakjack_h__ +#ifndef JACK_WEAKJACK_H +#define JACK_WEAKJACK_H /** * @defgroup WeakLinkage managing support for newer/older versions of JACK @@ -121,4 +121,4 @@ /*@}*/ -#endif /* weakjack */ +#endif /* JACK_WEAKJACK_H */ diff --git a/weakmacros.h b/weakmacros.h index de8ffc9..3201f76 100644 --- a/weakmacros.h +++ b/weakmacros.h @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __weakmacros_h__ -#define __weakmacros_h__ +#ifndef JACK_WEAKMACROS_H +#define JACK_WEAKMACROS_H /************************************************************* * NOTE: JACK_WEAK_EXPORT ***MUST*** be used on every function @@ -63,4 +63,4 @@ #endif /* __GNUC__ */ #endif -#endif /* __weakmacros_h__ */ +#endif /* JACK_WEAKMACROS_H */