@@ -37,7 +37,7 @@ static void Load_XBSS()
|
||||
static void RealSave_XBSS(const LongBridgeSignalStorage *lbss)
|
||||
{
|
||||
LongBridgeSignalStorageStub stub;
|
||||
stub.length = lbss->signal_red_bits.size();
|
||||
stub.length = (uint32)lbss->signal_red_bits.size();
|
||||
SlObject(&stub, _long_bridge_signal_storage_stub_desc);
|
||||
SlArray(const_cast<uint64*>(&(lbss->signal_red_bits[0])), stub.length, SLE_UINT64);
|
||||
}
|
||||
|
||||
@@ -126,8 +126,8 @@ static void Save_CHTX()
|
||||
};
|
||||
|
||||
SlAutolength([](void *) {
|
||||
SlWriteUint32(0); // flags
|
||||
SlWriteUint32(lengthof(_extra_cheat_descs) + _unknown_cheats.size()); // cheat count
|
||||
SlWriteUint32(0); // flags
|
||||
SlWriteUint32((uint32)(lengthof(_extra_cheat_descs) + _unknown_cheats.size())); // cheat count
|
||||
|
||||
for (uint j = 0; j < lengthof(_extra_cheat_descs); j++) {
|
||||
CheatsExtSave save = { _extra_cheat_descs[j].name, *(_extra_cheat_descs[j].cht) };
|
||||
|
||||
@@ -473,7 +473,7 @@ static void Save_SLXI()
|
||||
if (_sl_xv_feature_versions[info->index] > 0) {
|
||||
item_count++;
|
||||
length += 6;
|
||||
length += SlCalcObjLength(info, _xlsi_sub_chunk_desc);
|
||||
length += (uint32)SlCalcObjLength(info, _xlsi_sub_chunk_desc);
|
||||
if (info->save_proc) {
|
||||
uint32 extra_data_length = info->save_proc(info, true);
|
||||
if (extra_data_length) {
|
||||
@@ -644,7 +644,7 @@ static void loadVL(const SlxiSubChunkInfo *info, uint32 length)
|
||||
|
||||
static uint32 saveVL(const SlxiSubChunkInfo *info, bool dry_run)
|
||||
{
|
||||
uint32 length = strlen(_openttd_revision);
|
||||
size_t length = strlen(_openttd_revision);
|
||||
if (!dry_run) MemoryDumper::GetCurrent()->CopyBytes(reinterpret_cast<const byte *>(_openttd_revision), length);
|
||||
return length;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void AfterLoadLabelMaps()
|
||||
|
||||
railtype_conversion_map[i] = r;
|
||||
}
|
||||
for (uint i = _railtype_list.size(); i < RAILTYPE_END; i++) {
|
||||
for (uint i = (uint)_railtype_list.size(); i < RAILTYPE_END; i++) {
|
||||
railtype_conversion_map[i] = RAILTYPE_RAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ static const SaveLoad _plan_desc[] = {
|
||||
static void RealSave_PLAN(Plan *p)
|
||||
{
|
||||
SlObject(p, _plan_desc);
|
||||
SlWriteUint32(p->lines.size());
|
||||
SlWriteUint32((uint32)p->lines.size());
|
||||
for (size_t i = 0; i < p->lines.size(); i++) {
|
||||
PlanLine *pl = p->lines[i];
|
||||
SlWriteUint32(pl->tiles.size());
|
||||
SlWriteUint32((uint32)pl->tiles.size());
|
||||
SlArray(&pl->tiles[0], pl->tiles.size(), SLE_UINT32);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +171,8 @@ void MemoryDumper::Flush(SaveFilter *writer)
|
||||
{
|
||||
this->FinaliseBlock();
|
||||
|
||||
uint block_count = this->blocks.size();
|
||||
for (uint i = 0; i < block_count; i++) {
|
||||
size_t block_count = this->blocks.size();
|
||||
for (size_t i = 0; i < block_count; i++) {
|
||||
writer->Write(this->blocks[i].data, this->blocks[i].size);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,14 +146,14 @@ static void Save_SPRG()
|
||||
|
||||
// OK, we can now write out our programs
|
||||
Buffer b;
|
||||
WriteVLI(b, _signal_programs.size());
|
||||
WriteVLI(b, (uint)_signal_programs.size());
|
||||
for(ProgramList::iterator i = _signal_programs.begin(), e = _signal_programs.end();
|
||||
i != e; ++i) {
|
||||
SignalProgram *prog = i->second;
|
||||
|
||||
WriteVLI(b, prog->tile);
|
||||
WriteVLI(b, prog->track);
|
||||
WriteVLI(b, prog->instructions.size());
|
||||
WriteVLI(b, (uint)prog->instructions.size());
|
||||
for (SignalInstruction *insn : prog->instructions) {
|
||||
WriteVLI(b, insn->Opcode());
|
||||
if(insn->Opcode() != PSO_FIRST)
|
||||
@@ -195,7 +195,7 @@ static void Save_SPRG()
|
||||
}
|
||||
}
|
||||
|
||||
uint size = b.size();
|
||||
uint size = (uint)b.size();
|
||||
SlSetLength(size);
|
||||
for(uint i = 0; i < size; i++) {
|
||||
SlWriteByte(b[i]); // TODO Gotta be a better way
|
||||
@@ -223,14 +223,14 @@ typedef std::vector<Fixup> FixupList;
|
||||
template<typename T>
|
||||
static void MakeFixup(FixupList &l, T *&ir, uint id, SignalOpcode op = PSO_INVALID)
|
||||
{
|
||||
ir = reinterpret_cast<T*>(id);
|
||||
ir = reinterpret_cast<T*>((size_t)id);
|
||||
l.emplace_back(reinterpret_cast<SignalInstruction**>(&ir), op);
|
||||
}
|
||||
|
||||
static void DoFixups(FixupList &l, InstructionList &il)
|
||||
{
|
||||
for (Fixup &i : l) {
|
||||
uint id = reinterpret_cast<size_t>(*(i.ptr));
|
||||
uint id = (uint)reinterpret_cast<size_t>(*(i.ptr));
|
||||
if (id >= il.size())
|
||||
NOT_REACHED();
|
||||
|
||||
|
||||
@@ -517,7 +517,7 @@ static void RealSave_STNN(BaseStation *bst)
|
||||
Station *st = Station::From(bst);
|
||||
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||
_num_dests = (uint32)st->goods[i].cargo.Packets()->MapSize();
|
||||
_num_flows = st->goods[i].flows.size();
|
||||
_num_flows = (uint32)st->goods[i].flows.size();
|
||||
SlObjectSaveFiltered(&st->goods[i], _filtered_goods_desc.data());
|
||||
for (FlowStatMap::const_iterator outer_it(st->goods[i].flows.begin()); outer_it != st->goods[i].flows.end(); ++outer_it) {
|
||||
uint32 sum_shares = 0;
|
||||
@@ -525,7 +525,7 @@ static void RealSave_STNN(BaseStation *bst)
|
||||
flow.source = outer_it->GetOrigin();
|
||||
dumper->CheckBytes(2 + 4);
|
||||
dumper->RawWriteUint16(flow.source);
|
||||
dumper->RawWriteUint32(outer_it->size());
|
||||
dumper->RawWriteUint32((uint32)outer_it->size());
|
||||
FlowStat::const_iterator inner_it(outer_it->begin());
|
||||
const FlowStat::const_iterator end(outer_it->end());
|
||||
for (; inner_it != end; ++inner_it) {
|
||||
|
||||
@@ -97,7 +97,7 @@ static void Load_TRRP()
|
||||
static void RealSave_TRRP(TraceRestrictProgram *prog)
|
||||
{
|
||||
TraceRestrictProgramStub stub;
|
||||
stub.length = prog->items.size();
|
||||
stub.length = (uint32)prog->items.size();
|
||||
SlObject(&stub, _trace_restrict_program_stub_desc);
|
||||
SlArray(&(prog->items[0]), stub.length, SLE_UINT32);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ static void RealSave_TRRS(TraceRestrictSlot *slot)
|
||||
{
|
||||
SlObject(slot, _trace_restrict_slot_desc);
|
||||
TraceRestrictSlotStub stub;
|
||||
stub.length = slot->occupants.size();
|
||||
stub.length = (uint32)slot->occupants.size();
|
||||
SlObject(&stub, _trace_restrict_slot_stub_desc);
|
||||
if (stub.length) SlArray(&(slot->occupants[0]), stub.length, SLE_UINT32);
|
||||
}
|
||||
|
||||
@@ -1434,11 +1434,11 @@ const SaveLoad *GetVehicleLookAheadCurveDescription()
|
||||
static void RealSave_VLKA(TrainReservationLookAhead *lookahead)
|
||||
{
|
||||
SlObject(lookahead, GetVehicleLookAheadDescription());
|
||||
SlWriteUint32(lookahead->items.size());
|
||||
SlWriteUint32((uint32)lookahead->items.size());
|
||||
for (TrainReservationLookAheadItem &item : lookahead->items) {
|
||||
SlObject(&item, GetVehicleLookAheadItemDescription());
|
||||
}
|
||||
SlWriteUint32(lookahead->curves.size());
|
||||
SlWriteUint32((uint32)lookahead->curves.size());
|
||||
for (TrainReservationLookAheadCurve &curve : lookahead->curves) {
|
||||
SlObject(&curve, GetVehicleLookAheadCurveDescription());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user