From 17357d4672c5b287624022ca8c6bd0ba4e21bac6 Mon Sep 17 00:00:00 2001 From: Quinn Date: Mon, 25 Aug 2025 12:42:45 +0200 Subject: [PATCH] remove unused/unmaintained code. this will likely re-appear in some form or another later on, but currently I don't see its use. --- src/dat/nbt.c | 23 ----------------------- src/dat/nbt.h | 17 ----------------- 2 files changed, 40 deletions(-) diff --git a/src/dat/nbt.c b/src/dat/nbt.c index d0a7238..9f9c4d3 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -179,26 +179,3 @@ const u8 *nbt_proctag(const u8 *restrict buf, u16 slen, void *restrict out) { return procarr(ptr, nmem, size, (struct nbt_array **)out); } - -struct nbt_procdat nbt_initproc(struct nbt_path const *restrict pats, uint npats) { - i16 mdpt = 0; - - // acquire the maximum depth that we'll need to go (exclusive) - for (uint i = 0; i < npats; i++) { - int tmp = pats[i].len - mdpt; - mdpt += -(tmp > 0) & tmp; - } - assert(mdpt > 0); - - // storing the segments of the current path - const char **cpat = (const char **)calloc(mdpt - 1, sizeof(void *)); - - // return the initialised structure. - return (struct nbt_procdat){ - pats, - cpat, - npats, - 0, - mdpt, - }; -} diff --git a/src/dat/nbt.h b/src/dat/nbt.h index 91c5c11..e95aac6 100644 --- a/src/dat/nbt.h +++ b/src/dat/nbt.h @@ -36,20 +36,6 @@ enum nbt_tagid { NBT_ARR_I64 = 0x0C, // starts with a i32, denoting size, followed by the u32 data }; -/* TODO: write doc */ -struct nbt_path { - const char **restrict pat; // specifies the NBT path components as separate elements - i16 len; // specifies the length of the NBT elements -}; - -/* TODO: write doc */ -struct nbt_procdat { - const struct nbt_path *pats; - const char *restrict *cpat; - u32 npats; - i16 dpt, mdpt; -}; - struct nbt_array { i32 len; u8 dat[]; @@ -67,6 +53,3 @@ const u8 *nbt_nexttag(const u8 *restrict buf) NONNULL((1)) PURE; * to have the available byte width for one of these types. In the case of `NBT_ARR*` and `NBT_LIST` * it must point to a `struct nbt_array*`. Where in the case of `NBT_LIST`, it must be one of the previous static-width types. */ const u8 *nbt_proctag(const u8 *restrict buf, u16 slen, void *restrict out) NONNULL((1, 3)); - -/* initialises a data structure used whilst processing the tags */ -struct nbt_procdat nbt_initproc(struct nbt_path const *restrict pats, uint npats) NONNULL((1)) PURE;