aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2023-07-17 11:40:07 +0200
committerOliver Smith <osmith@sysmocom.de>2023-07-17 11:41:18 +0200
commitf32502e9c9f4dacc89cdd26d4fddab2ef5d3685f (patch)
treebebf08735b30adc311515161627b5878dcb2a79c
parent74e999ceb2b49cf499c00799fae4b5069e4b2e7c (diff)
skeletons: fix misleading indentationsosmo-iuh/master
After upgrading our CI environment to use Debian 12 with GCC 12, it complains about the following misleading indentations in generated code in osmo-remsim.git. Fix it to be able to compile with --enable-werror again. ../../../../src/osmo-remsim/src/rspro/INTEGER.c: In function ‘INTEGER_decode_aper’: ../../../../src/osmo-remsim/src/rspro/INTEGER.c:774:33: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 774 | if((specs && specs->field_unsigned) | ^~ ../../../../src/osmo-remsim/src/rspro/INTEGER.c:778:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by t he ‘if’ 778 | ASN_DEBUG("Got value %ld + low %lld", | ^~~~~~~~~ cc1: all warnings being treated as errors ../../../../src/osmo-remsim/src/rspro/constr_CHOICE.c: In function ‘CHOICE_encode_aper’: ../../../../src/osmo-remsim/src/rspro/constr_CHOICE.c:1134:17: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 1134 | if(per_put_few_bits(po, present, ct->range_bits)) | ^~ ../../../../src/osmo-remsim/src/rspro/constr_CHOICE.c:1137:25: note: ...this statement, but the latter is misleadingly indented as if it were guard ed by the ‘if’ 1137 | return elm->type->aper_encoder(elm->type, elm->per_constraints, | ^~~~~~ cc1: all warnings being treated as errors ../../../../src/osmo-remsim/src/rspro/per_decoder.c: In function ‘aper_decode’: ../../../../src/osmo-remsim/src/rspro/per_decoder.c:161:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 161 | if(!td->aper_decoder) | ^~ ../../../../src/osmo-remsim/src/rspro/per_decoder.c:163:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 163 | rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd); | ^~~~ Related: OS#6057 Change-Id: I2260df8f8ab8eaf5c2aac3c330f87dba4691c01e
-rw-r--r--skeletons/INTEGER.c4
-rw-r--r--skeletons/constr_CHOICE.c4
-rw-r--r--skeletons/per_decoder.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/skeletons/INTEGER.c b/skeletons/INTEGER.c
index b3f0da12..042fd75e 100644
--- a/skeletons/INTEGER.c
+++ b/skeletons/INTEGER.c
@@ -775,8 +775,8 @@ INTEGER_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
? asn_ulong2INTEGER(st, value)
: asn_long2INTEGER(st, value))
_ASN_DECODE_FAILED;
- ASN_DEBUG("Got value %ld + low %lld",
- value, ct->lower_bound);
+ ASN_DEBUG("Got value %ld + low %lld",
+ value, ct->lower_bound);
}
return rval;
} else {
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 6a88b296..4e95e1d7 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -1134,8 +1134,8 @@ CHOICE_encode_aper(asn_TYPE_descriptor_t *td,
if(per_put_few_bits(po, present, ct->range_bits))
_ASN_ENCODE_FAILED;
- return elm->type->aper_encoder(elm->type, elm->per_constraints,
- memb_ptr, po);
+ return elm->type->aper_encoder(elm->type, elm->per_constraints,
+ memb_ptr, po);
} else {
asn_enc_rval_t rval;
if(specs->ext_start == -1)
diff --git a/skeletons/per_decoder.c b/skeletons/per_decoder.c
index 20fe1a1d..b5056b52 100644
--- a/skeletons/per_decoder.c
+++ b/skeletons/per_decoder.c
@@ -160,7 +160,7 @@ aper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sp
*/
if(!td->aper_decoder)
_ASN_DECODE_FAILED; /* PER is not compiled in */
- rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
+ rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
if(rval.code == RC_OK) {
/* Return the number of consumed bits */
rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)