diff --git a/src/dat/nbt.c b/src/dat/nbt.c index 9af98ff..746742a 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -7,7 +7,7 @@ #include #include "../util/compat/endian.h" -#include "../util/types.h" +#include "../util/intdef.h" int nbt_primsize(u8 tag) { switch (tag) { diff --git a/src/dat/nbt.h b/src/dat/nbt.h index 4693546..429b108 100644 --- a/src/dat/nbt.h +++ b/src/dat/nbt.h @@ -8,7 +8,7 @@ #include "../util/atrb.h" #include "../util/compat/endian.h" -#include "../util/types.h" +#include "../util/intdef.h" /* NBT (named binary tag) is a tree data structure. Tags have a numeric type ID, name and a payload. * NBT files are a compressed `compound` tag. GZip is the compression used in most cases, diff --git a/src/io/render.c b/src/io/render.c index 83fb4d3..9caf13f 100644 --- a/src/io/render.c +++ b/src/io/render.c @@ -8,7 +8,7 @@ #include #include "../error.h" -#include "../util/types.h" +#include "../util/intdef.h" #include "shader.h" #define VERTC 3 diff --git a/src/util/conf.c b/src/util/conf.c index b2483a4..df10c4a 100644 --- a/src/util/conf.c +++ b/src/util/conf.c @@ -12,9 +12,9 @@ #include "../error.h" #include "atrb.h" -#include "types.h" +#include "intdef.h" -int conf_procbuf(char const *restrict buf, char *restrict kout, char *restrict vout, size_t len) { +int conf_procbuf(const char *restrict buf, char *restrict kout, char *restrict vout, size_t len) { bool feq = false; // whether we've found the equal sign // data traversal @@ -53,7 +53,7 @@ int conf_procbuf(char const *restrict buf, char *restrict kout, char *restrict v return (pos == kout) ? CONF_ENODAT : (!feq ? CONF_ESYNTAX : 0); } -struct conf_entry const *conf_matchopt(struct conf_entry const *opts, size_t optc, char const *restrict key) { +struct conf_entry const *conf_matchopt(struct conf_entry const *opts, size_t optc, const char *restrict key) { // find a match for the current key size_t i = 0; for (; i < optc; i++) { @@ -63,7 +63,7 @@ struct conf_entry const *conf_matchopt(struct conf_entry const *opts, size_t opt return NULL; } -int conf_procval(struct conf_entry const *opt, char const *restrict val) { +int conf_procval(struct conf_entry const *opt, const char *restrict val) { // parse the data errno = 0; char *end; @@ -127,7 +127,8 @@ int conf_procval(struct conf_entry const *opt, char const *restrict val) { } /* utility function for conf_getpat to concatenate 3 strings, where we already know the size */ -NONNULL(1, 3) static char *conf_getpat_concat(char const *restrict s1, char const *restrict s2, char const *restrict s3, size_t s1len, size_t s2len, size_t s3len) { +NONNULL(1, 3) +static char *conf_getpat_concat(const char *restrict s1, const char *restrict s2, const char *restrict s3, size_t s1len, size_t s2len, size_t s3len) { assert(s2 || (!s2 && !s2len)); // ensuring the programmer passes both s2 and s2len as 0, if they intend to char *buf, *ptr; @@ -146,7 +147,7 @@ NONNULL(1, 3) static char *conf_getpat_concat(char const *restrict s1, char cons } /* appends str to the config directory string we acquire from environment variables. */ -char *conf_getpat(char const *restrict str) { +char *conf_getpat(const char *restrict str) { char *buf = NULL; size_t len; size_t str_len = strlen(str); diff --git a/src/util/conf.h b/src/util/conf.h index 141ae2a..8b2d51f 100644 --- a/src/util/conf.h +++ b/src/util/conf.h @@ -3,10 +3,10 @@ #pragma once #include -#include #include #include "atrb.h" +#include "intdef.h" /* error codes */ enum conf_err { @@ -43,7 +43,7 @@ struct conf_fstr { struct conf_entry { const char *key; // the key of this entry void *out; // the pointer to which the data is written value is read if the given option is incorrect or missing - uint8_t type; // the primitive type which we are querying for + u8 type; // the primitive type which we are querying for }; /* processes an incoming buffer. diff --git a/src/util/types.h b/src/util/types.h deleted file mode 120000 index 2d2c767..0000000 --- a/src/util/types.h +++ /dev/null @@ -1 +0,0 @@ -intdef.h \ No newline at end of file diff --git a/src/util/vec.h b/src/util/vec.h index d22b85b..e3573d2 100644 --- a/src/util/vec.h +++ b/src/util/vec.h @@ -1,6 +1,6 @@ #pragma once -#include "types.h" +#include "intdef.h" #if defined(__has_attribute) && __has_attribute(vector_size) typedef float fvec2 __attribute__((vector_size(sizeof(float) * 2))); // SMID vector for 2 `float`