(svn r15569) -Codechange: replace MallocT + memset( 0 ) calls by CallocT

This commit is contained in:
smatz
2009-02-24 21:32:23 +00:00
parent d73c1fa7bf
commit 425fe86a3d
3 changed files with 6 additions and 15 deletions

View File

@@ -37,7 +37,6 @@
#include "ai/ai.hpp"
#include "core/smallmap_type.hpp"
#include "vehiclelist.h"
#include "core/mem_func.hpp"
#include "depot_func.h"
#include "settings_type.h"
@@ -1746,9 +1745,7 @@ FreeUnitIDGenerator::FreeUnitIDGenerator(VehicleType type, CompanyID owner) : ca
this->maxid++; // so there is space for last item (with v->unitnumber == maxid)
this->maxid++; // this one will always be free (well, it will fail when there are 65535 units, so this overflows)
this->cache = MallocT<bool>(this->maxid);
MemSetT(this->cache, 0, this->maxid);
this->cache = CallocT<bool>(this->maxid);
/* Fill the cache */
FOR_ALL_VEHICLES(v) {