From cf0354eb8e043fcd9c6c17756701972f948a16f1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 22 Aug 2024 00:02:48 +0100 Subject: Rewrite the gamedata and entprops systems entirely This removes the horrible janky old KeyValues parser and replaces it with a couple of trivial ad-hoc text parsers. In doing so, make the format of the actual gamedata files more human-friendly too. We also gain support for nested SendTables in mkentprops, which are required to get at various things like player velocity. And, the actual string matching is made more efficient (or, at least, more scalable) by way of a cool radix tree thing which generates a bunch of switch cases on distinct characters. --- src/mem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mem.h') diff --git a/src/mem.h b/src/mem.h index 7b1a0b0..6acf018 100644 --- a/src/mem.h +++ b/src/mem.h @@ -67,7 +67,7 @@ static inline usize mem_loadusize(const void *p) { } /* Adds a byte count to a pointer and returns a freely-assignable pointer. */ -static inline void *mem_offset(void *p, int off) { return (char *)p + off; } +static inline void *mem_offset(const void *p, int off) { return (char *)p + off; } /* Returns the offset in bytes from one pointer to another (p - q). */ static inline ssize mem_diff(const void *p, const void *q) { -- cgit v1.2.3-54-g00ecf