From 8f580522d6c499ba9a73cff0be6563171c506bfb Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 31 Oct 2020 09:32:58 +0100 Subject: Benutze util.h für ERROR-Handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arraylist.c | 10 ++-------- makefile | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arraylist.c b/arraylist.c index 21b8229..420dc0b 100644 --- a/arraylist.c +++ b/arraylist.c @@ -6,6 +6,8 @@ #include #include +#include "util.h" + typedef int T; struct ArrayList { @@ -14,14 +16,6 @@ struct ArrayList { size_t capacity; }; -// Utils... -static void -ERROR(const char *msg) -{ - fprintf(stderr, "Error: %s\n", msg); - exit(EXIT_FAILURE); -} - static T ** ArrayList_allocate(void *ptr, size_t nelem) { diff --git a/makefile b/makefile index 63a9aed..c83159e 100644 --- a/makefile +++ b/makefile @@ -49,7 +49,7 @@ quicksort: quicksort.c util.h allocator: allocator.c allocator.h cc $(CFLAGS) $< -o $@ -arraylist: arraylist.c +arraylist: arraylist.c util.h cc $(CFLAGS) $< -o $@ clean: -- cgit v1.3