From 0d4f45d43ccd0992978e3a1cc4e6e9488aacd383 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 9 Mar 2021 09:41:49 +0800 Subject: [PATCH] week 2 clang-format --- week2/list.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/week2/list.c b/week2/list.c index 6f3780c..ef3670e 100644 --- a/week2/list.c +++ b/week2/list.c @@ -71,7 +71,8 @@ int DeleteNode(Node **phead, double x) { } /* if not the first node */ - for (pnode=*phead, position=2; pnode->next; pnode=pnode->next, position++) { + for (pnode = *phead, position = 2; pnode->next; + pnode = pnode->next, position++) { /* loop for pnode->next->data == x */ if (pnode->next->data == x) { /* delete node */ @@ -81,7 +82,7 @@ int DeleteNode(Node **phead, double x) { return position; } } - + /* if node not found, return 0 */ return 0; } @@ -89,7 +90,7 @@ int DeleteNode(Node **phead, double x) { void DisplayList(Node *head) { Node *pnode; /* loop for each node */ - for (pnode=head; pnode; pnode=pnode->next) { + for (pnode = head; pnode; pnode = pnode->next) { printf("%f ", pnode->data); } /* new line at the end */