From ff466c154d05e5ea085dfbdd30963ba8d9cc25da Mon Sep 17 00:00:00 2001 From: William Miles Date: Fri, 9 Sep 2022 19:40:22 +1000 Subject: [PATCH] Naming inconsistencies. --- NavmeshList/main.c | 10 +++++----- SizedBuffer/SizedBufferTest.c | 1 - espReader/ESPReader.h | 8 ++++---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/NavmeshList/main.c b/NavmeshList/main.c index 2d28224..cbf2abf 100644 --- a/NavmeshList/main.c +++ b/NavmeshList/main.c @@ -14,7 +14,7 @@ int main(void) { errno_t ret = 0; // Read in the esp file - struct sized_buf esp_buf = { 0 }; + SizedBuf esp_buf = { 0 }; { FILE *fp; ret = fopen_s(&fp, "Skyrim.esm", "rb"); @@ -38,10 +38,10 @@ int main(void) { } // Calculate esp stats - struct esp_stats stats = espr_stats(esp_buf); + ESPStats stats = espr_stats(esp_buf); // Decompress the esp file - struct sized_buf decom_buf = { 0 }; + SizedBuf decom_buf = { 0 }; { decom_buf.size = stats.decompressed_size; decom_buf.data = malloc(decom_buf.size); @@ -54,7 +54,7 @@ int main(void) { } // Construct the meta tree - struct sized_buf tree_buf = { 0 }; + SizedBuf tree_buf = { 0 }; MetaTree tree = { 0 }; { tree_buf.size = espr_tree_size(stats); @@ -67,7 +67,7 @@ int main(void) { } // Serialize and write out the uncompressed esp - struct sized_buf serialized_buf = { 0 }; + SizedBuf serialized_buf = { 0 }; { serialized_buf.size = tree.size; serialized_buf.data = malloc(serialized_buf.size); diff --git a/SizedBuffer/SizedBufferTest.c b/SizedBuffer/SizedBufferTest.c index fe10ae5..3d230f1 100644 --- a/SizedBuffer/SizedBufferTest.c +++ b/SizedBuffer/SizedBufferTest.c @@ -2,7 +2,6 @@ #undef NDBEUG #include -#define NDEBUG #include #include #include diff --git a/espReader/ESPReader.h b/espReader/ESPReader.h index 2c5abf5..a6d166a 100644 --- a/espReader/ESPReader.h +++ b/espReader/ESPReader.h @@ -357,21 +357,21 @@ extern "C" { * the size of the esp/esm if all of the compressed records were * decompressed. */ - struct esp_stats espr_stats(SizedBuf esp); + ESPStats espr_stats(SizedBuf esp); // Calculates the number of formid's in an esm/esp from the stats - inline uint32_t espr_formid_count(struct esp_stats stats) { + inline uint32_t espr_formid_count(ESPStats stats) { return stats.record_count; } // Calculates the number of nodes in the esp/esm from the stats - inline uint32_t espr_node_count(struct esp_stats stats) { + inline uint32_t espr_node_count(ESPStats stats) { return stats.record_count + stats.group_count; } // Calculates the size of a MetaNode tree constructed over the esp/esm // for which the stats were generated. - inline size_t espr_tree_size(struct esp_stats stats) { + inline size_t espr_tree_size(ESPStats stats) { return sizeof(MetaNode) * ((size_t)espr_node_count(stats) + 1); }