From f24064e245aaafa9c330a0d0242a8f65279475f2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 6 Nov 2020 10:41:20 +0100 Subject: [PATCH] Fixes for changed behavior of clang-format --- src/algorithms/libs/rtklib/rtklib.h | 2 ++ src/algorithms/libs/rtklib/rtklib_rtkpos.h | 2 ++ src/core/interfaces/gnss_block_interface.h | 4 +++- src/core/libs/supl/asn-rrlp/NativeInteger.c | 2 ++ src/core/libs/supl/asn-rrlp/asn_internal.h | 2 ++ src/core/libs/supl/asn-rrlp/asn_system.h | 2 ++ src/core/libs/supl/asn-rrlp/xer_support.c | 2 ++ src/core/libs/supl/asn-supl/GeneralizedTime.c | 3 ++- src/core/libs/supl/asn-supl/NativeInteger.c | 2 ++ src/core/libs/supl/asn-supl/asn_internal.h | 2 ++ src/core/libs/supl/asn-supl/asn_system.h | 2 ++ src/core/libs/supl/asn-supl/xer_support.c | 2 ++ src/tests/common-files/gnuplot_i.h | 2 ++ 13 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index 9db2b161e..117a1b26f 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -326,6 +326,7 @@ const int MAXSTRMSG = 1024; //!< max length of stream message using fatalfunc_t = void(const char *); //!< fatal callback function type +// clang-format off #define STR_MODE_R 0x1 /* stream mode: read */ #define STR_MODE_W 0x2 /* stream mode: write */ #define STR_MODE_RW 0x3 /* stream mode: read/write */ @@ -347,6 +348,7 @@ using fatalfunc_t = void(const char *); //!< fatal callback function type #define NR_PPP(opt) (IT_PPP(opt) + ((opt)->tropopt < TROPOPT_EST ? 0 : ((opt)->tropopt == TROPOPT_EST ? 1 : 3))) /* number of solutions */ #define IB_PPP(s, opt) (NR_PPP(opt) + (s)-1) /* state index of phase bias */ #define NX_PPP(opt) (IB_PPP(MAXSAT, opt) + 1) /* number of estimated states */ +// clang-format on #define NF_RTK(opt) ((opt)->ionoopt == IONOOPT_IFLC ? 1 : (opt)->nf) #define NP_RTK(opt) ((opt)->dynamics == 0 ? 3 : 9) diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.h b/src/algorithms/libs/rtklib/rtklib_rtkpos.h index d99149455..acdadfa51 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.h @@ -63,10 +63,12 @@ const double TTOL_MOVEB = (1.0 + 2 * DTTOL); /* state variable index */ +// clang-format off #define II_RTK(s, opt) (NP_RTK(opt) + (s)-1) /* ionos (s:satellite no) */ #define IT_RTK(r, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) / 2 * (r)) /* tropos (r:0=rov,1:ref) */ #define IL_RTK(f, opt) (NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt) + (f)) /* receiver h/w bias */ #define IB_RTK(s, f, opt) (NR_RTK(opt) + MAXSAT * (f) + (s)-1) /* phase bias (s:satno,f:freq) */ +// clang-format on int rtkopenstat(const char *file, int level); diff --git a/src/core/interfaces/gnss_block_interface.h b/src/core/interfaces/gnss_block_interface.h index a8b1368da..a3e100a88 100644 --- a/src/core/interfaces/gnss_block_interface.h +++ b/src/core/interfaces/gnss_block_interface.h @@ -36,7 +36,7 @@ /** \addtogroup GNSS_Block_Interfaces * \{ */ - +// clang-format off #if GNURADIO_USES_STD_POINTERS #include template @@ -57,6 +57,8 @@ gnss_shared_ptr gnss_make_shared(Args &&... args) return boost::make_shared(std::forward(args)...); } #endif +// clang-format on + /*! * \brief This abstract class represents an interface to GNSS blocks. diff --git a/src/core/libs/supl/asn-rrlp/NativeInteger.c b/src/core/libs/supl/asn-rrlp/NativeInteger.c index 62c7c867a..3620b506d 100644 --- a/src/core/libs/supl/asn-rrlp/NativeInteger.c +++ b/src/core/libs/supl/asn-rrlp/NativeInteger.c @@ -132,6 +132,7 @@ asn_dec_rval_t NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, return rval; } +// clang-format off /* * Encode the NativeInteger using the standard INTEGER type DER encoder. */ @@ -172,6 +173,7 @@ asn_enc_rval_t NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, } return erval; } +// clang-format on /* * Decode the chunk of XML text encoding INTEGER. diff --git a/src/core/libs/supl/asn-rrlp/asn_internal.h b/src/core/libs/supl/asn-rrlp/asn_internal.h index f418bbcc7..20edeab1a 100644 --- a/src/core/libs/supl/asn-rrlp/asn_internal.h +++ b/src/core/libs/supl/asn-rrlp/asn_internal.h @@ -19,6 +19,7 @@ extern "C" { #endif +// clang-format off /* Environment version might be used to avoid running with the old library */ #define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */ int get_asn1c_environment_version(void); /* Run-time version */ @@ -60,6 +61,7 @@ extern "C" } #endif /* EMIT_ASN_DEBUG */ #endif /* ASN_DEBUG */ +// clang-format on /* * Invoke the application-supplied callback and fail, if something is wrong. diff --git a/src/core/libs/supl/asn-rrlp/asn_system.h b/src/core/libs/supl/asn-rrlp/asn_system.h index 207f3ec4e..0b462b6eb 100644 --- a/src/core/libs/supl/asn-rrlp/asn_system.h +++ b/src/core/libs/supl/asn-rrlp/asn_system.h @@ -61,6 +61,7 @@ typedef unsigned int uint32_t; #include #else /* !defined(__vxworks) */ +// clang-format off #include /* C99 specifies this file */ /* * 1. Earlier FreeBSD version didn't have , @@ -127,5 +128,6 @@ typedef unsigned int uint32_t; #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ #endif /* __GNUC__ */ #endif /* MIN */ +// clang-format on #endif /* _ASN_SYSTEM_H_ */ diff --git a/src/core/libs/supl/asn-rrlp/xer_support.c b/src/core/libs/supl/asn-rrlp/xer_support.c index 20feb6c69..781319b2c 100644 --- a/src/core/libs/supl/asn-rrlp/xer_support.c +++ b/src/core/libs/supl/asn-rrlp/xer_support.c @@ -44,6 +44,7 @@ static int _charclass[256] = { #define ALPHA(c) (_charclass[(unsigned char)(c)] == 3) /* Aliases for characters, ASCII/UTF-8 */ +// clang-format off #define EXCLAM 0x21 /* '!' */ #define CQUOTE 0x22 /* '"' */ #define CDASH 0x2d /* '-' */ @@ -52,6 +53,7 @@ static int _charclass[256] = { #define CEQUAL 0x3d /* '=' */ #define RANGLE 0x3e /* '>' */ #define CQUEST 0x3f /* '?' */ +// clang-format on /* Invoke token callback */ #define TOKEN_CB_CALL(type, _ns, _current_too, _final) \ diff --git a/src/core/libs/supl/asn-supl/GeneralizedTime.c b/src/core/libs/supl/asn-supl/GeneralizedTime.c index c22a47ee3..4bc2f6e37 100644 --- a/src/core/libs/supl/asn-supl/GeneralizedTime.c +++ b/src/core/libs/supl/asn-supl/GeneralizedTime.c @@ -759,6 +759,7 @@ GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *opt_gt, gmtoff = GMTOFF(*tm); + // clang-format off if (force_gmt && gmtoff) { tm_s = *tm; @@ -771,7 +772,7 @@ GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *opt_gt, gmtoff = 0; #endif } - + // clang-format on size = snprintf(buf, buf_size, "%04d%02d%02d%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); diff --git a/src/core/libs/supl/asn-supl/NativeInteger.c b/src/core/libs/supl/asn-supl/NativeInteger.c index 088d44c8f..a366f33cd 100644 --- a/src/core/libs/supl/asn-supl/NativeInteger.c +++ b/src/core/libs/supl/asn-supl/NativeInteger.c @@ -132,6 +132,7 @@ asn_dec_rval_t NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, return rval; } +// clang-format off /* * Encode the NativeInteger using the standard INTEGER type DER encoder. */ @@ -172,6 +173,7 @@ asn_enc_rval_t NativeInteger_encode_der(asn_TYPE_descriptor_t *sd, void *ptr, } return erval; } +// clang-format on /* * Decode the chunk of XML text encoding INTEGER. diff --git a/src/core/libs/supl/asn-supl/asn_internal.h b/src/core/libs/supl/asn-supl/asn_internal.h index f418bbcc7..20edeab1a 100644 --- a/src/core/libs/supl/asn-supl/asn_internal.h +++ b/src/core/libs/supl/asn-supl/asn_internal.h @@ -19,6 +19,7 @@ extern "C" { #endif +// clang-format off /* Environment version might be used to avoid running with the old library */ #define ASN1C_ENVIRONMENT_VERSION 922 /* Compile-time version */ int get_asn1c_environment_version(void); /* Run-time version */ @@ -60,6 +61,7 @@ extern "C" } #endif /* EMIT_ASN_DEBUG */ #endif /* ASN_DEBUG */ +// clang-format on /* * Invoke the application-supplied callback and fail, if something is wrong. diff --git a/src/core/libs/supl/asn-supl/asn_system.h b/src/core/libs/supl/asn-supl/asn_system.h index 207f3ec4e..0b462b6eb 100644 --- a/src/core/libs/supl/asn-supl/asn_system.h +++ b/src/core/libs/supl/asn-supl/asn_system.h @@ -61,6 +61,7 @@ typedef unsigned int uint32_t; #include #else /* !defined(__vxworks) */ +// clang-format off #include /* C99 specifies this file */ /* * 1. Earlier FreeBSD version didn't have , @@ -127,5 +128,6 @@ typedef unsigned int uint32_t; #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* Unsafe variant */ #endif /* __GNUC__ */ #endif /* MIN */ +// clang-format on #endif /* _ASN_SYSTEM_H_ */ diff --git a/src/core/libs/supl/asn-supl/xer_support.c b/src/core/libs/supl/asn-supl/xer_support.c index 20feb6c69..781319b2c 100644 --- a/src/core/libs/supl/asn-supl/xer_support.c +++ b/src/core/libs/supl/asn-supl/xer_support.c @@ -44,6 +44,7 @@ static int _charclass[256] = { #define ALPHA(c) (_charclass[(unsigned char)(c)] == 3) /* Aliases for characters, ASCII/UTF-8 */ +// clang-format off #define EXCLAM 0x21 /* '!' */ #define CQUOTE 0x22 /* '"' */ #define CDASH 0x2d /* '-' */ @@ -52,6 +53,7 @@ static int _charclass[256] = { #define CEQUAL 0x3d /* '=' */ #define RANGLE 0x3e /* '>' */ #define CQUEST 0x3f /* '?' */ +// clang-format on /* Invoke token callback */ #define TOKEN_CB_CALL(type, _ns, _current_too, _final) \ diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 5ef075906..03d5380c9 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -53,8 +53,10 @@ DEFINE_bool(show_plots, true, "Show plots on screen. Disable for non-interactive #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) // defined for 32 and 64-bit environments +// clang-format off #include // for _access(), _mktemp() #define GP_MAX_TMP_FILES 27 // 27 temporary files it's Microsoft restriction +// clang-format on #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) // all UNIX-like OSs (Linux, *BSD, macOS, Solaris, ...) #include // for access(), mkstemp()