Compare commits

...

2 Commits

Author SHA1 Message Date
Oliver Smith f32502e9c9 skeletons: fix misleading indentations
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
2023-07-17 11:41:18 +02:00
Oliver Smith 74e999ceb2 skeletons: fix various typos
These typos have been fixed in the generated rspro code in
osmo-remsim.git. Fix them here as well, so when regenerating the code we
don't re-introduce the typos.

Change-Id: I9e2fa5a2e0c2bf153f67c1ae363baa1abb44f7ad
2023-07-17 11:40:38 +02:00
14 changed files with 19 additions and 19 deletions

View File

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

View File

@ -68,8 +68,8 @@ enum asn_strtol_result_e {
ASN_STRTOL_ERROR_RANGE = -3, /* Input outside of numeric range for long type */
ASN_STRTOL_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */
ASN_STRTOL_EXPECT_MORE = -1, /* More data expected (e.g. "+") */
ASN_STRTOL_OK = 0, /* Conversion succeded, number ends at (*end) */
ASN_STRTOL_EXTRA_DATA = 1, /* Conversion succeded, but the string has extra stuff */
ASN_STRTOL_OK = 0, /* Conversion succeeded, number ends at (*end) */
ASN_STRTOL_EXTRA_DATA = 1, /* Conversion succeeded, but the string has extra stuff */
};
enum asn_strtol_result_e asn_strtol_lim(const char *str, const char **end, long *l);

View File

@ -94,7 +94,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
/*
* ASN.1 encoded INTEGER: buf_ptr, length
* Fill the native, at the same time checking for overflow.
* If overflow occured, return with RC_FAIL.
* If overflow occurred, return with RC_FAIL.
*/
{
INTEGER_t tmp;

View File

@ -109,7 +109,7 @@ asn_TYPE_descriptor_t asn_DEF_OCTET_STRING = {
/*
* The main reason why ASN.1 is still alive is that too much time and effort
* is necessary for learning it more or less adequately, thus creating a gut
* necessity to demonstrate that aquired skill everywhere afterwards.
* necessity to demonstrate that acquired skill everywhere afterwards.
* No, I am not going to explain what the following stuff is.
*/
struct _stack_el {

View File

@ -42,7 +42,7 @@ ber_fetch_tag(const void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
*/
if(val >> ((8 * sizeof(val)) - 9)) {
/*
* We would not be able to accomodate
* We would not be able to accommodate
* any more tag bits.
*/
return -1;

View File

@ -156,7 +156,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
if(ctx->left >= 0) {
/* ?Substracted below! */
/* ?Subtracted below! */
ctx->left += rval.consumed;
}
ADVANCE(rval.consumed);
@ -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)

View File

@ -166,7 +166,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
if(ctx->left >= 0)
ctx->left += rval.consumed; /* ?Substracted below! */
ctx->left += rval.consumed; /* ?Subtracted below! */
ADVANCE(rval.consumed);
NEXT_PHASE(ctx);

View File

@ -154,7 +154,7 @@ SET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
if(ctx->left >= 0)
ctx->left += rval.consumed; /* ?Substracted below! */
ctx->left += rval.consumed; /* ?Subtracted below! */
ADVANCE(rval.consumed);
NEXT_PHASE(ctx);

View File

@ -122,7 +122,7 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
if(ctx->left >= 0)
ctx->left += rval.consumed; /* ?Substracted below! */
ctx->left += rval.consumed; /* ?Subtracted below! */
ADVANCE(rval.consumed);
ASN_DEBUG("Structure consumes %ld bytes, "

View File

@ -158,8 +158,8 @@ typedef struct asn_TYPE_member_s {
typedef struct asn_TYPE_tag2member_s {
ber_tlv_tag_t el_tag; /* Outmost tag of the member */
int el_no; /* Index of the associated member, base 0 */
int toff_first; /* First occurence of the el_tag, relative */
int toff_last; /* Last occurence of the el_tag, relatvie */
int toff_first; /* First occurrence of the el_tag, relative */
int toff_last; /* Last occurrence of the el_tag, relatvie */
} asn_TYPE_tag2member_t;
/*

View File

@ -390,7 +390,7 @@ buffer_dump() {
/*
* Move the buffer content left N bits, possibly joining it with
* preceeding content.
* preceding content.
*/
static void
buffer_shift_left(size_t offset, int bits) {

View File

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

View File

@ -154,7 +154,7 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
} else {
FREEMEM(buf);
/* rv.code could be RC_WMORE, nonsense in this context */
rv.code = RC_FAIL; /* Noone would give us more */
rv.code = RC_FAIL; /* No one would give us more */
}
return rv;

View File

@ -53,7 +53,7 @@ typedef struct asn_per_data_s {
*/
int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits);
/* Undo the immediately preceeding "get_few_bits" operation */
/* Undo the immediately preceding "get_few_bits" operation */
void per_get_undo(asn_per_data_t *per_data, int get_nbits);
/*