Commit Graph

7 Commits

Author SHA1 Message Date
Dan Cross
540e359080 Cleanups and pointer vectors.
A repeated pattern in Magicka is to append to dynamically
sized arrays via malloc()/realloc().  Introduce the notion
of a "pointer vector": that is, a growable vector of
pointers, that can be reused to implement that logic more
safely and efficiently (this implementation uses power-of-two
growing).

Many malloc()/realloc() calls were not checked; these
assert() that the return value from realloc() is not NULL.

Add a method to consume the pointer vector: that is, realloc()
it to the current length and return the underlying pointers.

Make the `fmt` argument to dolog() const.
Include <sys/wait.h> in bluewave.c to squash a warning.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-10 10:25:42 +10:00
Dan Cross
fa014f3a88 Simplify dynamic memory management.
Add utility routines and use them to simplify the
use of dynamically allocated memory.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-10 10:25:29 +10:00
Dan Cross
d6826137dd clang-format
Fix a bunch of trivial formatting issues by running
`clang-format`.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-09 15:48:42 +10:00
Andrew Pamment
1d1f83cd41 Redraw BBS List after aborting 2018-10-02 10:16:50 +10:00
Andrew Pamment
2ff6e4cc48 Testing Git 2018-03-05 16:45:27 +10:00
Andrew Pamment
58adb0e167 Redone BBS List 2018-02-08 19:42:23 +10:00
Andrew Pamment
ffaca86565 Redo Make file setup.. please standby 2017-09-25 13:27:22 +10:00