libsepol: mark read-only parameters of type_set_ interfaces const

Make it more obvious which parameters are read-only and not being
modified and allow callers to pass const pointers.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2021-06-08 17:59:00 +02:00 committed by James Carter
parent 390ec54d27
commit 8eec1bb502
2 changed files with 5 additions and 5 deletions

View File

@ -667,8 +667,8 @@ extern int scope_destroy(hashtab_key_t key, hashtab_datum_t datum, void *p);
extern void class_perm_node_init(class_perm_node_t * x);
extern void type_set_init(type_set_t * x);
extern void type_set_destroy(type_set_t * x);
extern int type_set_cpy(type_set_t * dst, type_set_t * src);
extern int type_set_or_eq(type_set_t * dst, type_set_t * other);
extern int type_set_cpy(type_set_t * dst, const type_set_t * src);
extern int type_set_or_eq(type_set_t * dst, const type_set_t * other);
extern void role_set_init(role_set_t * x);
extern void role_set_destroy(role_set_t * x);
extern void avrule_init(avrule_t * x);

View File

@ -1747,7 +1747,7 @@ int symtab_insert(policydb_t * pol, uint32_t sym,
return retval;
}
static int type_set_or(type_set_t * dst, type_set_t * a, type_set_t * b)
static int type_set_or(type_set_t * dst, const type_set_t * a, const type_set_t * b)
{
type_set_init(dst);
@ -1764,7 +1764,7 @@ static int type_set_or(type_set_t * dst, type_set_t * a, type_set_t * b)
return 0;
}
int type_set_cpy(type_set_t * dst, type_set_t * src)
int type_set_cpy(type_set_t * dst, const type_set_t * src)
{
type_set_init(dst);
@ -1777,7 +1777,7 @@ int type_set_cpy(type_set_t * dst, type_set_t * src)
return 0;
}
int type_set_or_eq(type_set_t * dst, type_set_t * other)
int type_set_or_eq(type_set_t * dst, const type_set_t * other)
{
int ret;
type_set_t tmp;