Naming inconsistencies.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#undef NDBEUG
|
||||
#include <assert.h>
|
||||
#define NDEBUG
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <limits.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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user