1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Miscelaneous clang-tidy fixes

This commit is contained in:
Carles Fernandez 2018-12-14 02:14:43 +01:00
parent fa03077ca1
commit 432c6b9c70
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
21 changed files with 48 additions and 48 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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.

View File

@ -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)

View File

@ -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 */ \

View File

@ -46,8 +46,8 @@
*/
#undef NEXT_PHASE
#define NEXT_PHASE(ctx) do { \
ctx->phase++; \
ctx->step = 0; \
(ctx)->phase++; \
(ctx)->step = 0; \
} while(0)
/*

View File

@ -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.

View File

@ -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.

View File

@ -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 <stdin> */
} else {
/* This might be <stdin>, unless `./program -- -` */
if(strcmp(av[-1], "--"))
if(strcmp(av[-1], "--") != 0)
return 1;
else
return 0;

View File

@ -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) \

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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 */ \

View File

@ -46,8 +46,8 @@
*/
#undef NEXT_PHASE
#define NEXT_PHASE(ctx) do { \
ctx->phase++; \
ctx->step = 0; \
(ctx)->phase++; \
(ctx)->step = 0; \
} while(0)
/*

View File

@ -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.

View File

@ -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.

View File

@ -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) \

View File

@ -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)