Actually inline strbuf_get

This commit is contained in:
GenericHeroGuy 2025-05-18 14:47:50 +02:00
parent c3fe5e80ac
commit 95ae54fd08
2 changed files with 6 additions and 7 deletions

View file

@ -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;
}

View file

@ -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
}