From 95ae54fd08a25b8a126a869cfecd3f3bfbea3032 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy Date: Sun, 18 May 2025 14:47:50 +0200 Subject: [PATCH] Actually inline strbuf_get --- src/strbuf.c | 6 ------ src/strbuf.h | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/strbuf.c b/src/strbuf.c index a38db9aad..89987e377 100644 --- a/src/strbuf.c +++ b/src/strbuf.c @@ -47,9 +47,3 @@ UINT32 strbuf_append(strbuf_t **strbuf, const char *str) strcpy(buf->buf - sizeof(UINT32) + oldsize, str); return oldsize; } - -// returns the string at the given offset -char *strbuf_get(strbuf_t *strbuf, UINT32 ofs) -{ - return strbuf->buf - sizeof(UINT32) + ofs; -} diff --git a/src/strbuf.h b/src/strbuf.h index 238e5bf7f..5ed454995 100644 --- a/src/strbuf.h +++ b/src/strbuf.h @@ -22,7 +22,12 @@ struct strbuf_t strbuf_t *strbuf_alloc(void); UINT32 strbuf_append(strbuf_t **strbuf, const char *str); -char *strbuf_get(strbuf_t *strbuf, UINT32 ofs); + +// returns the string at the given offset +FUNCINLINE static ATTRINLINE char *strbuf_get(strbuf_t *strbuf, UINT32 ofs) +{ + return (char *)strbuf + ofs; +} #ifdef __cplusplus }