Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -310,15 +310,15 @@ void ClientNetworkGameSocketHandler::ClientError(NetworkRecvStatus res)
|
||||
ClientNetworkGameSocketHandler * ClientNetworkGameSocketHandler::my_client = nullptr;
|
||||
|
||||
/** Last frame we performed an ack. */
|
||||
static uint32 last_ack_frame;
|
||||
static uint32_t last_ack_frame;
|
||||
|
||||
/** One bit of 'entropy' used to generate a salt for the company passwords. */
|
||||
static uint32 _password_game_seed;
|
||||
static uint32_t _password_game_seed;
|
||||
/** The other bit of 'entropy' used to generate a salt for the company passwords. */
|
||||
static std::string _password_server_id;
|
||||
|
||||
/** Maximum number of companies of the currently joined server. */
|
||||
static uint8 _network_server_max_companies;
|
||||
static uint8_t _network_server_max_companies;
|
||||
/** The current name of the server you are on. */
|
||||
std::string _network_server_name;
|
||||
|
||||
@@ -427,7 +427,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::SendCommand(const CommandPacke
|
||||
}
|
||||
|
||||
/** Send a chat-packet over the network */
|
||||
NetworkRecvStatus ClientNetworkGameSocketHandler::SendChat(NetworkAction action, DestType type, int dest, const std::string &msg, int64 data)
|
||||
NetworkRecvStatus ClientNetworkGameSocketHandler::SendChat(NetworkAction action, DestType type, int dest, const std::string &msg, int64_t data)
|
||||
{
|
||||
Packet *p = new Packet(PACKET_CLIENT_CHAT);
|
||||
|
||||
@@ -783,7 +783,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MAP_DATA(Packet
|
||||
/* We are still receiving data, put it to the file */
|
||||
this->savegame->AddPacket(p);
|
||||
|
||||
_network_join_bytes = (uint32)this->savegame->written_bytes;
|
||||
_network_join_bytes = (uint32_t)this->savegame->written_bytes;
|
||||
SetWindowDirty(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_JOIN);
|
||||
|
||||
return NETWORK_RECV_STATUS_OKAY;
|
||||
@@ -857,9 +857,9 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_FRAME(Packet *p
|
||||
/* Test if the server supports this option
|
||||
* and if we are at the frame the server is */
|
||||
#ifdef NETWORK_SEND_DOUBLE_SEED
|
||||
if (p->CanReadFromPacket(sizeof(uint32) + sizeof(uint32))) {
|
||||
if (p->CanReadFromPacket(sizeof(uint32_t) + sizeof(uint32_t))) {
|
||||
#else
|
||||
if (p->CanReadFromPacket(sizeof(uint32))) {
|
||||
if (p->CanReadFromPacket(sizeof(uint32_t))) {
|
||||
#endif
|
||||
_sync_frame = _frame_counter_server;
|
||||
_sync_seed_1 = p->Recv_uint32();
|
||||
@@ -869,7 +869,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_FRAME(Packet *p
|
||||
}
|
||||
#endif
|
||||
/* Receive the token. */
|
||||
if (p->CanReadFromPacket(sizeof(uint8))) this->token = p->Recv_uint8();
|
||||
if (p->CanReadFromPacket(sizeof(uint8_t))) this->token = p->Recv_uint8();
|
||||
|
||||
Debug(net, 7, "Received FRAME {}", _frame_counter_server);
|
||||
|
||||
@@ -927,7 +927,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CHAT(Packet *p)
|
||||
ClientID client_id = (ClientID)p->Recv_uint32();
|
||||
bool self_send = p->Recv_bool();
|
||||
std::string msg = p->Recv_string(NETWORK_CHAT_LENGTH);
|
||||
int64 data = p->Recv_uint64();
|
||||
int64_t data = p->Recv_uint64();
|
||||
|
||||
ci_to = NetworkClientInfo::GetByClientID(client_id);
|
||||
if (ci_to == nullptr) return NETWORK_RECV_STATUS_OKAY;
|
||||
@@ -1121,7 +1121,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_COMPANY_UPDATE(
|
||||
{
|
||||
if (this->status < STATUS_ACTIVE) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
|
||||
|
||||
static_assert(sizeof(_network_company_passworded) <= sizeof(uint16));
|
||||
static_assert(sizeof(_network_company_passworded) <= sizeof(uint16_t));
|
||||
_network_company_passworded = p->Recv_uint16();
|
||||
SetWindowClassesDirty(WC_COMPANY);
|
||||
|
||||
@@ -1291,7 +1291,7 @@ void NetworkUpdateClientName(const std::string &client_name)
|
||||
* @param msg The actual message.
|
||||
* @param data Arbitrary extra data.
|
||||
*/
|
||||
void NetworkClientSendChat(NetworkAction action, DestType type, int dest, const std::string &msg, int64 data)
|
||||
void NetworkClientSendChat(NetworkAction action, DestType type, int dest, const std::string &msg, int64_t data)
|
||||
{
|
||||
MyClient::SendChat(action, type, dest, msg, data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user