Skip to content

const correctness of oc_rep_get functions #357

@Danielius1922

Description

@Danielius1922

oc_rep_get functions that const oc_rep_t* and return value stored for given key.

Example:

bool oc_rep_get_string(const oc_rep_t *rep, const char *key, char **value,
                       size_t *size);

The problem is that the value is a pointer to member of the provided const oc_rep_t* and therefore the returned value should also be const.

Functions oc_rep_get_byte_string, oc_rep_get_string, oc_rep_get_int_array, oc_rep_get_bool_array, oc_rep_get_double_array, oc_rep_get_byte_string_array, oc_rep_get_string_array, oc_rep_get_object oc_rep_get_object_array should be modified to return const** value.
(This will however break API so we should issue at least a warning in the changelog).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions