osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-remsim/+/33733 )


Change subject: src/rspro: fix misleading indentations
......................................................................

src/rspro: fix misleading indentations

After upgrading our CI environment to use Debian 12 with
GCC 12, it complains about the following misleading indentations. 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: Icc2e8da7232a93b04ac8f23800380ca9317bd60f
---
M src/rspro/INTEGER.c
M src/rspro/constr_CHOICE.c
M src/rspro/per_decoder.c
3 files changed, 44 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/33/33733/1

diff --git a/src/rspro/INTEGER.c b/src/rspro/INTEGER.c
index b3f0da1..a621aca 100644
--- a/src/rspro/INTEGER.c
+++ b/src/rspro/INTEGER.c
@@ -775,7 +775,7 @@
                                        ? asn_ulong2INTEGER(st, value)
                                        : asn_long2INTEGER(st, value))
                                        _ASN_DECODE_FAILED;
-                                       ASN_DEBUG("Got value %ld + low %lld",
+                               ASN_DEBUG("Got value %ld + low %lld",
                                                          value, 
ct->lower_bound);
                        }
                        return rval;
diff --git a/src/rspro/constr_CHOICE.c b/src/rspro/constr_CHOICE.c
index 6a88b29..d00d416 100644
--- a/src/rspro/constr_CHOICE.c
+++ b/src/rspro/constr_CHOICE.c
@@ -1134,8 +1134,7 @@
                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/src/rspro/per_decoder.c b/src/rspro/per_decoder.c
index 20fe1a1..b5056b5 100644
--- a/src/rspro/per_decoder.c
+++ b/src/rspro/per_decoder.c
@@ -160,7 +160,7 @@
         */
        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)

--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/33733
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: Icc2e8da7232a93b04ac8f23800380ca9317bd60f
Gerrit-Change-Number: 33733
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to