1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

suit: Mark conversion function arguments as const

Small cleanup to mark arguments of the conversion functions for param to
cbor and vice versa as const where possible
This commit is contained in:
Koen Zandberg 2020-09-28 23:01:42 +02:00
parent 8159819087
commit ea007ada05
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
2 changed files with 8 additions and 8 deletions

View File

@ -207,8 +207,8 @@ int suit_handle_manifest_structure_bstr(suit_manifest_t *manifest,
* @returns The offset of the nanocbor value inside the manifest
* bytestring
*/
uint16_t suit_param_ref_to_cbor(suit_manifest_t *manifest,
suit_param_ref_t *ref,
uint16_t suit_param_ref_to_cbor(const suit_manifest_t *manifest,
const suit_param_ref_t *ref,
nanocbor_value_t *val);
/**
@ -219,9 +219,9 @@ uint16_t suit_param_ref_to_cbor(suit_manifest_t *manifest,
* @param ref reference to parse
* @param val NanoCBOR value to restore
*/
void suit_param_cbor_to_ref(suit_manifest_t *manifest,
void suit_param_cbor_to_ref(const suit_manifest_t *manifest,
suit_param_ref_t *ref,
nanocbor_value_t *val);
const nanocbor_value_t *val);
#ifdef __cplusplus
}

View File

@ -37,8 +37,8 @@ static suit_manifest_handler_t _get_handler(int key,
return map[key];
}
uint16_t suit_param_ref_to_cbor(suit_manifest_t *manifest,
suit_param_ref_t *ref,
uint16_t suit_param_ref_to_cbor(const suit_manifest_t *manifest,
const suit_param_ref_t *ref,
nanocbor_value_t *val)
{
size_t len = manifest->len - ref->offset;
@ -47,9 +47,9 @@ uint16_t suit_param_ref_to_cbor(suit_manifest_t *manifest,
return ref->offset;
}
void suit_param_cbor_to_ref(suit_manifest_t *manifest,
void suit_param_cbor_to_ref(const suit_manifest_t *manifest,
suit_param_ref_t *ref,
nanocbor_value_t *val)
const nanocbor_value_t *val)
{
assert(val->cur >= manifest->buf);
ref->offset = val->cur - manifest->buf;