advent2021

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

commit f876640e38d075cb636f0c2198176e2257006e10
parent 43bfbc12e61030402e89be352b802f9f478f20f0
Author: bsandro <[email protected]>
Date:   Sat, 25 Dec 2021 03:41:46 +0200

Compilation fixes (OpenBSD)

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)