advent2021

Advent of Code 2021 Solutions
git clone git://bsandro.tech/advent2021
Log | Files | Refs

commit 0e7e16473058809784f0a6a04508da839423a744
parent 86d650e941b96826d561b5c3bcc578c5433eb622
Author: bsandro <brian.drosan@gmail.com>
Date:   Sat, 25 Dec 2021 13:12:38 +0200

Merge branch 'master' of bsandro.tech:~/repos/advent2021

Diffstat:
Mday19/puzzle.c | 2+-
Mday22/Makefile | 8++++----
Mday24/Makefile | 8++++----
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/day19/puzzle.c b/day19/puzzle.c @@ -108,7 +108,7 @@ void puzzle(const char *filename, long long *result1, long long *result2) { beacons[beacon_iter++] = data[i].beacons[0][b1]; struct beacon_t *beacon = &beacons[beacon_iter-1]; beacon->distances_count = 0; - beacon->distances = calloc(data[i].beacons[0][b1].distances_count + data[j].beacons[0][b2].distances_count); + beacon->distances = calloc(data[i].beacons[0][b1].distances_count + data[j].beacons[0][b2].distances_count, sizeof(void *)); for (int d1 = 0; d1 < data[i].beacons[0][b1].distances_count; ++d1) { for (int d2 = 0; d2 < data[i].beacons[j][b2].distances_count; ++d2) { // diff --git a/day22/Makefile b/day22/Makefile @@ -2,10 +2,10 @@ NAME=$(shell basename ${PWD}) SRC=$(wildcard *.c ../common/*.c) DEPS:=$(wildcard *.h ../common/*.h) OBJ:=$(SRC:.c=.o) -CFLAGS=-O0 -g -fsanitize=address -fno-omit-frame-pointer -std=c99 -Werror -Wall -Wextra -I. -I../common -LDFLAGS=-g -lc -lm -fsanitize=address -#CFLAGS=-O0 -g -std=c99 -Werror -Wall -Wextra -I. -I../common -#LDFLAGS=-lc -lm +#CFLAGS=-O0 -g -fsanitize=address -fno-omit-frame-pointer -std=c99 -Werror -Wall -Wextra -I. -I../common +#LDFLAGS=-g -lc -lm -fsanitize=address +CFLAGS=-O0 -g -std=c99 -Werror -Wall -Wextra -I. -I../common +LDFLAGS=-lc -lm all: $(NAME) diff --git a/day24/Makefile b/day24/Makefile @@ -2,10 +2,10 @@ NAME=$(shell basename ${PWD}) SRC=$(wildcard *.c ../common/*.c) DEPS:=$(wildcard *.h ../common/*.h) OBJ:=$(SRC:.c=.o) -CFLAGS=-O0 -g -fsanitize=address -fno-omit-frame-pointer -std=c99 -Werror -Wall -Wextra -I. -I../common -LDFLAGS=-g -lc -lm -fsanitize=address -#CFLAGS=-O0 -g -std=c99 -Werror -Wall -Wextra -I. -I../common -#LDFLAGS=-lc -lm +#CFLAGS=-O0 -g -fsanitize=address -fno-omit-frame-pointer -std=c99 -Werror -Wall -Wextra -I. -I../common +#LDFLAGS=-g -lc -lm -fsanitize=address +CFLAGS=-O0 -g -std=c99 -Werror -Wall -Wextra -I. -I../common +LDFLAGS=-lc -lm all: $(NAME)