diff options
| -rw-r--r-- | arraylist.c | 10 | ||||
| -rw-r--r-- | 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 @@ | |||
| 6 | #include <string.h> | 6 | #include <string.h> |
| 7 | #include <time.h> | 7 | #include <time.h> |
| 8 | 8 | ||
| 9 | #include "util.h" | ||
| 10 | |||
| 9 | typedef int T; | 11 | typedef int T; |
| 10 | 12 | ||
| 11 | struct ArrayList { | 13 | struct ArrayList { |
| @@ -14,14 +16,6 @@ struct ArrayList { | |||
| 14 | size_t capacity; | 16 | size_t capacity; |
| 15 | }; | 17 | }; |
| 16 | 18 | ||
| 17 | // Utils... | ||
| 18 | static void | ||
| 19 | ERROR(const char *msg) | ||
| 20 | { | ||
| 21 | fprintf(stderr, "Error: %s\n", msg); | ||
| 22 | exit(EXIT_FAILURE); | ||
| 23 | } | ||
| 24 | |||
| 25 | static T ** | 19 | static T ** |
| 26 | ArrayList_allocate(void *ptr, size_t nelem) | 20 | ArrayList_allocate(void *ptr, size_t nelem) |
| 27 | { | 21 | { |
| @@ -49,7 +49,7 @@ quicksort: quicksort.c util.h | |||
| 49 | allocator: allocator.c allocator.h | 49 | allocator: allocator.c allocator.h |
| 50 | cc $(CFLAGS) $< -o $@ | 50 | cc $(CFLAGS) $< -o $@ |
| 51 | 51 | ||
| 52 | arraylist: arraylist.c | 52 | arraylist: arraylist.c util.h |
| 53 | cc $(CFLAGS) $< -o $@ | 53 | cc $(CFLAGS) $< -o $@ |
| 54 | 54 | ||
| 55 | clean: | 55 | clean: |
