From f707e08fa178433d6bf0dbdb3b847a14da0f1630 Mon Sep 17 00:00:00 2001 From: Evan Burkey Date: Wed, 7 Dec 2022 14:59:51 +0100 Subject: [PATCH] fix indentation --- src/2022/01.c | 12 ++++++------ src/2022/03.c | 8 +++++--- src/2022/04.c | 6 +++--- src/2022/05.c | 6 +++--- src/2022/06.c | 6 +++--- src/2022/07.c | 6 +++--- src/2022/08.c | 6 +++--- src/2022/09.c | 6 +++--- src/2022/10.c | 6 +++--- src/2022/11.c | 6 +++--- src/2022/12.c | 6 +++--- src/2022/13.c | 6 +++--- src/2022/14.c | 6 +++--- src/2022/15.c | 6 +++--- src/2022/16.c | 6 +++--- src/2022/17.c | 6 +++--- src/2022/18.c | 6 +++--- src/2022/19.c | 6 +++--- src/2022/20.c | 6 +++--- src/2022/21.c | 6 +++--- src/2022/22.c | 6 +++--- src/2022/23.c | 6 +++--- src/2022/24.c | 6 +++--- src/2022/25.c | 6 +++--- 24 files changed, 77 insertions(+), 75 deletions(-) diff --git a/src/2022/01.c b/src/2022/01.c index be9a6be..c8bc3f9 100644 --- a/src/2022/01.c +++ b/src/2022/01.c @@ -6,8 +6,8 @@ #include "lfinput.h" #include "lflinkedlist.h" -static int cmp(const void* a, const void* b) { - return (*(int*)a - *(int*)b); +static int cmp(const void *a, const void *b) { + return (*(int *) a - *(int *) b); } void advent2022day01(void) { @@ -15,24 +15,24 @@ void advent2022day01(void) { const char *errstr; int t = 0; - List* totals = malloc(sizeof(List)); + List *totals = malloc(sizeof(List)); ll_init(totals, free); while ((found = strsep(&input, "\n")) != NULL) { if (strcmp(found, "") == 0) { int *i = malloc(sizeof(int)); *i = t; - ll_ins_next(totals, totals->tail, (void*)i); + ll_ins_next(totals, totals->tail, (void *) i); t = 0; } else { - t += (int)(strtonum(found, 0, INT_MAX, &errstr)); + t += (int) (strtonum(found, 0, INT_MAX, &errstr)); } } int elves[totals->size]; int i = 0; LL_ITER(totals) { - elves[i++] = *(int*)(node->data); + elves[i++] = *(int *) (node->data); } qsort(elves, totals->size, sizeof(int), cmp); diff --git a/src/2022/03.c b/src/2022/03.c index bdc31f3..966be78 100644 --- a/src/2022/03.c +++ b/src/2022/03.c @@ -4,7 +4,9 @@ #include "lfinput.h" void advent2022day03(void) { - char *input = get_input("input/2022/03"); - printf("Solution for Day 03 of 2022 is not completed yet\n"); - free(input); + size_t sz = 0; + char **input = get_lines("input/2022/03", &sz); + + + del_lines(input); } diff --git a/src/2022/04.c b/src/2022/04.c index 1884db4..b526492 100644 --- a/src/2022/04.c +++ b/src/2022/04.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day04(void) { - char *input = get_input("input/2022/04"); - printf("Solution for Day 04 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/04"); + printf("Solution for Day 04 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/05.c b/src/2022/05.c index ecbec28..a9f2514 100644 --- a/src/2022/05.c +++ b/src/2022/05.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day05(void) { - char *input = get_input("input/2022/05"); - printf("Solution for Day 05 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/05"); + printf("Solution for Day 05 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/06.c b/src/2022/06.c index 65b614c..01722b5 100644 --- a/src/2022/06.c +++ b/src/2022/06.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day06(void) { - char *input = get_input("input/2022/06"); - printf("Solution for Day 06 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/06"); + printf("Solution for Day 06 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/07.c b/src/2022/07.c index 7a01315..64aeb1c 100644 --- a/src/2022/07.c +++ b/src/2022/07.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day07(void) { - char *input = get_input("input/2022/07"); - printf("Solution for Day 07 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/07"); + printf("Solution for Day 07 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/08.c b/src/2022/08.c index 136ce26..f056ed2 100644 --- a/src/2022/08.c +++ b/src/2022/08.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day08(void) { - char *input = get_input("input/2022/08"); - printf("Solution for Day 08 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/08"); + printf("Solution for Day 08 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/09.c b/src/2022/09.c index a5df969..c68afd2 100644 --- a/src/2022/09.c +++ b/src/2022/09.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day09(void) { - char *input = get_input("input/2022/09"); - printf("Solution for Day 09 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/09"); + printf("Solution for Day 09 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/10.c b/src/2022/10.c index 5564bb3..8600084 100644 --- a/src/2022/10.c +++ b/src/2022/10.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day10(void) { - char *input = get_input("input/2022/10"); - printf("Solution for Day 10 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/10"); + printf("Solution for Day 10 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/11.c b/src/2022/11.c index 9811266..826e2b0 100644 --- a/src/2022/11.c +++ b/src/2022/11.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day11(void) { - char *input = get_input("input/2022/11"); - printf("Solution for Day 11 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/11"); + printf("Solution for Day 11 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/12.c b/src/2022/12.c index 90e5b0c..ca85402 100644 --- a/src/2022/12.c +++ b/src/2022/12.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day12(void) { - char *input = get_input("input/2022/12"); - printf("Solution for Day 12 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/12"); + printf("Solution for Day 12 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/13.c b/src/2022/13.c index 69e4ac1..eb642d6 100644 --- a/src/2022/13.c +++ b/src/2022/13.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day13(void) { - char *input = get_input("input/2022/13"); - printf("Solution for Day 13 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/13"); + printf("Solution for Day 13 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/14.c b/src/2022/14.c index a4ea036..aed6d9e 100644 --- a/src/2022/14.c +++ b/src/2022/14.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day14(void) { - char *input = get_input("input/2022/14"); - printf("Solution for Day 14 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/14"); + printf("Solution for Day 14 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/15.c b/src/2022/15.c index 4ab0c48..38aea73 100644 --- a/src/2022/15.c +++ b/src/2022/15.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day15(void) { - char *input = get_input("input/2022/15"); - printf("Solution for Day 15 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/15"); + printf("Solution for Day 15 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/16.c b/src/2022/16.c index 96ccb0c..3f82437 100644 --- a/src/2022/16.c +++ b/src/2022/16.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day16(void) { - char *input = get_input("input/2022/16"); - printf("Solution for Day 16 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/16"); + printf("Solution for Day 16 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/17.c b/src/2022/17.c index 123d3a5..3d12091 100644 --- a/src/2022/17.c +++ b/src/2022/17.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day17(void) { - char *input = get_input("input/2022/17"); - printf("Solution for Day 17 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/17"); + printf("Solution for Day 17 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/18.c b/src/2022/18.c index e636415..0f6ebf0 100644 --- a/src/2022/18.c +++ b/src/2022/18.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day18(void) { - char *input = get_input("input/2022/18"); - printf("Solution for Day 18 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/18"); + printf("Solution for Day 18 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/19.c b/src/2022/19.c index 07f14b4..20eeb36 100644 --- a/src/2022/19.c +++ b/src/2022/19.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day19(void) { - char *input = get_input("input/2022/19"); - printf("Solution for Day 19 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/19"); + printf("Solution for Day 19 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/20.c b/src/2022/20.c index cfef898..cfb7bd4 100644 --- a/src/2022/20.c +++ b/src/2022/20.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day20(void) { - char *input = get_input("input/2022/20"); - printf("Solution for Day 20 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/20"); + printf("Solution for Day 20 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/21.c b/src/2022/21.c index b57ccd0..bd0d18d 100644 --- a/src/2022/21.c +++ b/src/2022/21.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day21(void) { - char *input = get_input("input/2022/21"); - printf("Solution for Day 21 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/21"); + printf("Solution for Day 21 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/22.c b/src/2022/22.c index 6d075dd..096a712 100644 --- a/src/2022/22.c +++ b/src/2022/22.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day22(void) { - char *input = get_input("input/2022/22"); - printf("Solution for Day 22 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/22"); + printf("Solution for Day 22 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/23.c b/src/2022/23.c index 67f61ec..a58d87b 100644 --- a/src/2022/23.c +++ b/src/2022/23.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day23(void) { - char *input = get_input("input/2022/23"); - printf("Solution for Day 23 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/23"); + printf("Solution for Day 23 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/24.c b/src/2022/24.c index eceb3f9..de2779f 100644 --- a/src/2022/24.c +++ b/src/2022/24.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day24(void) { - char *input = get_input("input/2022/24"); - printf("Solution for Day 24 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/24"); + printf("Solution for Day 24 of 2022 is not completed yet\n"); + free(input); } diff --git a/src/2022/25.c b/src/2022/25.c index 9668b81..8bc285c 100644 --- a/src/2022/25.c +++ b/src/2022/25.c @@ -4,7 +4,7 @@ #include "lfinput.h" void advent2022day25(void) { - char *input = get_input("input/2022/25"); - printf("Solution for Day 25 of 2022 is not completed yet\n"); - free(input); + char *input = get_input("input/2022/25"); + printf("Solution for Day 25 of 2022 is not completed yet\n"); + free(input); }