aboutsummaryrefslogtreecommitdiff
path: root/sem3/algo/mm2/linked/main.c
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-02-15 20:28:59 +0100
committerJulian T <julian@jtle.dk>2020-02-15 20:28:59 +0100
commit8076d839bf69e619f2e504122ec2ceb790a0b978 (patch)
treefa6cb7c649939c3a002676ce142105360d3d2fd6 /sem3/algo/mm2/linked/main.c
parentf17e8e195bd1ee3f911ae311dce8e8f7df4f8457 (diff)
Changed to a more consistent codestyle
Diffstat (limited to 'sem3/algo/mm2/linked/main.c')
-rw-r--r--sem3/algo/mm2/linked/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sem3/algo/mm2/linked/main.c b/sem3/algo/mm2/linked/main.c
index 72b62cc..6f4eb6a 100644
--- a/sem3/algo/mm2/linked/main.c
+++ b/sem3/algo/mm2/linked/main.c
@@ -2,10 +2,11 @@
#include "node.h"
#include "llist.h"
-void list_print(node_t *root) {
+void list_print(node_t *root)
+{
int index = 0;
/* Loop through notes and print them */
- while( root != NULL ) {
+ while ( root != NULL ) {
/* Print a value */
printf("%d: %d\n", index++, root->val);
@@ -15,7 +16,8 @@ void list_print(node_t *root) {
}
/* Remove node */
-int main() {
+int main()
+{
/* Do some stuff */
llist_t list;
@@ -39,7 +41,7 @@ int main() {
list_print(list.root);
- while( list.len ) {
+ while ( list.len ) {
printf("Popped %d\n", llist_pop(&list, 0));
}
}