clang-tidy modernize-use-auto

This commit is contained in:
Michael Cook (mackal)
2016-05-25 16:10:28 -04:00
parent cdbeb24a05
commit 60da544d3a
87 changed files with 1465 additions and 1340 deletions
+25 -19
View File
@@ -202,8 +202,9 @@ namespace RoF
if (opcode == 8) {
AltCurrencyPopulate_Struct *populate = (AltCurrencyPopulate_Struct*)emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct)
+ sizeof(structs::AltCurrencyPopulateEntry_Struct) * populate->count);
auto outapp = new EQApplicationPacket(
OP_AltCurrency, sizeof(structs::AltCurrencyPopulate_Struct) +
sizeof(structs::AltCurrencyPopulateEntry_Struct) * populate->count);
structs::AltCurrencyPopulate_Struct *out_populate = (structs::AltCurrencyPopulate_Struct*)outapp->pBuffer;
out_populate->opcode = populate->opcode;
@@ -221,7 +222,7 @@ namespace RoF
dest->FastQueuePacket(&outapp, ack_req);
}
else {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
auto outapp = new EQApplicationPacket(OP_AltCurrency, sizeof(AltCurrencyUpdate_Struct));
memcpy(outapp->pBuffer, emu_buffer, sizeof(AltCurrencyUpdate_Struct));
dest->FastQueuePacket(&outapp, ack_req);
}
@@ -1046,7 +1047,8 @@ namespace RoF
{
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
auto outapp =
new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer;
memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1));
@@ -1064,7 +1066,8 @@ namespace RoF
//if(gjs->action == groupActLeave)
// Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
auto outapp =
new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer;
memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1));
@@ -1101,7 +1104,7 @@ namespace RoF
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
auto outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
char *Buffer = (char *)outapp->pBuffer;
@@ -1167,7 +1170,8 @@ namespace RoF
memcpy(eq->membername, emu->membername, sizeof(eq->membername));
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct));
auto outapp =
new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct));
GroupLeadershipAAUpdate_Struct *GLAAus = (GroupLeadershipAAUpdate_Struct*)outapp->pBuffer;
GLAAus->NPCMarkerID = emu->NPCMarkerID;
@@ -1637,7 +1641,7 @@ namespace RoF
PacketSize += sizeof(structs::MercenaryStance_Struct) * emu->Mercs[r].StanceCount;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryDataResponse, PacketSize);
auto outapp = new EQApplicationPacket(OP_MercenaryDataResponse, PacketSize);
Buffer = (char *)outapp->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->MercTypeCount);
@@ -2025,7 +2029,7 @@ namespace RoF
uint32 PacketSize = 40000; // Calculate this later
EQApplicationPacket *outapp = new EQApplicationPacket(OP_PlayerProfile, PacketSize);
auto outapp = new EQApplicationPacket(OP_PlayerProfile, PacketSize);
outapp->WriteUInt32(0); // Checksum, we will update this later
outapp->WriteUInt32(0); // Checksum size, we will update this later
@@ -2698,7 +2702,7 @@ namespace RoF
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()];
auto NewBuffer = new unsigned char[outapp->GetWritePosition()];
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
safe_delete_array(outapp->pBuffer);
outapp->pBuffer = NewBuffer;
@@ -2720,7 +2724,7 @@ namespace RoF
unsigned char * __emu_buffer = inapp->pBuffer;
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
EQApplicationPacket *outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
general->action = 8;
@@ -2743,7 +2747,7 @@ namespace RoF
{
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
add_member->raidGen.action = in_add_member->raidGen.action;
@@ -2763,7 +2767,8 @@ namespace RoF
else if (raid_gen->action == 35)
{
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) + strlen(inmotd->motd) + 1);
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
strlen(inmotd->motd) + 1);
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
outmotd->general.action = inmotd->general.action;
@@ -2774,7 +2779,8 @@ namespace RoF
else if (raid_gen->action == 14 || raid_gen->action == 30)
{
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
auto outapp =
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
outlaa->action = inlaa->action;
@@ -2787,7 +2793,7 @@ namespace RoF
{
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
@@ -3240,7 +3246,7 @@ namespace RoF
return;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
auto outapp = new EQApplicationPacket(OP_ChangeSize, sizeof(ChangeSize_Struct));
ChangeSize_Struct *css = (ChangeSize_Struct *)outapp->pBuffer;
@@ -3474,7 +3480,7 @@ namespace RoF
in->SetReadPosition(0);
EQApplicationPacket *outapp = new EQApplicationPacket(OP_TaskHistoryReply, OutboundPacketSize);
auto outapp = new EQApplicationPacket(OP_TaskHistoryReply, OutboundPacketSize);
outapp->WriteUInt32(in->ReadUInt32()); // Task index
outapp->WriteUInt32(in->ReadUInt32()); // Activity count
@@ -3786,7 +3792,7 @@ namespace RoF
int Count = wars->playercount;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_WhoAllResponse, in->size + (Count * 4));
auto outapp = new EQApplicationPacket(OP_WhoAllResponse, in->size + (Count * 4));
char *OutBuffer = (char *)outapp->pBuffer;
@@ -3961,7 +3967,7 @@ namespace RoF
SpawnSize = 3;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ZoneEntry, PacketSize);
auto outapp = new EQApplicationPacket(OP_ZoneEntry, PacketSize);
Buffer = (char *)outapp->pBuffer;
BufferStart = Buffer;
VARSTRUCT_ENCODE_STRING(Buffer, emu->name);