diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc index 2341a30d8..d4c45aad8 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.cc +++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc @@ -645,7 +645,7 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, for (i = 0; i < n; i++) { if (!(ext = strrchr(efiles[i], '.'))) continue; - if (strcmp(ext, ".sbs") != 0 && strcmp(ext, ".SBS") && + if (strcmp(ext, ".sbs") != 0 && strcmp(ext, ".SBS") != 0 && strcmp(ext, ".ems") != 0 && strcmp(ext, ".EMS") != 0) continue; readmsgs(efiles[i], sel, ts, te, sbs); diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index fe1a7d533..e2c19cecd 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -682,7 +682,7 @@ void decode_solopt(char *buff, solopt_t *opt) trace(4, "decode_solhead: buff=%s\n", buff); - if (strncmp(buff, COMMENTH, 1) != 0 && strncmp(buff, "+", 1)) return; + if (strncmp(buff, COMMENTH, 1) != 0 && strncmp(buff, "+", 1) != 0) return; if (strstr(buff, "GPST")) opt->times = TIMES_GPST; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index 3a265a6d5..96d81d65a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -141,7 +141,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( d_samples_per_symbol = 0U; d_PRN_code_period_ms = 0U; d_required_symbols = 0U; - d_frame_length_symbols = 0.0; + d_frame_length_symbols = 0U; CodeLength = 0; DataLength = 0; std::cout << "Galileo unified telemetry decoder error: Unknown frame type " << std::endl; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index 33522ddc8..ef2988629 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -38,7 +38,7 @@ #ifndef _rotl -#define _rotl(X, N) ((X << N) ^ (X >> (32 - N))) // Used in the parity check algorithm +#define _rotl(X, N) (((X) << (N)) ^ ((X) >> (32 - (N)))) // Used in the parity check algorithm #endif using google::LogMessage; diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c index bf14cb297..9739c2ab3 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c @@ -95,15 +95,15 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count, unsigned int metric,m0,m1,decision;\ metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1);\ m0 = v->old_metrics[i] + metric;\ - m1 = v->old_metrics[i+32] + (510 - metric);\ + m1 = v->old_metrics[(i)+32] + (510 - metric);\ decision = (signed int)(m0-m1) > 0;\ - v->new_metrics[2*i] = decision ? m1 : m0;\ - d->w[i/16] |= decision << ((2*i)&31);\ + v->new_metrics[2*(i)] = decision ? m1 : m0;\ + d->w[(i)/16] |= decision << ((2*(i))&31);\ m0 -= (metric+metric-510);\ m1 += (metric+metric-510);\ decision = (signed int)(m0-m1) > 0;\ - v->new_metrics[2*i+1] = decision ? m1 : m0;\ - d->w[i/16] |= decision << ((2*i+1)&31);\ + v->new_metrics[2*(i)+1] = decision ? m1 : m0;\ + d->w[(i)/16] |= decision << ((2*(i)+1)&31);\ } /** Update a v27_t decoder with a block of symbols. diff --git a/src/core/libs/supl/asn-rrlp/OCTET_STRING.c b/src/core/libs/supl/asn-rrlp/OCTET_STRING.c index 584def8b4..bd2d1d845 100644 --- a/src/core/libs/supl/asn-rrlp/OCTET_STRING.c +++ b/src/core/libs/supl/asn-rrlp/OCTET_STRING.c @@ -52,9 +52,9 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { #undef NEXT_PHASE #undef PREV_PHASE #define _CH_PHASE(ctx, inc) do { \ - if(ctx->phase == 0) \ - ctx->context = 0; \ - ctx->phase += inc; \ + if((ctx)->phase == 0) \ + (ctx)->context = 0; \ + (ctx)->phase += (inc); \ } while(0) #define NEXT_PHASE(ctx) _CH_PHASE(ctx, +1) #define PREV_PHASE(ctx) _CH_PHASE(ctx, -1) diff --git a/src/core/libs/supl/asn-rrlp/ber_decoder.c b/src/core/libs/supl/asn-rrlp/ber_decoder.c index 601f66c0b..77cb8032e 100644 --- a/src/core/libs/supl/asn-rrlp/ber_decoder.c +++ b/src/core/libs/supl/asn-rrlp/ber_decoder.c @@ -16,7 +16,7 @@ asn_dec_rval_t rval; \ rval.code = _code; \ if(opt_ctx) opt_ctx->step = step; /* Save context */ \ - if(_code == RC_OK || opt_ctx) \ + if((_code) == RC_OK || opt_ctx) \ rval.consumed = consumed_myself; \ else \ rval.consumed = 0; /* Context-free */ \ diff --git a/src/core/libs/supl/asn-rrlp/constr_CHOICE.c b/src/core/libs/supl/asn-rrlp/constr_CHOICE.c index a9eb71941..75903fde7 100644 --- a/src/core/libs/supl/asn-rrlp/constr_CHOICE.c +++ b/src/core/libs/supl/asn-rrlp/constr_CHOICE.c @@ -46,8 +46,8 @@ */ #undef NEXT_PHASE #define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ + (ctx)->phase++; \ + (ctx)->step = 0; \ } while(0) /* diff --git a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c index db3c92581..aba19bd26 100644 --- a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c +++ b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c @@ -47,10 +47,10 @@ #undef NEXT_PHASE #undef PHASE_OUT #define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ + (ctx)->phase++; \ + (ctx)->step = 0; \ } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) +#define PHASE_OUT(ctx) do { (ctx)->phase = 10; } while(0) /* * Return a standardized complex structure. diff --git a/src/core/libs/supl/asn-rrlp/constr_SET_OF.c b/src/core/libs/supl/asn-rrlp/constr_SET_OF.c index 0bc891abf..8b9c0669a 100644 --- a/src/core/libs/supl/asn-rrlp/constr_SET_OF.c +++ b/src/core/libs/supl/asn-rrlp/constr_SET_OF.c @@ -47,10 +47,10 @@ #undef NEXT_PHASE #undef PHASE_OUT #define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ + (ctx)->phase++; \ + (ctx)->step = 0; \ } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) +#define PHASE_OUT(ctx) do { (ctx)->phase = 10; } while(0) /* * Return a standardized complex structure. diff --git a/src/core/libs/supl/asn-rrlp/converter-sample.c b/src/core/libs/supl/asn-rrlp/converter-sample.c index ee4abeb55..46136ebb3 100644 --- a/src/core/libs/supl/asn-rrlp/converter-sample.c +++ b/src/core/libs/supl/asn-rrlp/converter-sample.c @@ -774,11 +774,11 @@ static int write_out(const void *buffer, size_t size, void *key) { } static int argument_is_stdin(char *av[], int idx) { - if(strcmp(av[idx], "-")) { + if(strcmp(av[idx], "-") != 0) { return 0; /* Certainly not */ } else { /* This might be , unless `./program -- -` */ - if(strcmp(av[-1], "--")) + if(strcmp(av[-1], "--") != 0) return 1; else return 0; diff --git a/src/core/libs/supl/asn-rrlp/xer_decoder.c b/src/core/libs/supl/asn-rrlp/xer_decoder.c index 161dc78ce..ef5f06481 100644 --- a/src/core/libs/supl/asn-rrlp/xer_decoder.c +++ b/src/core/libs/supl/asn-rrlp/xer_decoder.c @@ -181,12 +181,12 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { #define XER_GOT_BODY(chunk_buf, chunk_size, size) do { \ ssize_t converted_size = body_receiver \ (struct_key, chunk_buf, chunk_size, \ - (size_t)chunk_size < size); \ + (size_t)(chunk_size) < (size)); \ if(converted_size == -1) RETURN(RC_FAIL); \ if(converted_size == 0 \ - && size == (size_t)chunk_size) \ + && (size) == (size_t)(chunk_size)) \ RETURN(RC_WMORE); \ - chunk_size = converted_size; \ + (chunk_size) = converted_size; \ } while(0) #define XER_GOT_EMPTY() do { \ if(body_receiver(struct_key, 0, 0, size > 0) == -1) \ diff --git a/src/core/libs/supl/asn-rrlp/xer_support.c b/src/core/libs/supl/asn-rrlp/xer_support.c index 9e34e6923..cfa30e674 100644 --- a/src/core/libs/supl/asn-rrlp/xer_support.c +++ b/src/core/libs/supl/asn-rrlp/xer_support.c @@ -60,7 +60,7 @@ _charclass[256] = { #define TOKEN_CB_CALL(type, _ns, _current_too, _final) do { \ int _ret; \ pstate_e ns = _ns; \ - ssize_t _sz = (p - chunk_start) + _current_too; \ + ssize_t _sz = (p - chunk_start) + (_current_too); \ if (!_sz) { \ /* Shortcut */ \ state = _ns; \ @@ -68,11 +68,11 @@ _charclass[256] = { } \ _ret = cb(type, chunk_start, _sz, key); \ if(_ret < _sz) { \ - if(_current_too && _ret == -1) \ + if((_current_too) && _ret == -1) \ state = ns; \ goto finish; \ } \ - chunk_start = p + _current_too; \ + chunk_start = p + (_current_too); \ state = ns; \ } while(0) diff --git a/src/core/libs/supl/asn-supl/GeneralizedTime.c b/src/core/libs/supl/asn-supl/GeneralizedTime.c index 2fd63f262..3007af94e 100644 --- a/src/core/libs/supl/asn-supl/GeneralizedTime.c +++ b/src/core/libs/supl/asn-supl/GeneralizedTime.c @@ -369,7 +369,7 @@ asn_GT2time_frac(const GeneralizedTime_t *st, int *frac_value, int *frac_digits, errno = EINVAL; \ return -1; \ } else { \ - var = var * 10 + (ch - 0x30); \ + (var) = (var) * 10 + (ch - 0x30); \ buf++; \ } \ } while(0) diff --git a/src/core/libs/supl/asn-supl/OCTET_STRING.c b/src/core/libs/supl/asn-supl/OCTET_STRING.c index 584def8b4..bd2d1d845 100644 --- a/src/core/libs/supl/asn-supl/OCTET_STRING.c +++ b/src/core/libs/supl/asn-supl/OCTET_STRING.c @@ -52,9 +52,9 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = { #undef NEXT_PHASE #undef PREV_PHASE #define _CH_PHASE(ctx, inc) do { \ - if(ctx->phase == 0) \ - ctx->context = 0; \ - ctx->phase += inc; \ + if((ctx)->phase == 0) \ + (ctx)->context = 0; \ + (ctx)->phase += (inc); \ } while(0) #define NEXT_PHASE(ctx) _CH_PHASE(ctx, +1) #define PREV_PHASE(ctx) _CH_PHASE(ctx, -1) diff --git a/src/core/libs/supl/asn-supl/ber_decoder.c b/src/core/libs/supl/asn-supl/ber_decoder.c index 601f66c0b..77cb8032e 100644 --- a/src/core/libs/supl/asn-supl/ber_decoder.c +++ b/src/core/libs/supl/asn-supl/ber_decoder.c @@ -16,7 +16,7 @@ asn_dec_rval_t rval; \ rval.code = _code; \ if(opt_ctx) opt_ctx->step = step; /* Save context */ \ - if(_code == RC_OK || opt_ctx) \ + if((_code) == RC_OK || opt_ctx) \ rval.consumed = consumed_myself; \ else \ rval.consumed = 0; /* Context-free */ \ diff --git a/src/core/libs/supl/asn-supl/constr_CHOICE.c b/src/core/libs/supl/asn-supl/constr_CHOICE.c index a9eb71941..75903fde7 100644 --- a/src/core/libs/supl/asn-supl/constr_CHOICE.c +++ b/src/core/libs/supl/asn-supl/constr_CHOICE.c @@ -46,8 +46,8 @@ */ #undef NEXT_PHASE #define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ + (ctx)->phase++; \ + (ctx)->step = 0; \ } while(0) /* diff --git a/src/core/libs/supl/asn-supl/constr_SEQUENCE.c b/src/core/libs/supl/asn-supl/constr_SEQUENCE.c index db3c92581..aba19bd26 100644 --- a/src/core/libs/supl/asn-supl/constr_SEQUENCE.c +++ b/src/core/libs/supl/asn-supl/constr_SEQUENCE.c @@ -47,10 +47,10 @@ #undef NEXT_PHASE #undef PHASE_OUT #define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ + (ctx)->phase++; \ + (ctx)->step = 0; \ } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) +#define PHASE_OUT(ctx) do { (ctx)->phase = 10; } while(0) /* * Return a standardized complex structure. diff --git a/src/core/libs/supl/asn-supl/constr_SET_OF.c b/src/core/libs/supl/asn-supl/constr_SET_OF.c index 0bc891abf..8b9c0669a 100644 --- a/src/core/libs/supl/asn-supl/constr_SET_OF.c +++ b/src/core/libs/supl/asn-supl/constr_SET_OF.c @@ -47,10 +47,10 @@ #undef NEXT_PHASE #undef PHASE_OUT #define NEXT_PHASE(ctx) do { \ - ctx->phase++; \ - ctx->step = 0; \ + (ctx)->phase++; \ + (ctx)->step = 0; \ } while(0) -#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0) +#define PHASE_OUT(ctx) do { (ctx)->phase = 10; } while(0) /* * Return a standardized complex structure. diff --git a/src/core/libs/supl/asn-supl/xer_decoder.c b/src/core/libs/supl/asn-supl/xer_decoder.c index 161dc78ce..ef5f06481 100644 --- a/src/core/libs/supl/asn-supl/xer_decoder.c +++ b/src/core/libs/supl/asn-supl/xer_decoder.c @@ -181,12 +181,12 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) { #define XER_GOT_BODY(chunk_buf, chunk_size, size) do { \ ssize_t converted_size = body_receiver \ (struct_key, chunk_buf, chunk_size, \ - (size_t)chunk_size < size); \ + (size_t)(chunk_size) < (size)); \ if(converted_size == -1) RETURN(RC_FAIL); \ if(converted_size == 0 \ - && size == (size_t)chunk_size) \ + && (size) == (size_t)(chunk_size)) \ RETURN(RC_WMORE); \ - chunk_size = converted_size; \ + (chunk_size) = converted_size; \ } while(0) #define XER_GOT_EMPTY() do { \ if(body_receiver(struct_key, 0, 0, size > 0) == -1) \ diff --git a/src/core/libs/supl/asn-supl/xer_support.c b/src/core/libs/supl/asn-supl/xer_support.c index 9e34e6923..cfa30e674 100644 --- a/src/core/libs/supl/asn-supl/xer_support.c +++ b/src/core/libs/supl/asn-supl/xer_support.c @@ -60,7 +60,7 @@ _charclass[256] = { #define TOKEN_CB_CALL(type, _ns, _current_too, _final) do { \ int _ret; \ pstate_e ns = _ns; \ - ssize_t _sz = (p - chunk_start) + _current_too; \ + ssize_t _sz = (p - chunk_start) + (_current_too); \ if (!_sz) { \ /* Shortcut */ \ state = _ns; \ @@ -68,11 +68,11 @@ _charclass[256] = { } \ _ret = cb(type, chunk_start, _sz, key); \ if(_ret < _sz) { \ - if(_current_too && _ret == -1) \ + if((_current_too) && _ret == -1) \ state = ns; \ goto finish; \ } \ - chunk_start = p + _current_too; \ + chunk_start = p + (_current_too); \ state = ns; \ } while(0)