Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
48e82d1f
Commit
48e82d1f
authored
Oct 19, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed gcc-7 warnings
parent
b2d896e4
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
80 additions
and
57 deletions
+80
-57
asn1c/asn1c.c
asn1c/asn1c.c
+7
-4
asn1c/enber.c
asn1c/enber.c
+6
-3
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+8
-5
libasn1compiler/asn1c_misc.c
libasn1compiler/asn1c_misc.c
+4
-2
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+2
-1
libasn1fix/asn1fix_bitstring.c
libasn1fix/asn1fix_bitstring.c
+1
-0
libasn1fix/asn1fix_constr.c
libasn1fix/asn1fix_constr.c
+1
-0
libasn1fix/asn1fix_crange.c
libasn1fix/asn1fix_crange.c
+2
-1
libasn1fix/asn1fix_cws.c
libasn1fix/asn1fix_cws.c
+3
-4
libasn1fix/asn1fix_internal.h
libasn1fix/asn1fix_internal.h
+17
-11
libasn1parser/asn1p_value.c
libasn1parser/asn1p_value.c
+1
-0
libasn1print/asn1print.c
libasn1print/asn1print.c
+5
-5
skeletons/INTEGER.c
skeletons/INTEGER.c
+15
-15
skeletons/constr_SEQUENCE.c
skeletons/constr_SEQUENCE.c
+1
-0
skeletons/constr_SET.c
skeletons/constr_SET.c
+2
-1
tests/tests-skeletons/check-REAL.c
tests/tests-skeletons/check-REAL.c
+5
-5
No files found.
asn1c/asn1c.c
View file @
48e82d1f
...
...
@@ -328,10 +328,13 @@ main(int ac, char **av) {
ret
=
asn1f_process
(
asn
,
asn1_fixer_flags
,
NULL
/* default fprintf(stderr) */
);
switch
(
ret
)
{
case
1
:
if
(
!
warnings_as_errors
)
/* Fall through */
case
0
:
case
0
:
break
;
/* All clear */
case
1
:
if
(
!
warnings_as_errors
)
{
break
;
}
/* Fall through */
case
-
1
:
exit_code
=
EX_DATAERR
;
/* Fatal failure */
goto
cleanup
;
...
...
@@ -467,7 +470,7 @@ importStandardModules(asn1p_t *asn, const char *skeletons_dir) {
/*
* Print the usage screen and exit(EX_USAGE).
*/
static
void
static
void
__attribute__
((
noreturn
))
usage
(
const
char
*
av0
)
{
/* clang-format off */
fprintf
(
stderr
,
...
...
asn1c/enber.c
View file @
48e82d1f
...
...
@@ -173,7 +173,6 @@ process_line(const char *fname, char *line, int lineno) {
ber_tlv_len_t
tlv_len
;
ber_tlv_len_t
opt_tl_len
;
/* optional TL length */
ssize_t
ret
;
(
void
)
fname
;
/* Skip the whitespace */
for
(;
*
line
==
' '
||
*
line
==
'\t'
;
line
++
)
...
...
@@ -184,11 +183,15 @@ process_line(const char *fname, char *line, int lineno) {
switch
(
*
op
)
{
case
'<'
:
/* That's what we want! A tag opening */
break
;
case
'-'
:
/* This is a comment (dash-dash) */
if
(
op
[
1
]
==
*
op
)
case
'\r'
:
case
'\r'
:
case
'\n'
:
case
'#'
:
/* This is a comment */
return
0
;
case
'-'
:
/* This is a comment (dash-dash) */
if
(
op
[
1
]
==
'-'
)
{
return
0
;
}
/* Fall through */
default:
fprintf
(
stderr
,
"%s: Missing '<' after whitespace at line %d
\n
"
,
fname
,
lineno
);
...
...
libasn1compiler/asn1c_C.c
View file @
48e82d1f
...
...
@@ -2333,6 +2333,7 @@ try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) {
switch
(
etype
)
{
case
ASN_BASIC_BOOLEAN
:
fits_long
=
1
;
/* Fall through */
case
ASN_BASIC_INTEGER
:
case
ASN_BASIC_ENUMERATED
:
if
(
expr
->
marker
.
default_value
==
NULL
...
...
@@ -3439,13 +3440,15 @@ static int compar_cameo(const void *ap, const void *bp) {
&
atag
,
AFT_IMAGINARY_ANY
|
AFT_CANON_CHOICE
)))
return
1
;
if
(
WITH_MODULE_NAMESPACE
(
b
->
expr
->
module
,
expr_ns
,
asn1f_fetch_outmost_tag
(
arg
->
asn
,
expr_ns
,
b
->
expr
->
module
,
b
->
expr
,
&
btag
,
AFT_IMAGINARY_ANY
|
AFT_CANON_CHOICE
)))
if
(
WITH_MODULE_NAMESPACE
(
b
->
expr
->
module
,
expr_ns
,
asn1f_fetch_outmost_tag
(
arg
->
asn
,
expr_ns
,
b
->
expr
->
module
,
b
->
expr
,
&
btag
,
AFT_IMAGINARY_ANY
|
AFT_CANON_CHOICE
)))
{
return
-
1
;
}
if
(
atag
.
tag_class
<
btag
.
tag_class
)
if
(
atag
.
tag_class
<
btag
.
tag_class
)
return
-
1
;
if
(
atag
.
tag_class
>
btag
.
tag_class
)
return
1
;
...
...
libasn1compiler/asn1c_misc.c
View file @
48e82d1f
...
...
@@ -463,9 +463,11 @@ asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr) {
/* Special case for unsigned */
if
(
!
(
arg
->
flags
&
A1C_USE_WIDE_TYPES
)
&&
left
.
type
==
ARE_VALUE
&&
left
.
value
>=
0
&&
left
.
value
<=
2147483647
&&
right
.
type
==
ARE_MAX
)
&&
left
.
value
>=
0
&&
left
.
value
<=
2147483647
&&
right
.
type
==
ARE_MAX
)
{
return
FL_FITS_UNSIGN
;
if
(
left
.
type
==
ARE_VALUE
}
if
(
left
.
type
==
ARE_VALUE
&&
left
.
value
>=
0
&&
right
.
type
==
ARE_VALUE
&&
right
.
value
>
2147483647
...
...
libasn1compiler/asn1c_save.c
View file @
48e82d1f
...
...
@@ -711,8 +711,9 @@ include_type_to_pdu_collection(arg_t *arg) {
return
0
;
/* Parameterized types can't serve as PDU's without instantiation. */
if
(
arg
->
expr
->
lhs_params
)
if
(
arg
->
expr
->
lhs_params
)
{
return
0
;
}
if
((
arg
->
flags
&
A1C_PDU_ALL
)
||
((
arg
->
flags
&
A1C_PDU_AUTO
)
&&
!
arg
->
expr
->
_type_referenced
)
...
...
libasn1fix/asn1fix_bitstring.c
View file @
48e82d1f
...
...
@@ -112,6 +112,7 @@ asn1f_fix_bit_string_value(arg_t *arg, asn1p_expr_t *ttype) {
break
;
}
/* Fall through: remove trailing zero bits */
/* Fall through */
case
ATV_BITVECTOR
:
asn1f_BS_remove_trailing_zero_bits
(
expr
->
value
);
break
;
...
...
libasn1fix/asn1fix_constr.c
View file @
48e82d1f
...
...
@@ -135,6 +135,7 @@ asn1f_fix_constr_ext(arg_t *arg) {
case
3
:
FATAL
(
"Third extension marker "
"is not allowed at line %d"
,
v
->
_lineno
);
/* Fall through */
default:
r_value
=
-
1
;
}
...
...
libasn1fix/asn1fix_crange.c
View file @
48e82d1f
...
...
@@ -1040,8 +1040,9 @@ asn1constraint_compute_constraint_range(
range
->
not_OER_visible
=
1
;
if
(
!
ct
||
(
range
->
not_OER_visible
&&
(
cpr_flags
&
CPR_strict_OER_visibility
)))
||
(
range
->
not_OER_visible
&&
(
cpr_flags
&
CPR_strict_OER_visibility
)))
{
return
range
;
}
switch
(
ct
->
type
)
{
case
ACT_EL_VALUE
:
...
...
libasn1fix/asn1fix_cws.c
View file @
48e82d1f
...
...
@@ -125,10 +125,9 @@ _asn1f_parse_object_cb(const uint8_t *buf, size_t size, void *keyp) {
ret
=
_asn1f_parse_class_object_data
(
arg
,
eclass
,
row
,
eclass
->
with_syntax
,
buf
,
buf
+
size
,
0
,
0
,
key
->
sequence
);
if
(
ret
)
{
LOG
((
int
)(
ret
<
0
),
"Cannot parse %s of CLASS %s found at line %d"
,
expr
->
Identifier
,
eclass
->
Identifier
,
expr
->
_lineno
);
asn1p_ioc_row_delete
(
row
);
LOG
(
ret
,
"Cannot parse %s of CLASS %s found at line %d"
,
expr
->
Identifier
,
eclass
->
Identifier
,
expr
->
_lineno
);
asn1p_ioc_row_delete
(
row
);
return
ret
;
}
...
...
libasn1fix/asn1fix_internal.h
View file @
48e82d1f
...
...
@@ -83,17 +83,23 @@ typedef struct arg_s {
* Merge the return value of the called function with the already
* partially computed return value of the current function.
*/
#define RET2RVAL(ret,rv) do { \
int __ret = ret; \
switch(__ret) { \
case 0: break; \
case 1: if(rv) break; \
case -1: rv = __ret; break; \
default: \
assert(__ret >= -1 && __ret <= 1); \
rv = -1; \
} \
} while(0)
#define RET2RVAL(ret, rv) \
do { \
int __ret = ret; \
switch(__ret) { \
case 0: \
break; \
case 1: \
if(rv) break; \
/* Fall through */
\
case -1: \
rv = __ret; \
break; \
default: \
assert(__ret >= -1 && __ret <= 1); \
rv = -1; \
} \
} while(0)
/*
* Temporary substitute module for the purposes of evaluating expression.
...
...
libasn1parser/asn1p_value.c
View file @
48e82d1f
...
...
@@ -66,6 +66,7 @@ asn1p_value_compare(const asn1p_value_t *a, const asn1p_value_t *b) {
!=
0
)
{
return
-
1
;
}
return
0
;
case
ATV_VALUESET
:
return
asn1p_constraint_compare
(
a
->
value
.
constraint
,
b
->
value
.
constraint
);
...
...
libasn1print/asn1print.c
View file @
48e82d1f
...
...
@@ -417,11 +417,11 @@ asn1print_constraint(const asn1p_constraint_t *ct, enum asn1print_flags flags) {
safe_printf
(
"PATTERN "
);
asn1print_value
(
ct
->
value
,
flags
);
break
;
case
ACT_CA_SET
:
symno
++
;
case
ACT_CA_CRC
:
symno
++
;
case
ACT_CA_CSV
:
symno
++
;
case
ACT_CA_UNI
:
symno
++
;
case
ACT_CA_INT
:
symno
++
;
case
ACT_CA_SET
:
symno
++
;
/* Fall through */
case
ACT_CA_CRC
:
symno
++
;
/* Fall through */
case
ACT_CA_CSV
:
symno
++
;
/* Fall through */
case
ACT_CA_UNI
:
symno
++
;
/* Fall through */
case
ACT_CA_INT
:
symno
++
;
/* Fall through */
case
ACT_CA_EXC
:
{
char
*
symtable
[]
=
{
" EXCEPT "
,
" ^ "
,
" | "
,
","
,
...
...
skeletons/INTEGER.c
View file @
48e82d1f
...
...
@@ -497,21 +497,21 @@ INTEGER__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
/* FALL THROUGH */
case
ST_DIGITS_TRAILSPACE
:
/* The last symbol encountered was a digit. */
switch
(
asn_strtoimax_lim
(
dec_value_start
,
&
dec_value_end
,
&
dec_value
))
{
case
ASN_STRTOX_OK
:
if
(
dec_value
>=
LONG_MIN
&&
dec_value
<=
LONG_MAX
)
{
break
;
}
else
{
/*
* We model INTEGER on long for XER,
* to avoid rewriting all the tests at once.
*/
ASN_DEBUG
(
"INTEGER exceeds long range"
);
/* Fall through */
}
case
ASN_STRTOX_ERROR_RANGE
:
ASN_DEBUG
(
"INTEGER decode %s hit range limit"
,
td
->
name
);
return
XPBD_DECODER_LIMIT
;
switch
(
asn_strtoimax_lim
(
dec_value_start
,
&
dec_value_end
,
&
dec_value
))
{
case
ASN_STRTOX_OK
:
if
(
dec_value
>=
LONG_MIN
&&
dec_value
<=
LONG_MAX
)
{
break
;
}
else
{
/*
* We model INTEGER on long for XER,
* to avoid rewriting all the tests at once.
*/
ASN_DEBUG
(
"INTEGER exceeds long range"
);
}
/* Fall through */
case
ASN_STRTOX_ERROR_RANGE
:
ASN_DEBUG
(
"INTEGER decode %s hit range limit"
,
td
->
name
);
return
XPBD_DECODER_LIMIT
;
case
ASN_STRTOX_ERROR_INVAL
:
case
ASN_STRTOX_EXPECT_MORE
:
case
ASN_STRTOX_EXTRA_DATA
:
...
...
skeletons/constr_SEQUENCE.c
View file @
48e82d1f
...
...
@@ -443,6 +443,7 @@ SEQUENCE_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
phase3:
ctx
->
phase
=
3
;
/* Fall through */
case
3
:
/* 00 and other tags expected */
case
4
:
/* only 00's expected */
...
...
skeletons/constr_SET.c
View file @
48e82d1f
...
...
@@ -310,7 +310,7 @@ SET_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
ADVANCE
(
rval
.
consumed
);
RETURN
(
RC_WMORE
);
}
/* Fa
i
l through */
/* Fa
l
l through */
case
RC_FAIL
:
/* Fatal error */
RETURN
(
RC_FAIL
);
}
/* switch(rval) */
...
...
@@ -381,6 +381,7 @@ SET_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
}
ctx
->
phase
=
5
;
/* Fall through */
case
5
:
/* Check that all mandatory elements are present. */
if
(
!
_SET_is_populated
(
td
,
st
))
...
...
tests/tests-skeletons/check-REAL.c
View file @
48e82d1f
...
...
@@ -320,13 +320,13 @@ check_ber_857_encoding(int base, int sign, int scaling_factor, int exponent, int
*
b
|=
((
explen
-
1
)
&
0x03
);
/* 8.5.7.4 */
b
++
;
switch
(
explen
)
{
case
2
:
*
b
++
=
(
int8_t
)(
exponent
>>
8
);
case
1
:
*
b
++
=
(
int8_t
)
exponent
;
case
2
:
*
b
++
=
(
int8_t
)(
exponent
>>
8
);
/* Fall through */
case
1
:
*
b
++
=
(
int8_t
)
exponent
;
/* Fall through */
}
switch
(
mantlen
)
{
case
3
:
*
b
++
=
(
mantissa
>>
16
)
&
0xff
;
case
2
:
*
b
++
=
(
mantissa
>>
8
)
&
0xff
;
case
1
:
*
b
++
=
(
mantissa
&
0xff
);
case
3
:
*
b
++
=
(
mantissa
>>
16
)
&
0xff
;
/* Fall through */
case
2
:
*
b
++
=
(
mantissa
>>
8
)
&
0xff
;
/* Fall through */
case
1
:
*
b
++
=
(
mantissa
&
0xff
);
/* Fall through */
}
verify
=
(
sign
?
-
1
.
0
:
1
.
0
)
*
ldexp
(
mantissa
,
exponent
*
baseF
+
scaling_factor
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment