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
14e6b161
Commit
14e6b161
authored
Jul 23, 2014
by
Wim Lewis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Declare the type descriptor and input buffer args of some functions as const.
parent
a73ae673
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
16 deletions
+16
-16
skeletons/INTEGER.c
skeletons/INTEGER.c
+1
-1
skeletons/OBJECT_IDENTIFIER.c
skeletons/OBJECT_IDENTIFIER.c
+5
-5
skeletons/OBJECT_IDENTIFIER.h
skeletons/OBJECT_IDENTIFIER.h
+4
-4
skeletons/RELATIVE-OID.c
skeletons/RELATIVE-OID.c
+1
-1
skeletons/RELATIVE-OID.h
skeletons/RELATIVE-OID.h
+1
-1
skeletons/constr_CHOICE.c
skeletons/constr_CHOICE.c
+2
-2
skeletons/constr_TYPE.c
skeletons/constr_TYPE.c
+1
-1
skeletons/constr_TYPE.h
skeletons/constr_TYPE.h
+1
-1
No files found.
skeletons/INTEGER.c
View file @
14e6b161
...
...
@@ -106,7 +106,7 @@ static const asn_INTEGER_enum_map_t *INTEGER_map_enum2value(asn_INTEGER_specific
* INTEGER specific human-readable output.
*/
static
ssize_t
INTEGER__dump
(
asn_TYPE_descriptor_t
*
td
,
const
INTEGER_t
*
st
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
,
int
plainOrXER
)
{
INTEGER__dump
(
const
asn_TYPE_descriptor_t
*
td
,
const
INTEGER_t
*
st
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
,
int
plainOrXER
)
{
asn_INTEGER_specifics_t
*
specs
=
(
asn_INTEGER_specifics_t
*
)
td
->
specifics
;
char
scratch
[
32
];
/* Enough for 64-bit integer */
uint8_t
*
buf
=
st
->
buf
;
...
...
skeletons/OBJECT_IDENTIFIER.c
View file @
14e6b161
...
...
@@ -65,9 +65,9 @@ OBJECT_IDENTIFIER_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
int
OBJECT_IDENTIFIER_get_single_arc
(
uint8_t
*
arcbuf
,
unsigned
int
arclen
,
signed
int
add
,
void
*
rvbufp
,
unsigned
int
rvsize
)
{
OBJECT_IDENTIFIER_get_single_arc
(
const
uint8_t
*
arcbuf
,
unsigned
int
arclen
,
signed
int
add
,
void
*
rvbufp
,
unsigned
int
rvsize
)
{
unsigned
LE
GCC_NOTUSED
=
1
;
/* Little endian (x86) */
uint8_t
*
arcend
=
arcbuf
+
arclen
;
/* End of arc */
const
uint8_t
*
arcend
=
arcbuf
+
arclen
;
/* End of arc */
unsigned
int
cache
=
0
;
/* No more than 14 significant bits */
unsigned
char
*
rvbuf
=
(
unsigned
char
*
)
rvbufp
;
unsigned
char
*
rvstart
=
rvbuf
;
/* Original start of the value buffer */
...
...
@@ -181,7 +181,7 @@ OBJECT_IDENTIFIER_get_single_arc(uint8_t *arcbuf, unsigned int arclen, signed in
}
ssize_t
OBJECT_IDENTIFIER__dump_arc
(
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
OBJECT_IDENTIFIER__dump_arc
(
const
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
char
scratch
[
64
];
/* Conservative estimate */
unsigned
long
accum
;
/* Bits accumulator */
...
...
@@ -212,7 +212,7 @@ OBJECT_IDENTIFIER__dump_arc(uint8_t *arcbuf, int arclen, int add,
}
int
OBJECT_IDENTIFIER_print_arc
(
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
OBJECT_IDENTIFIER_print_arc
(
const
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
if
(
OBJECT_IDENTIFIER__dump_arc
(
arcbuf
,
arclen
,
add
,
cb
,
app_key
)
<
0
)
...
...
@@ -360,7 +360,7 @@ OBJECT_IDENTIFIER_print(asn_TYPE_descriptor_t *td, const void *sptr,
}
int
OBJECT_IDENTIFIER_get_arcs
(
OBJECT_IDENTIFIER_t
*
oid
,
void
*
arcs
,
OBJECT_IDENTIFIER_get_arcs
(
const
OBJECT_IDENTIFIER_t
*
oid
,
void
*
arcs
,
unsigned
int
arc_type_size
,
unsigned
int
arc_slots
)
{
void
*
arcs_end
=
(
char
*
)
arcs
+
(
arc_type_size
*
arc_slots
);
int
num_arcs
=
0
;
...
...
skeletons/OBJECT_IDENTIFIER.h
View file @
14e6b161
...
...
@@ -68,7 +68,7 @@ xer_type_encoder_f OBJECT_IDENTIFIER_encode_xer;
* WARNING: The function always returns the real number of arcs,
* even if there is no sufficient (_arc_slots) provided.
*/
int
OBJECT_IDENTIFIER_get_arcs
(
OBJECT_IDENTIFIER_t
*
_oid
,
int
OBJECT_IDENTIFIER_get_arcs
(
const
OBJECT_IDENTIFIER_t
*
_oid
,
void
*
_arcs
,
/* e.g., unsigned int arcs[N] */
unsigned
int
_arc_type_size
,
/* e.g., sizeof(arcs[0]) */
unsigned
int
_arc_slots
/* e.g., N */
);
...
...
@@ -91,12 +91,12 @@ int OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *_oid,
/*
* Print the specified OBJECT IDENTIFIER arc.
*/
int
OBJECT_IDENTIFIER_print_arc
(
uint8_t
*
arcbuf
,
int
arclen
,
int
OBJECT_IDENTIFIER_print_arc
(
const
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
/* Arbitrary offset, required to process the first two arcs */
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
);
/* Same as above, but returns the number of written digits, instead of 0 */
ssize_t
OBJECT_IDENTIFIER__dump_arc
(
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
ssize_t
OBJECT_IDENTIFIER__dump_arc
(
const
uint8_t
*
arcbuf
,
int
arclen
,
int
add
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
);
/*
...
...
@@ -127,7 +127,7 @@ int OBJECT_IDENTIFIER_parse_arcs(const char *oid_text, ssize_t oid_txt_length,
* Internal functions.
* Used by RELATIVE-OID implementation in particular.
*/
int
OBJECT_IDENTIFIER_get_single_arc
(
uint8_t
*
arcbuf
,
unsigned
int
arclen
,
int
OBJECT_IDENTIFIER_get_single_arc
(
const
uint8_t
*
arcbuf
,
unsigned
int
arclen
,
signed
int
add
,
void
*
value
,
unsigned
int
value_size
);
int
OBJECT_IDENTIFIER_set_single_arc
(
uint8_t
*
arcbuf
,
const
void
*
arcval
,
unsigned
int
arcval_size
,
int
_prepared_order
);
...
...
skeletons/RELATIVE-OID.c
View file @
14e6b161
...
...
@@ -162,7 +162,7 @@ RELATIVE_OID_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
}
int
RELATIVE_OID_get_arcs
(
RELATIVE_OID_t
*
roid
,
RELATIVE_OID_get_arcs
(
const
RELATIVE_OID_t
*
roid
,
void
*
arcs
,
unsigned
int
arc_type_size
,
unsigned
int
arc_slots
)
{
void
*
arcs_end
=
(
char
*
)
arcs
+
(
arc_slots
*
arc_type_size
);
int
num_arcs
=
0
;
...
...
skeletons/RELATIVE-OID.h
View file @
14e6b161
...
...
@@ -25,7 +25,7 @@ xer_type_encoder_f RELATIVE_OID_encode_xer;
**********************************/
/* See OBJECT_IDENTIFIER_get_arcs() function in OBJECT_IDENTIFIER.h */
int
RELATIVE_OID_get_arcs
(
RELATIVE_OID_t
*
_roid
,
int
RELATIVE_OID_get_arcs
(
const
RELATIVE_OID_t
*
_roid
,
void
*
arcs
,
unsigned
int
arc_type_size
,
unsigned
int
arc_slots
);
/* See OBJECT_IDENTIFIER_set_arcs() function in OBJECT_IDENTIFIER.h */
...
...
skeletons/constr_CHOICE.c
View file @
14e6b161
...
...
@@ -445,7 +445,7 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
}
ber_tlv_tag_t
CHOICE_outmost_tag
(
asn_TYPE_descriptor_t
*
td
,
const
void
*
ptr
,
int
tag_mode
,
ber_tlv_tag_t
tag
)
{
CHOICE_outmost_tag
(
const
asn_TYPE_descriptor_t
*
td
,
const
void
*
ptr
,
int
tag_mode
,
ber_tlv_tag_t
tag
)
{
asn_CHOICE_specifics_t
*
specs
=
(
asn_CHOICE_specifics_t
*
)
td
->
specifics
;
int
present
;
...
...
@@ -458,7 +458,7 @@ CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber
present
=
_fetch_present_idx
(
ptr
,
specs
->
pres_offset
,
specs
->
pres_size
);
if
(
present
>
0
||
present
<=
td
->
elements_count
)
{
asn_TYPE_member_t
*
elm
=
&
td
->
elements
[
present
-
1
];
const
asn_TYPE_member_t
*
elm
=
&
td
->
elements
[
present
-
1
];
const
void
*
memb_ptr
;
if
(
elm
->
flags
&
ATF_POINTER
)
{
...
...
skeletons/constr_TYPE.c
View file @
14e6b161
...
...
@@ -17,7 +17,7 @@ static asn_app_consume_bytes_f _print2fp;
* Return the outmost tag of the type.
*/
ber_tlv_tag_t
asn_TYPE_outmost_tag
(
asn_TYPE_descriptor_t
*
type_descriptor
,
asn_TYPE_outmost_tag
(
const
asn_TYPE_descriptor_t
*
type_descriptor
,
const
void
*
struct_ptr
,
int
tag_mode
,
ber_tlv_tag_t
tag
)
{
if
(
tag_mode
)
...
...
skeletons/constr_TYPE.h
View file @
14e6b161
...
...
@@ -73,7 +73,7 @@ typedef int (asn_struct_print_f)(
* Do not use it in your application.
*/
typedef
ber_tlv_tag_t
(
asn_outmost_tag_f
)(
struct
asn_TYPE_descriptor_s
*
type_descriptor
,
const
struct
asn_TYPE_descriptor_s
*
type_descriptor
,
const
void
*
struct_ptr
,
int
tag_mode
,
ber_tlv_tag_t
tag
);
/* The instance of the above function type; used internally. */
asn_outmost_tag_f
asn_TYPE_outmost_tag
;
...
...
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