clang-modernize -use-auto convert for ucs/clientlist.cpp

This commit is contained in:
Michael Cook (mackal) 2015-01-09 02:57:00 -05:00
parent 1873b1d739
commit b34b26c423

View File

@ -225,7 +225,7 @@ std::vector<std::string> ParseRecipients(std::string RecipientString) {
sort(RecipientList.begin(), RecipientList.end());
std::vector<std::string>::iterator new_end_pos = unique(RecipientList.begin(), RecipientList.end());
auto new_end_pos = unique(RecipientList.begin(), RecipientList.end());
RecipientList.erase(new_end_pos, RecipientList.end());
@ -310,7 +310,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) {
int PacketLength = 10 + Recipient.length() + Subject.length();
// Failure
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MailDeliveryStatus, PacketLength);
auto outapp = new EQApplicationPacket(OP_MailDeliveryStatus, PacketLength);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -334,7 +334,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) {
if(Success) {
// Success
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MailDeliveryStatus, 10);
auto outapp = new EQApplicationPacket(OP_MailDeliveryStatus, 10);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -407,7 +407,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) {
if(Buddy.substr(0, 1) == "-")
SubAction = 0;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_Buddy, Buddy.length() + 2);
auto outapp = new EQApplicationPacket(OP_Buddy, Buddy.length() + 2);
char *PacketBuffer = (char *)outapp->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, SubAction);
@ -458,7 +458,7 @@ static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
Ignoree = "SOE.EQ." + WorldShortName + "." + Ignoree;
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_Ignore, Ignoree.length() + 2);
auto outapp = new EQApplicationPacket(OP_Ignore, Ignoree.length() + 2);
char *PacketBuffer = (char *)outapp->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, SubAction);
@ -589,7 +589,7 @@ void Clientlist::Process() {
eqs->SetOpcodeManager(&ChatOpMgr);
Client *c = new Client(eqs);
auto c = new Client(eqs);
ClientChatConnections.push_back(c);
}
@ -931,7 +931,7 @@ void Client::SendMailBoxes() {
PacketLength += s.length() + 1;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MailLogin, PacketLength);
auto outapp = new EQApplicationPacket(OP_MailLogin, PacketLength);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1080,8 +1080,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
}
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_Mail, JoinedChannelsList.length() + 1);
auto outapp = new EQApplicationPacket(OP_Mail, JoinedChannelsList.length() + 1);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1168,8 +1167,7 @@ void Client::LeaveChannels(std::string ChannelNameList) {
}
}
EQApplicationPacket *outapp = new EQApplicationPacket(OP_Mail, JoinedChannelsList.length() + 1);
auto outapp = new EQApplicationPacket(OP_Mail, JoinedChannelsList.length() + 1);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1268,7 +1266,7 @@ void Client::SendChannelList() {
if(ChannelCount == 0)
ChannelMessage = "You are not on any channels.";
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChannelMessage, ChannelMessage.length() + 3);
auto outapp = new EQApplicationPacket(OP_ChannelMessage, ChannelMessage.length() + 3);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1506,7 +1504,7 @@ void Client::SendChannelMessage(std::string ChannelName, std::string Message, Cl
if(UnderfootOrLater)
PacketLength += 8;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChannelMessage, PacketLength);
auto outapp = new EQApplicationPacket(OP_ChannelMessage, PacketLength);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1548,7 +1546,7 @@ void Client::AnnounceJoin(ChatChannel *Channel, Client *c) {
int PacketLength = Channel->GetName().length() + c->GetName().length() + 2;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChannelAnnounceJoin, PacketLength);
auto outapp = new EQApplicationPacket(OP_ChannelAnnounceJoin, PacketLength);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1568,7 +1566,7 @@ void Client::AnnounceLeave(ChatChannel *Channel, Client *c) {
int PacketLength = Channel->GetName().length() + c->GetName().length() + 2;
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChannelAnnounceLeave, PacketLength);
auto outapp = new EQApplicationPacket(OP_ChannelAnnounceLeave, PacketLength);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -1594,7 +1592,7 @@ void Client::GeneralChannelMessage(const char *Characters) {
void Client::GeneralChannelMessage(std::string Message) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_ChannelMessage, Message.length() + 3);
auto outapp = new EQApplicationPacket(OP_ChannelMessage, Message.length() + 3);
char *PacketBuffer = (char *)outapp->pBuffer;
VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x00);
VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x00);
@ -2280,7 +2278,7 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin
int PacketLength = 8 + strlen(sMessageID) + strlen(TimeStamp)+ From.length() + Subject.length();
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MailNew, PacketLength);
auto outapp = new EQApplicationPacket(OP_MailNew, PacketLength);
char *PacketBuffer = (char *)outapp->pBuffer;
@ -2306,7 +2304,7 @@ void Client::ChangeMailBox(int NewMailBox) {
_log(UCS__TRACE, "New mailbox is %s", MailBoxName().c_str());
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MailboxChange, 2);
auto outapp = new EQApplicationPacket(OP_MailboxChange, 2);
char *buf = (char *)outapp->pBuffer;