Commit Graph

14 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
4b90398cbf Stop using system() 2018-06-20 19:39:57 +10:00
Andrew Pamment
edb1b41652 Git hooks suck 2018-06-05 15:27:53 +10:00
Andrew Pamment
d14af4bf23 i will get this soon 2018-06-05 15:24:42 +10:00
Andrew Pamment
f12630f7e5 Last test commit 2018-06-05 15:23:30 +10:00
Andrew Pamment
ffd1c546b8 Another test commit 2018-06-05 15:21:49 +10:00
Andrew Pamment
1feaa7d91e Another test commit 2018-06-05 15:19:41 +10:00
Andrew Pamment
b472f6448c Test commit, just whitespace 2018-06-05 15:15:14 +10:00
Andrew Pamment
f5cd8ddb03 Remove IAC debug output 2018-02-05 11:52:01 +10:00
Andrew Pamment
027c047b42 some debugging IAC codes in file transfers 2018-02-01 13:42:57 +10:00
Andrew Pamment
5543f94e01 Magicka now builds and runs on SunOS 2017-10-20 07:27:58 +10:00
Andrew Pamment
ffaca86565 Redo Make file setup.. please standby 2017-09-25 13:27:22 +10:00