From 9f5e8d12f05fb24c915a5266a1e908a75c8aed08 Mon Sep 17 00:00:00 2001 From: Thibault "bui" Koechlin Date: Thu, 28 Dec 2017 17:04:06 +0100 Subject: Clang-format pass - `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h` - Update the documentation accordingly--- src/sp_list.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/sp_list.c') diff --git a/src/sp_list.c b/src/sp_list.c index 2a9d680..447f479 100644 --- a/src/sp_list.c +++ b/src/sp_list.c @@ -4,7 +4,7 @@ #include "php_snuffleupagus.h" void sp_list_free(sp_list_node *node) { - while(node) { + while (node) { sp_list_node *tmp = node->next; pefree(node, 1); node = tmp; @@ -18,7 +18,8 @@ sp_list_node *sp_list_new() { } // 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 *)) { +sp_list_node *sp_list_sort(sp_list_node *pList, + int (*cmp_func)(sp_list_node *, sp_list_node *)) { sp_list_node *head = NULL; if (pList == NULL || pList->next == NULL) { @@ -33,12 +34,12 @@ sp_list_node *sp_list_sort(sp_list_node *pList, int (*cmp_func)(sp_list_node *, } else { sp_list_node *p = head; while (p != NULL) { - if (p->next == NULL || 0 > cmp_func(current, p->next)) { - current->next = p->next; - p->next = current; - break; - } - p = p->next; + if (p->next == NULL || 0 > cmp_func(current, p->next)) { + current->next = p->next; + p->next = current; + break; + } + p = p->next; } } } -- cgit v1.3