ref: e41d4472ec1dd7b4bd4312982ebddfc78b86f1b2
parent: a2ecd752717febcda3bcb91e3a06a2ab7ce94202
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Aug 10 20:09:17 EDT 2020
Another authentic struct name
--- 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 @@
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,7 +33,7 @@
// 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;
}
@@ -40,10 +40,10 @@
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;
--- 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 @@
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);
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -125,7 +125,7 @@
strcpy(gDataPath, gModulePath);
strcat(gDataPath, "\\data");
- CONFIG conf;
+ CONFIGDATA conf;
if (!LoadConfigData(&conf))
DefaultConfigData(&conf);