From e41d4472ec1dd7b4bd4312982ebddfc78b86f1b2 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Tue, 11 Aug 2020 00:09:17 +0100 Subject: [PATCH] Another authentic struct name --- src/Config.cpp | 12 ++++++------ src/Config.h | 6 +++--- src/Main.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Config.cpp b/src/Config.cpp index 4c2d6d69..20606385 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -10,10 +10,10 @@ const char* const gConfigName = "Config.dat"; const char* const gProof = "DOUKUTSU20041206"; -BOOL LoadConfigData(CONFIG *conf) +BOOL LoadConfigData(CONFIGDATA *conf) { // Clear old configuration data - memset(conf, 0, sizeof(CONFIG)); + memset(conf, 0, sizeof(CONFIGDATA)); // Get path char path[MAX_PATH]; @@ -25,7 +25,7 @@ BOOL LoadConfigData(CONFIG *conf) return FALSE; // Read data - size_t fread_result = fread(conf, sizeof(CONFIG), 1, fp); // Not the original name + size_t fread_result = fread(conf, sizeof(CONFIGDATA), 1, fp); // Not the original name // Close file fclose(fp); @@ -33,17 +33,17 @@ BOOL LoadConfigData(CONFIG *conf) // Check if version is not correct, and return if it failed if (fread_result != 1 || strcmp(conf->proof, gProof)) { - memset(conf, 0, sizeof(CONFIG)); + memset(conf, 0, sizeof(CONFIGDATA)); return FALSE; } return TRUE; } -void DefaultConfigData(CONFIG *conf) +void DefaultConfigData(CONFIGDATA *conf) { // Clear old configuration data - memset(conf, 0, sizeof(CONFIG)); + memset(conf, 0, sizeof(CONFIGDATA)); // Fun fact: The Linux port added this line: // conf->display_mode = 1; diff --git a/src/Config.h b/src/Config.h index a62d3559..d80dd5c8 100644 --- a/src/Config.h +++ b/src/Config.h @@ -2,7 +2,7 @@ #include "WindowsWrapper.h" -struct CONFIG +struct CONFIGDATA { char proof[0x20]; char font_name[0x40]; @@ -17,5 +17,5 @@ struct CONFIG extern const char* const gConfigName; extern const char* const gProof; -BOOL LoadConfigData(CONFIG *conf); -void DefaultConfigData(CONFIG *conf); +BOOL LoadConfigData(CONFIGDATA *conf); +void DefaultConfigData(CONFIGDATA *conf); diff --git a/src/Main.cpp b/src/Main.cpp index 2acff283..f98b41b1 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -125,7 +125,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine strcpy(gDataPath, gModulePath); strcat(gDataPath, "\\data"); - CONFIG conf; + CONFIGDATA conf; if (!LoadConfigData(&conf)) DefaultConfigData(&conf);