Skip to content

Commit e81a05a

Browse files
cgzonesjwcart2
authored andcommitted
libsepol: constify function pointer arrays
The function pointer arrays are never changed, declare them const. Signed-off-by: Christian Göttsche <[email protected]> Acked-by: James Carter <[email protected]>
1 parent 652e288 commit e81a05a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libsepol/src/policydb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ static int cat_index(hashtab_key_t key, hashtab_datum_t datum, void *datap)
11261126
return 0;
11271127
}
11281128

1129-
static int (*index_f[SYM_NUM]) (hashtab_key_t key, hashtab_datum_t datum,
1129+
static int (*const index_f[SYM_NUM]) (hashtab_key_t key, hashtab_datum_t datum,
11301130
void *datap) = {
11311131
common_index, class_index, role_index, type_index, user_index,
11321132
cond_index_bool, sens_index, cat_index,};
@@ -1409,7 +1409,7 @@ static int cat_destroy(hashtab_key_t key, hashtab_datum_t datum, void *p
14091409
return 0;
14101410
}
14111411

1412-
static int (*destroy_f[SYM_NUM]) (hashtab_key_t key, hashtab_datum_t datum,
1412+
static int (*const destroy_f[SYM_NUM]) (hashtab_key_t key, hashtab_datum_t datum,
14131413
void *datap) = {
14141414
common_destroy, class_destroy, role_destroy, type_destroy, user_destroy,
14151415
cond_destroy_bool, sens_destroy, cat_destroy,};
@@ -3410,7 +3410,7 @@ static int cat_read(policydb_t * p
34103410
return -1;
34113411
}
34123412

3413-
static int (*read_f[SYM_NUM]) (policydb_t * p, hashtab_t h,
3413+
static int (*const read_f[SYM_NUM]) (policydb_t * p, hashtab_t h,
34143414
struct policy_file * fp) = {
34153415
common_read, class_read, role_read, type_read, user_read,
34163416
cond_read_bool, sens_read, cat_read,};

0 commit comments

Comments
 (0)