diff options
author | rubidium <rubidium@openttd.org> | 2008-10-20 15:42:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-10-20 15:42:56 +0000 |
commit | 166b7a974db9e7e2635ada045e9d14a08f1ae7bd (patch) | |
tree | 4dbde97f7875348ac768245ade77db77e41c1123 /src | |
parent | 92d4472bcea0167309ad8189d389caac69761de5 (diff) | |
download | openttd-166b7a974db9e7e2635ada045e9d14a08f1ae7bd.tar.xz |
(svn r14501) -Codechange: use sizeof(variable) instead of sizeof(type) or hardcoded amounts (magic constant) for memset (Alberth)
Diffstat (limited to 'src')
-rw-r--r-- | src/station_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 23503ddbe..9f802cc4e 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -425,7 +425,7 @@ static void ShowRejectOrAcceptNews(const Station *st, uint num_items, CargoID *c void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, int w, int h, int rad) { - memset(produced, 0, sizeof(AcceptedCargo)); + memset(produced, 0, sizeof(produced)); int x = TileX(tile); int y = TileY(tile); @@ -451,7 +451,7 @@ void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, GetProducedCargoProc *gpc = _tile_type_procs[GetTileType(tile)]->get_produced_cargo_proc; if (gpc != NULL) { CargoID cargos[256]; // Required for CBID_HOUSE_PRODUCE_CARGO. - memset(cargos, CT_INVALID, 256); + memset(cargos, CT_INVALID, sizeof(cargos)); gpc(tile, cargos); for (uint i = 0; i < lengthof(cargos); ++i) { @@ -474,7 +474,7 @@ void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile, int w, int h, int rad) { - memset(accepts, 0, sizeof(AcceptedCargo)); + memset(accepts, 0, sizeof(accepts)); int x = TileX(tile); int y = TileY(tile); |