Skip to content

Commit

Permalink
Constify a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed Nov 6, 2020
1 parent 6945936 commit e6e6728
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/sp_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ void sp_list_free(sp_list_node *node) {

// Thanks to https://en.wikipedia.org/wiki/Insertion_sort :>
sp_list_node *sp_list_sort(sp_list_node *pList,
int (*cmp_func)(sp_list_node *, sp_list_node *)) {
int (*cmp_func)(sp_list_node const *const,
sp_list_node const *const)) {
sp_list_node *head = NULL;

if (pList == NULL || pList->next == NULL) {
Expand Down
4 changes: 2 additions & 2 deletions src/sp_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ typedef struct sp_node_s {

} sp_list_node;

sp_list_node *sp_list_sort(sp_list_node *,
int (*)(sp_list_node *, sp_list_node *));
sp_list_node *sp_list_sort(sp_list_node *, int (*)(sp_list_node const *const,
sp_list_node const *const));
sp_list_node *sp_list_insert(sp_list_node *, void *);
sp_list_node *sp_list_prepend(sp_list_node *, void *);
void sp_list_free(sp_list_node *);
Expand Down
3 changes: 2 additions & 1 deletion src/sp_var_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ static int create_var(sp_tree *tree, const char *restrict value,
return 0;
}

int cmp_tokens(sp_list_node *list1, sp_list_node *list2) {
int cmp_tokens(sp_list_node const *const list1,
sp_list_node const *const list2) {
return (((sp_conf_token *)list1->data)->pos -
((sp_conf_token *)list2->data)->pos);
}
Expand Down

0 comments on commit e6e6728

Please sign in to comment.