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
23751fcd
Commit
23751fcd
authored
3 years ago
by
Pau Espin Pedrol
Committed by
Mouse
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aper: Fix printf formatting on 32bit archs
parent
abd1faa6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
36 deletions
+46
-36
skeletons/INTEGER_aper.c
skeletons/INTEGER_aper.c
+14
-11
skeletons/NativeEnumerated_aper.c
skeletons/NativeEnumerated_aper.c
+4
-2
skeletons/OCTET_STRING_aper.c
skeletons/OCTET_STRING_aper.c
+13
-11
skeletons/aper_opentype.c
skeletons/aper_opentype.c
+1
-1
skeletons/aper_support.c
skeletons/aper_support.c
+1
-1
skeletons/constr_SEQUENCE_OF_aper.c
skeletons/constr_SEQUENCE_OF_aper.c
+3
-2
skeletons/constr_SEQUENCE_aper.c
skeletons/constr_SEQUENCE_aper.c
+5
-5
skeletons/constr_SET_OF_aper.c
skeletons/constr_SET_OF_aper.c
+5
-3
No files found.
skeletons/INTEGER_aper.c
View file @
23751fcd
...
...
@@ -87,8 +87,8 @@ INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
?
asn_uint642INTEGER
(
st
,
(
unsigned
long
)
value
)
:
asn_int642INTEGER
(
st
,
value
))
ASN__DECODE_FAILED
;
ASN_DEBUG
(
"Got value %ld + low %ld"
,
value
,
ct
->
lower_bound
);
ASN_DEBUG
(
"Got value %ld + low %l
l
d"
,
value
,
(
long
long
int
)
ct
->
lower_bound
);
}
else
{
long
value
=
0
;
if
(
ct
->
range_bits
<
8
)
{
...
...
@@ -111,8 +111,8 @@ INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
?
asn_ulong2INTEGER
(
st
,
value
)
:
asn_long2INTEGER
(
st
,
value
))
ASN__DECODE_FAILED
;
ASN_DEBUG
(
"Got value %ld + low %ld"
,
value
,
ct
->
lower_bound
);
ASN_DEBUG
(
"Got value %ld + low %l
l
d"
,
value
,
(
long
long
int
)
ct
->
lower_bound
);
}
return
rval
;
}
else
{
...
...
@@ -191,9 +191,10 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
||
uval
>
(
unsigned
long
)
ct
->
upper_bound
)
inext
=
1
;
}
ASN_DEBUG
(
"Value %lu (%02x/%
lu) lb %ld ub %
ld %s"
,
ASN_DEBUG
(
"Value %lu (%02x/%
zu) lb %lld ub %l
ld %s"
,
uval
,
st
->
buf
[
0
],
st
->
size
,
ct
->
lower_bound
,
ct
->
upper_bound
,
(
long
long
int
)
ct
->
lower_bound
,
(
long
long
int
)
ct
->
upper_bound
,
inext
?
"ext"
:
"fix"
);
value
=
uval
;
}
else
{
...
...
@@ -207,9 +208,10 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
||
value
>
ct
->
upper_bound
)
inext
=
1
;
}
ASN_DEBUG
(
"Value %lu (%02x/%
lu) lb %ld ub %
ld %s"
,
ASN_DEBUG
(
"Value %lu (%02x/%
zu) lb %lld ub %l
ld %s"
,
value
,
st
->
buf
[
0
],
st
->
size
,
ct
->
lower_bound
,
ct
->
upper_bound
,
(
long
long
int
)
ct
->
lower_bound
,
(
long
long
int
)
ct
->
upper_bound
,
inext
?
"ext"
:
"fix"
);
}
if
(
ct
->
flags
&
APC_EXTENSIBLE
)
{
...
...
@@ -226,8 +228,9 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
unsigned
long
v
;
/* #10.5.6 */
ASN_DEBUG
(
"Encoding integer %ld (%lu) with range %d bits"
,
value
,
value
-
ct
->
lower_bound
,
ct
->
range_bits
);
ASN_DEBUG
(
"Encoding integer %ld (%lld) with range %d bits"
,
value
,
(
long
long
int
)(
value
-
ct
->
lower_bound
),
ct
->
range_bits
);
v
=
value
-
ct
->
lower_bound
;
...
...
@@ -284,7 +287,7 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
}
if
(
ct
&&
ct
->
lower_bound
)
{
ASN_DEBUG
(
"Adjust lower bound to %l
d"
,
ct
->
lower_bound
);
ASN_DEBUG
(
"Adjust lower bound to %l
ld"
,
(
long
long
int
)
ct
->
lower_bound
);
/* TODO: adjust lower bound */
ASN__ENCODE_FAILED
;
}
...
...
This diff is collapsed.
Click to expand it.
skeletons/NativeEnumerated_aper.c
View file @
23751fcd
...
...
@@ -42,8 +42,10 @@ NativeEnumerated_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
if
(
ct
&&
ct
->
upper_bound
>=
255
)
{
int
padding
=
0
;
padding
=
(
8
-
(
pd
->
moved
%
8
))
%
8
;
ASN_DEBUG
(
"For NativeEnumerated %s,offset= %lu Padding bits = %d"
,
td
->
name
,
pd
->
moved
,
padding
);
ASN_DEBUG
(
"For NativeEnumerated %s, upper bound = %lu"
,
td
->
name
,
ct
->
upper_bound
);
ASN_DEBUG
(
"For NativeEnumerated %s,offset = %zu Padding bits = %d"
,
td
->
name
,
pd
->
moved
,
padding
);
ASN_DEBUG
(
"For NativeEnumerated %s, upper bound = %llu"
,
td
->
name
,
(
unsigned
long
long
)
ct
->
upper_bound
);
if
(
padding
>
0
)
per_get_few_bits
(
pd
,
padding
);
}
...
...
This diff is collapsed.
Click to expand it.
skeletons/OCTET_STRING_aper.c
View file @
23751fcd
...
...
@@ -100,9 +100,10 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
if
(
!
st
)
RETURN
(
RC_FAIL
);
}
ASN_DEBUG
(
"PER Decoding %s size %l
d .. %
ld bits %d"
,
ASN_DEBUG
(
"PER Decoding %s size %l
ld .. %l
ld bits %d"
,
csiz
->
flags
&
APC_EXTENSIBLE
?
"extensible"
:
"non-extensible"
,
csiz
->
lower_bound
,
csiz
->
upper_bound
,
csiz
->
effective_bits
);
(
long
long
int
)
csiz
->
lower_bound
,
(
long
long
int
)
csiz
->
upper_bound
,
csiz
->
effective_bits
);
if
(
csiz
->
flags
&
APC_EXTENSIBLE
)
{
int
inext
=
per_get_few_bits
(
pd
,
1
);
...
...
@@ -136,8 +137,8 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
RETURN
(
RC_FAIL
);
}
if
(
bpc
)
{
ASN_DEBUG
(
"Decoding OCTET STRING size %ld"
,
csiz
->
upper_bound
);
ASN_DEBUG
(
"Decoding OCTET STRING size %l
l
d"
,
(
long
long
int
)
csiz
->
upper_bound
);
ret
=
OCTET_STRING_per_get_characters
(
pd
,
st
->
buf
,
csiz
->
upper_bound
,
bpc
,
unit_bits
,
...
...
@@ -146,8 +147,8 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
pc
);
if
(
ret
>
0
)
RETURN
(
RC_FAIL
);
}
else
{
ASN_DEBUG
(
"Decoding BIT STRING size %ld"
,
csiz
->
upper_bound
);
ASN_DEBUG
(
"Decoding BIT STRING size %l
l
d"
,
(
long
long
int
)
csiz
->
upper_bound
);
ret
=
per_get_many_bits
(
pd
,
st
->
buf
,
0
,
unit_bits
*
csiz
->
upper_bound
);
}
...
...
@@ -307,9 +308,10 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
}
ASN_DEBUG
(
"Encoding %s into %d units of %d bits"
" (%l
d..%
ld, effective %d)%s"
,
" (%l
ld..%l
ld, effective %d)%s"
,
td
->
name
,
sizeinunits
,
unit_bits
,
csiz
->
lower_bound
,
csiz
->
upper_bound
,
(
long
long
int
)
csiz
->
lower_bound
,
(
long
long
int
)
csiz
->
upper_bound
,
csiz
->
effective_bits
,
ct_extensible
?
" EXT"
:
""
);
/* Figure out wheter size lies within PER visible constraint */
...
...
@@ -339,8 +341,8 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
if
(
csiz
->
effective_bits
>=
0
)
{
ASN_DEBUG
(
"Encoding %
lu bytes (%
ld), length in %d bits"
,
st
->
size
,
sizeinunits
-
csiz
->
lower_bound
,
ASN_DEBUG
(
"Encoding %
zu bytes (%l
ld), length in %d bits"
,
st
->
size
,
(
long
long
int
)(
sizeinunits
-
csiz
->
lower_bound
)
,
csiz
->
effective_bits
);
if
(
csiz
->
effective_bits
>
0
)
{
ret
=
aper_put_length
(
po
,
csiz
->
lower_bound
,
csiz
->
upper_bound
,
...
...
@@ -369,7 +371,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
ASN__ENCODED_OK
(
er
);
}
ASN_DEBUG
(
"Encoding %
l
u bytes"
,
st
->
size
);
ASN_DEBUG
(
"Encoding %
z
u bytes"
,
st
->
size
);
if
(
sizeinunits
==
0
)
{
if
(
aper_put_length
(
po
,
-
1
,
-
1
,
0
,
NULL
)
<
0
)
...
...
This diff is collapsed.
Click to expand it.
skeletons/aper_opentype.c
View file @
23751fcd
...
...
@@ -115,7 +115,7 @@ aper_open_type_put(const asn_TYPE_descriptor_t *td,
FREEMEM
(
buf
);
if
(
toGo
)
return
-
1
;
ASN_DEBUG
(
"Open type put %s of length %
l
d + overhead (1byte?)"
,
ASN_DEBUG
(
"Open type put %s of length %
z
d + overhead (1byte?)"
,
td
->
name
,
size
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
skeletons/aper_support.c
View file @
23751fcd
...
...
@@ -59,7 +59,7 @@ aper_get_nslength(asn_per_data_t *pd) {
if
(
per_get_few_bits
(
pd
,
1
)
==
0
)
{
length
=
per_get_few_bits
(
pd
,
6
)
+
1
;
if
(
length
<=
0
)
return
-
1
;
ASN_DEBUG
(
"l=%
l
d"
,
length
);
ASN_DEBUG
(
"l=%
z
d"
,
length
);
return
length
;
}
else
{
int
repeat
;
...
...
This diff is collapsed.
Click to expand it.
skeletons/constr_SEQUENCE_OF_aper.c
View file @
23751fcd
...
...
@@ -33,8 +33,9 @@ SEQUENCE_OF_encode_aper(const asn_TYPE_descriptor_t *td,
if
(
ct
)
{
int
not_in_root
=
(
list
->
count
<
ct
->
lower_bound
||
list
->
count
>
ct
->
upper_bound
);
ASN_DEBUG
(
"lb %ld ub %ld %s"
,
ct
->
lower_bound
,
ct
->
upper_bound
,
ASN_DEBUG
(
"lb %lld ub %lld %s"
,
(
long
long
int
)
ct
->
lower_bound
,
(
long
long
int
)
ct
->
upper_bound
,
ct
->
flags
&
APC_EXTENSIBLE
?
"ext"
:
"fix"
);
if
(
ct
->
flags
&
APC_EXTENSIBLE
)
{
/* Declare whether size is in extension root */
...
...
This diff is collapsed.
Click to expand it.
skeletons/constr_SEQUENCE_aper.c
View file @
23751fcd
...
...
@@ -175,7 +175,7 @@ SEQUENCE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
memset
(
&
epmd
,
0
,
sizeof
(
epmd
));
epmd
.
buffer
=
epres
;
epmd
.
nbits
=
bmlength
;
ASN_DEBUG
(
"Read in extensions bitmap for %s of %
l
d bits (%x..)"
,
ASN_DEBUG
(
"Read in extensions bitmap for %s of %
z
d bits (%x..)"
,
td
->
name
,
bmlength
,
*
epres
);
/* Deal with padding */
...
...
@@ -190,7 +190,7 @@ SEQUENCE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
int
present
;
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
ASN_DEBUG
(
"%
ld
is not extension"
,
edx
);
ASN_DEBUG
(
"%
zu
is not extension"
,
edx
);
continue
;
}
...
...
@@ -288,7 +288,7 @@ SEQUENCE_handle_extensions_aper(const asn_TYPE_descriptor_t *td,
int
present
;
if
(
!
IN_EXTENSION_GROUP
(
specs
,
edx
))
{
ASN_DEBUG
(
"%s (@%
ld
) is not extension"
,
elm
->
type
->
name
,
edx
);
ASN_DEBUG
(
"%s (@%
zu
) is not extension"
,
elm
->
type
->
name
,
edx
);
continue
;
}
...
...
@@ -302,7 +302,7 @@ SEQUENCE_handle_extensions_aper(const asn_TYPE_descriptor_t *td,
present
=
1
;
}
ASN_DEBUG
(
"checking %s (@%
ld
) present => %d"
,
ASN_DEBUG
(
"checking %s (@%
zu
) present => %d"
,
elm
->
type
->
name
,
edx
,
present
);
exts_count
++
;
exts_present
+=
present
;
...
...
@@ -410,7 +410,7 @@ SEQUENCE_encode_aper(const asn_TYPE_descriptor_t *td,
if
(
elm
->
flags
&
ATF_POINTER
)
{
memb_ptr2
=
(
const
void
*
const
*
)((
const
char
*
)
sptr
+
elm
->
memb_offset
);
if
(
!*
memb_ptr2
)
{
ASN_DEBUG
(
"Element %s %
ld
not present"
,
ASN_DEBUG
(
"Element %s %
zu
not present"
,
elm
->
name
,
edx
);
if
(
elm
->
optional
)
continue
;
...
...
This diff is collapsed.
Click to expand it.
skeletons/constr_SET_OF_aper.c
View file @
23751fcd
...
...
@@ -34,7 +34,9 @@ SET_OF_encode_aper(const asn_TYPE_descriptor_t *td,
if
(
ct
)
{
int
not_in_root
=
(
list
->
count
<
ct
->
lower_bound
||
list
->
count
>
ct
->
upper_bound
);
ASN_DEBUG
(
"lb %ld ub %ld %s"
,
ct
->
lower_bound
,
ct
->
upper_bound
,
ASN_DEBUG
(
"lb %lld ub %lld %s"
,
(
long
long
int
)
ct
->
lower_bound
,
(
long
long
int
)
ct
->
upper_bound
,
ct
->
flags
&
APC_EXTENSIBLE
?
"ext"
:
"fix"
);
if
(
ct
->
flags
&
APC_EXTENSIBLE
)
{
/* Declare whether size is in extension root */
...
...
@@ -130,8 +132,8 @@ SET_OF_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
if
(
ct
&&
ct
->
effective_bits
>=
0
)
{
/* X.691, #19.5: No length determinant */
nelems
=
aper_get_nsnnwn
(
pd
,
ct
->
upper_bound
-
ct
->
lower_bound
+
1
);
ASN_DEBUG
(
"Preparing to fetch %ld+%ld elements from %s"
,
(
long
)
nelems
,
ct
->
lower_bound
,
td
->
name
);
ASN_DEBUG
(
"Preparing to fetch %ld+%l
l
d elements from %s"
,
(
long
)
nelems
,
(
long
long
int
)
ct
->
lower_bound
,
td
->
name
);
if
(
nelems
<
0
)
ASN__DECODE_STARVED
;
nelems
+=
ct
->
lower_bound
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
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