mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-28 18:04:51 +00:00
Apply google-readability-casting check
This commit is contained in:
parent
4f9cfedc62
commit
1c67a10936
@ -50,7 +50,7 @@ ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td
|
||||
}
|
||||
|
||||
rval = NativeEnumerated_decode_uper(opt_codec_ctx, td, constraints,
|
||||
(void **)&vptr, pd);
|
||||
&vptr, pd);
|
||||
if(rval.code == RC_OK)
|
||||
if(asn_long2INTEGER(st, value))
|
||||
rval.code = RC_FAIL;
|
||||
|
@ -121,7 +121,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
rval.consumed += length;
|
||||
|
||||
ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
|
||||
(long)rval.consumed, (long)length, td->name, (long)*native);
|
||||
(long)rval.consumed, (long)length, td->name, *native);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -249,9 +249,9 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
|
||||
|
||||
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
|
||||
(long)(sel?sel->left:0),
|
||||
(sel?sel->left:0),
|
||||
(long)(sel?sel->want_nulls:0),
|
||||
(long)(sel?sel->got:0)
|
||||
(sel?sel->got:0)
|
||||
);
|
||||
if(sel && sel->left <= 0 && sel->want_nulls == 0) {
|
||||
if(sel->prev) {
|
||||
@ -275,7 +275,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
|
||||
ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
|
||||
(long)size, (long)Left, sel?"":"!",
|
||||
(long)(sel?sel->left:0),
|
||||
(sel?sel->left:0),
|
||||
(long)(sel?sel->want_nulls:0),
|
||||
(long)tl);
|
||||
switch(tl) {
|
||||
@ -1273,7 +1273,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
|
||||
int code;
|
||||
uint32_t value;
|
||||
switch(bpc) {
|
||||
case 1: value = *(const uint8_t *)buf; break;
|
||||
case 1: value = *buf; break;
|
||||
case 2: value = (buf[0] << 8) | buf[1]; break;
|
||||
case 4: value = (buf[0] << 24) | (buf[1] << 16)
|
||||
| (buf[2] << 8) | buf[3]; break;
|
||||
@ -1300,7 +1300,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
|
||||
int ch;
|
||||
uint32_t value;
|
||||
switch(bpc) {
|
||||
case 1: value = *(const uint8_t *)buf; break;
|
||||
case 1: value = *buf; break;
|
||||
case 2: value = (buf[0] << 8) | buf[1]; break;
|
||||
case 4: value = (buf[0] << 24) | (buf[1] << 16)
|
||||
| (buf[2] << 8) | buf[3]; break;
|
||||
|
@ -131,7 +131,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx,
|
||||
case 0: RETURN(RC_WMORE);
|
||||
}
|
||||
ASN_DEBUG("Advancing %ld in ANY case",
|
||||
(long)(tag_len + len_len));
|
||||
(tag_len + len_len));
|
||||
ADVANCE(tag_len + len_len);
|
||||
} else {
|
||||
assert(tagno < td->tags_count); /* At least one loop */
|
||||
|
@ -15,7 +15,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
|
||||
if(size == 0)
|
||||
return 0; /* Want more */
|
||||
|
||||
oct = *(const uint8_t *)buf;
|
||||
oct = *buf;
|
||||
if((oct & 0x80) == 0) {
|
||||
/*
|
||||
* Short definite length.
|
||||
|
@ -629,20 +629,20 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na
|
||||
switch(iform) {
|
||||
case INP_BER:
|
||||
rval = ber_decode(opt_codec_ctx, pduType,
|
||||
(void **)&structure, i_bptr, i_size);
|
||||
&structure, i_bptr, i_size);
|
||||
break;
|
||||
case INP_XER:
|
||||
rval = xer_decode(opt_codec_ctx, pduType,
|
||||
(void **)&structure, i_bptr, i_size);
|
||||
&structure, i_bptr, i_size);
|
||||
break;
|
||||
case INP_PER:
|
||||
if(opt_nopad)
|
||||
rval = uper_decode(opt_codec_ctx, pduType,
|
||||
(void **)&structure, i_bptr, i_size, 0,
|
||||
&structure, i_bptr, i_size, 0,
|
||||
DynamicBuffer.unbits);
|
||||
else
|
||||
rval = uper_decode_complete(opt_codec_ctx, pduType,
|
||||
(void **)&structure, i_bptr, i_size);
|
||||
&structure, i_bptr, i_size);
|
||||
switch(rval.code) {
|
||||
case RC_OK:
|
||||
/* Fall through */
|
||||
|
@ -50,7 +50,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
if(!pd->refill || nbits > 31) return -1;
|
||||
/* Accumulate unused bytes before refill */
|
||||
ASN_DEBUG("Obtain the rest %d bits (want %d)",
|
||||
(int)nleft, (int)nbits);
|
||||
(int)nleft, nbits);
|
||||
tailv = per_get_few_bits(pd, nleft);
|
||||
if(tailv < 0) return -1;
|
||||
/* Refill (replace pd contents with new data) */
|
||||
@ -105,7 +105,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
accum &= (((uint32_t)1 << nbits) - 1);
|
||||
|
||||
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
|
||||
(int)nbits, (int)nleft,
|
||||
nbits, (int)nleft,
|
||||
(int)pd->moved,
|
||||
(((long)pd->buffer) & 0xf),
|
||||
(int)pd->nboff, (int)pd->nbits,
|
||||
@ -429,7 +429,7 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||
|
||||
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
|
||||
(int)bits, (int)bits, buf[0],
|
||||
(long)(po->buffer - po->tmpspace));
|
||||
(po->buffer - po->tmpspace));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td
|
||||
}
|
||||
|
||||
rval = NativeEnumerated_decode_uper(opt_codec_ctx, td, constraints,
|
||||
(void **)&vptr, pd);
|
||||
&vptr, pd);
|
||||
if(rval.code == RC_OK)
|
||||
if(asn_long2INTEGER(st, value))
|
||||
rval.code = RC_FAIL;
|
||||
|
@ -59,7 +59,7 @@ IA5String_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
"%s: value byte %ld out of range: "
|
||||
"%d > 127 (%s:%d)",
|
||||
td->name,
|
||||
(long)((buf - st->buf) + 1),
|
||||
((buf - st->buf) + 1),
|
||||
*buf,
|
||||
__FILE__, __LINE__);
|
||||
return -1;
|
||||
|
@ -121,7 +121,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
rval.consumed += length;
|
||||
|
||||
ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
|
||||
(long)rval.consumed, (long)length, td->name, (long)*native);
|
||||
(long)rval.consumed, (long)length, td->name, *native);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -249,9 +249,9 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
|
||||
|
||||
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
|
||||
(long)(sel?sel->left:0),
|
||||
(sel?sel->left:0),
|
||||
(long)(sel?sel->want_nulls:0),
|
||||
(long)(sel?sel->got:0)
|
||||
(sel?sel->got:0)
|
||||
);
|
||||
if(sel && sel->left <= 0 && sel->want_nulls == 0) {
|
||||
if(sel->prev) {
|
||||
@ -275,7 +275,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
|
||||
ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
|
||||
(long)size, (long)Left, sel?"":"!",
|
||||
(long)(sel?sel->left:0),
|
||||
(sel?sel->left:0),
|
||||
(long)(sel?sel->want_nulls:0),
|
||||
(long)tl);
|
||||
switch(tl) {
|
||||
@ -1273,7 +1273,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
|
||||
int code;
|
||||
uint32_t value;
|
||||
switch(bpc) {
|
||||
case 1: value = *(const uint8_t *)buf; break;
|
||||
case 1: value = *buf; break;
|
||||
case 2: value = (buf[0] << 8) | buf[1]; break;
|
||||
case 4: value = (buf[0] << 24) | (buf[1] << 16)
|
||||
| (buf[2] << 8) | buf[3]; break;
|
||||
@ -1300,7 +1300,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
|
||||
int ch;
|
||||
uint32_t value;
|
||||
switch(bpc) {
|
||||
case 1: value = *(const uint8_t *)buf; break;
|
||||
case 1: value = *buf; break;
|
||||
case 2: value = (buf[0] << 8) | buf[1]; break;
|
||||
case 4: value = (buf[0] << 24) | (buf[1] << 16)
|
||||
| (buf[2] << 8) | buf[3]; break;
|
||||
|
@ -62,7 +62,7 @@ VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
"%s: value byte %ld (%d) "
|
||||
"not in VisibleString alphabet (%s:%d)",
|
||||
td->name,
|
||||
(long)((buf - st->buf) + 1),
|
||||
((buf - st->buf) + 1),
|
||||
*buf,
|
||||
__FILE__, __LINE__);
|
||||
return -1;
|
||||
|
@ -131,7 +131,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx,
|
||||
case 0: RETURN(RC_WMORE);
|
||||
}
|
||||
ASN_DEBUG("Advancing %ld in ANY case",
|
||||
(long)(tag_len + len_len));
|
||||
(tag_len + len_len));
|
||||
ADVANCE(tag_len + len_len);
|
||||
} else {
|
||||
assert(tagno < td->tags_count); /* At least one loop */
|
||||
|
@ -15,7 +15,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
|
||||
if(size == 0)
|
||||
return 0; /* Want more */
|
||||
|
||||
oct = *(const uint8_t *)buf;
|
||||
oct = *buf;
|
||||
if((oct & 0x80) == 0) {
|
||||
/*
|
||||
* Short definite length.
|
||||
|
@ -50,7 +50,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
if(!pd->refill || nbits > 31) return -1;
|
||||
/* Accumulate unused bytes before refill */
|
||||
ASN_DEBUG("Obtain the rest %d bits (want %d)",
|
||||
(int)nleft, (int)nbits);
|
||||
(int)nleft, nbits);
|
||||
tailv = per_get_few_bits(pd, nleft);
|
||||
if(tailv < 0) return -1;
|
||||
/* Refill (replace pd contents with new data) */
|
||||
@ -105,7 +105,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
|
||||
accum &= (((uint32_t)1 << nbits) - 1);
|
||||
|
||||
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
|
||||
(int)nbits, (int)nleft,
|
||||
nbits, (int)nleft,
|
||||
(int)pd->moved,
|
||||
(((long)pd->buffer) & 0xf),
|
||||
(int)pd->nboff, (int)pd->nbits,
|
||||
@ -429,7 +429,7 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||
|
||||
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
|
||||
(int)bits, (int)bits, buf[0],
|
||||
(long)(po->buffer - po->tmpspace));
|
||||
(po->buffer - po->tmpspace));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ int EXPORT supl_ulp_encode(supl_ulp_t *pdu)
|
||||
memset(pdu->buffer, 0, sizeof(pdu->buffer));
|
||||
|
||||
pdu_len = (ret.encoded + 7) >> 3;
|
||||
((ULP_PDU_t *)pdu->pdu)->length = pdu_len;
|
||||
(pdu->pdu)->length = pdu_len;
|
||||
|
||||
ret = uper_encode_to_buffer(&asn_DEF_ULP_PDU, pdu->pdu, pdu->buffer, sizeof(pdu->buffer));
|
||||
if (ret.encoded > 0)
|
||||
@ -249,7 +249,7 @@ int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server)
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
// meth = TLSv1_client_method();
|
||||
meth = (SSL_METHOD *)SSLv23_client_method();
|
||||
meth = SSLv23_client_method();
|
||||
SSL_load_error_strings();
|
||||
ctx->ssl_ctx = SSL_CTX_new(meth);
|
||||
if (!ctx->ssl_ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user