aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-10-31 09:32:58 +0100
committerThomas Schmucker <ts@its1.de>2020-10-31 09:32:58 +0100
commit8f580522d6c499ba9a73cff0be6563171c506bfb (patch)
treef1f2eb5fd4cc1c885dd0647c497140229084aaff
parent784f93c625260942c1961c3034ee9b57d253c696 (diff)
downloaddata-structures-8f580522d6c499ba9a73cff0be6563171c506bfb.tar.gz
data-structures-8f580522d6c499ba9a73cff0be6563171c506bfb.tar.bz2
data-structures-8f580522d6c499ba9a73cff0be6563171c506bfb.zip
Benutze util.h für ERROR-Handling
-rw-r--r--arraylist.c10
-rw-r--r--makefile2
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 @@
6#include <string.h> 6#include <string.h>
7#include <time.h> 7#include <time.h>
8 8
9#include "util.h"
10
9typedef int T; 11typedef int T;
10 12
11struct ArrayList { 13struct ArrayList {
@@ -14,14 +16,6 @@ struct ArrayList {
14 size_t capacity; 16 size_t capacity;
15}; 17};
16 18
17// Utils...
18static void
19ERROR(const char *msg)
20{
21 fprintf(stderr, "Error: %s\n", msg);
22 exit(EXIT_FAILURE);
23}
24
25static T ** 19static T **
26ArrayList_allocate(void *ptr, size_t nelem) 20ArrayList_allocate(void *ptr, size_t nelem)
27{ 21{
diff --git a/makefile b/makefile
index 63a9aed..c83159e 100644
--- a/makefile
+++ b/makefile
@@ -49,7 +49,7 @@ quicksort: quicksort.c util.h
49allocator: allocator.c allocator.h 49allocator: allocator.c allocator.h
50 cc $(CFLAGS) $< -o $@ 50 cc $(CFLAGS) $< -o $@
51 51
52arraylist: arraylist.c 52arraylist: arraylist.c util.h
53 cc $(CFLAGS) $< -o $@ 53 cc $(CFLAGS) $< -o $@
54 54
55clean: 55clean: