diff options
author | KUDr <KUDr@openttd.org> | 2007-01-11 17:29:39 +0000 |
---|---|---|
committer | KUDr <KUDr@openttd.org> | 2007-01-11 17:29:39 +0000 |
commit | 28e969924b9033f5132fe2ba223e2bcadd39a7ec (patch) | |
tree | d644a3831ca0947198b191fa3e4e8973d3a9786e /src/strgen/strgen.cpp | |
parent | 5675956443d4e58713a0abd8cedb4eaaaccf22d4 (diff) | |
download | openttd-28e969924b9033f5132fe2ba223e2bcadd39a7ec.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/strgen.cpp')
-rw-r--r-- | src/strgen/strgen.cpp | 8 |
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); |