summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2007-01-11 17:29:39 +0000
committerKUDr <kudr@openttd.org>2007-01-11 17:29:39 +0000
commit33be1ecfb1a9056b027d50d7b558cff87c5b744d (patch)
treed644a3831ca0947198b191fa3e4e8973d3a9786e /src/strgen
parent91ff74641060445dc1647bbf05baeb03b45c3099 (diff)
downloadopenttd-33be1ecfb1a9056b027d50d7b558cff87c5b744d.tar.xz
(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
Diffstat (limited to 'src/strgen')
-rw-r--r--src/strgen/strgen.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 4268f0bbb..9b6ae5102 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -845,7 +845,7 @@ static void HandleString(char *str, bool master)
}
// Allocate a new LangString
- CallocT(&ent, 1);
+ ent = CallocT<LangString>(1);
_strings[_next_string_id] = ent;
ent->index = _next_string_id++;
ent->name = strdup(str);
@@ -855,8 +855,7 @@ static void HandleString(char *str, bool master)
}
if (casep != NULL) {
- Case* c;
- MallocT(&c, 1);
+ Case* c = MallocT<Case>(1);
c->caseidx = ResolveCaseName(casep, strlen(casep));
c->string = strdup(s);
@@ -885,8 +884,7 @@ static void HandleString(char *str, bool master)
if (!CheckCommandsMatch(s, ent->english, str)) return;
if (casep != NULL) {
- Case* c;
- MallocT(&c, 1);
+ Case* c = MallocT<Case>(1);
c->caseidx = ResolveCaseName(casep, strlen(casep));
c->string = strdup(s);