summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2007-02-20 00:01:54 +0000
committerDarkvater <Darkvater@openttd.org>2007-02-20 00:01:54 +0000
commit37f14d44441708e11ac1d629221ba147174569c0 (patch)
treebe7d6f569de5d6510195c2554c952e12683ed72b /src/newgrf_config.cpp
parentc4a8336835f5d5019ec5fc324767015520c54ea3 (diff)
downloadopenttd-37f14d44441708e11ac1d629221ba147174569c0.tar.xz
(svn r8820) -Codechange (r8807, r8806): Remove the unneeded calloc/free allocation of GRFConfig and turn it into a simple variable (it's supposed to be data-only). Thanks Tron.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 24d9727ff..583b4773b 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -465,12 +465,13 @@ static void Save_NGRF(void)
static void Load_NGRF(void)
{
- GRFConfig *c = CallocT<GRFConfig>(1);
+ GRFConfig c;
+ memset(&c, 0, sizeof(GRFConfig));
+
while (SlIterateArray() != -1) {
- SlObject(c, _grfconfig_desc);
- AppendToGRFConfigList(&_grfconfig, c);
+ SlObject(&c, _grfconfig_desc);
+ AppendToGRFConfigList(&_grfconfig, &c);
}
- free(c);
/* Append static NewGRF configuration */
AppendStaticGRFConfigs(&_grfconfig);