1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Convert custom HeadSpin integer types to standard types from stdint.h

This commit is contained in:
2012-01-19 21:19:26 -05:00
parent a0d54e2644
commit 5027b5a4ac
1301 changed files with 14497 additions and 14532 deletions

View File

@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
namespace ND {
extern HMODULE g_lib;
extern const wchar g_version[];
extern const wchar_t g_version[];
//============================================================================
@ -75,7 +75,7 @@ inline unsigned NetProtocolToSrv (ENetProtocol protocol) {
}
//============================================================================
inline const wchar * SrvToString (unsigned srv) {
inline const wchar_t * SrvToString (unsigned srv) {
switch (srv) {
case kDiagSrvAuth: return L"Auth";
@ -92,13 +92,13 @@ struct NetDiag : AtomicRef {
bool destroyed;
CCritSect critsect;
wchar * hosts[kNumDiagSrvs];
wchar_t * hosts[kNumDiagSrvs];
unsigned nodes[kNumDiagSrvs];
~NetDiag ();
void Destroy ();
void SetHost (unsigned srv, const wchar host[]);
void SetHost (unsigned srv, const wchar_t host[]);
};

View File

@ -74,7 +74,7 @@ struct DNSParam {
//============================================================================
static void LookupCallback (
void * param,
const wchar name[],
const wchar_t name[],
unsigned addrCount,
const NetAddress addrs[]
) {
@ -86,7 +86,7 @@ static void LookupCallback (
p->diag->nodes[p->srv] = node;
}
p->diag->critsect.Leave();
wchar nodeStr[64];
wchar_t nodeStr[64];
NetAddressNodeToString(p->diag->nodes[p->srv], nodeStr, arrsize(nodeStr));
p->dump(L"[DNS] Success. %s --> %s", name, nodeStr);
p->callback(
@ -157,7 +157,7 @@ void NetDiagDns (
return;
}
wchar * host = nil;
wchar_t * host = nil;
diag->critsect.Enter();
{
if (diag->hosts[srv])

View File

@ -90,7 +90,7 @@ static const unsigned kPayloadBytes = 32;
static FIcmpCreateFile IcmpCreateFile;
static FIcmpSendEcho IcmpSendEcho;
static byte s_payload[kPayloadBytes];
static uint8_t s_payload[kPayloadBytes];
/*****************************************************************************
@ -100,7 +100,7 @@ static byte s_payload[kPayloadBytes];
***/
//============================================================================
static const wchar * IpStatusToString (ULONG status) {
static const wchar_t * IpStatusToString (ULONG status) {
switch (status) {
case IP_SUCCESS: return L"IP_SUCCESS";
@ -140,13 +140,13 @@ static void __cdecl PingThreadProc (void * param) {
}
char addr[64];
wchar waddr[64];
wchar_t waddr[64];
NetAddressNodeToString(p->diag->nodes[p->srv], waddr, arrsize(waddr));
StrToAnsi(addr, waddr, arrsize(addr));
ENetError result = kNetSuccess;
byte reply[kPayloadBytes + sizeof(ICMP_ECHO_REPLY)];
uint8_t reply[kPayloadBytes + sizeof(ICMP_ECHO_REPLY)];
for (unsigned i = 0; i < kPingCount; ++i) {
DWORD retval = IcmpSendEcho(
@ -190,7 +190,7 @@ void IcmpStartup () {
IcmpCreateFile = (FIcmpCreateFile)GetProcAddress(g_lib, "IcmpCreateFile");
IcmpSendEcho = (FIcmpSendEcho)GetProcAddress(g_lib, "IcmpSendEcho");
}
MemSet(s_payload, (byte)((unsigned_ptr)&s_payload >> 4), arrsize(s_payload));
MemSet(s_payload, (uint8_t)((uintptr_t)&s_payload >> 4), arrsize(s_payload));
}
//============================================================================
@ -245,7 +245,7 @@ void NetDiagIcmp (
return;
}
wchar nodeStr[64];
wchar_t nodeStr[64];
NetAddressNodeToString(node, nodeStr, arrsize(nodeStr));
dump(L"[ICMP] Pinging %s with %u bytes of data...", nodeStr, kPayloadBytes);

View File

@ -86,7 +86,7 @@ struct FileConn : AtomicRef {
void * param;
AsyncSocket sock;
AsyncCancelId cancelId;
ARRAY(byte) recvBuffer;
ARRAY(uint8_t) recvBuffer;
long pingsInRoute;
long pingsCompleted;
bool done;
@ -121,7 +121,7 @@ static long s_authProtocolRegistered;
static unsigned s_transId;
static CCritSect s_critsect;
static bool s_shutdown;
static byte s_payload[32];
static uint8_t s_payload[32];
static AsyncTimer * s_timer;
static HASHTABLEDECL(
@ -145,7 +145,7 @@ static HASHTABLEDECL(
//============================================================================
static bool Recv_PingReply (
const byte msg[],
const uint8_t msg[],
unsigned bytes,
void *
) {
@ -252,12 +252,12 @@ static void AuthPingProc (void * param) {
trans->SetValue(s_transId);
s_authTrans.Add(trans);
const unsigned_ptr msg[] = {
const uintptr_t msg[] = {
kCli2Auth_PingRequest,
trans->pingAtMs,
trans->GetValue(),
sizeof(s_payload),
(unsigned_ptr) s_payload,
(uintptr_t) s_payload,
};
NetCliSend(conn->cli, msg, arrsize(msg));
@ -536,10 +536,10 @@ static bool NotifyFileConnSocketRead (FileConn * conn, AsyncNotifySocketRead * r
read->bytesProcessed += read->bytes;
for (;;) {
if (conn->recvBuffer.Count() < sizeof(dword))
if (conn->recvBuffer.Count() < sizeof(uint32_t))
return true;
dword msgSize = *(dword *)conn->recvBuffer.Ptr();
uint32_t msgSize = *(uint32_t *)conn->recvBuffer.Ptr();
if (conn->recvBuffer.Count() < msgSize)
return true;
@ -607,7 +607,7 @@ static void StartAuthTcpTest (
if (0 == AtomicSet(&s_authProtocolRegistered, 1)) {
MemSet(
s_payload,
(byte)((unsigned_ptr)&s_payload >> 4),
(uint8_t)((uintptr_t)&s_payload >> 4),
sizeof(s_payload)
);
NetMsgProtocolRegister(
@ -621,7 +621,7 @@ static void StartAuthTcpTest (
);
}
wchar addrStr[128];
wchar_t addrStr[128];
NetAddressToString(addr, addrStr, arrsize(addrStr), kNetAddressFormatAll);
dump(L"[TCP] Connecting to SrvAuth at %s...", addrStr);
@ -635,7 +635,7 @@ static void StartAuthTcpTest (
conn->IncRef("Connecting");
Cli2Auth_Connect connect;
connect.hdr.connType = (byte) kConnTypeCliToAuth;
connect.hdr.connType = (uint8_t) kConnTypeCliToAuth;
connect.hdr.hdrBytes = sizeof(connect.hdr);
connect.hdr.buildId = BuildId();
connect.hdr.buildType = BUILD_TYPE_LIVE;
@ -664,7 +664,7 @@ static void StartFileTcpTest (
FNetDiagTestCallback callback,
void * param
) {
wchar addrStr[128];
wchar_t addrStr[128];
NetAddressToString(addr, addrStr, arrsize(addrStr), kNetAddressFormatAll);
dump(L"[TCP] Connecting to SrvFile at %s...", addrStr);

View File

@ -65,9 +65,9 @@ namespace ND {
***/
HMODULE g_lib;
//const wchar g_version[] = L"miasma";
//const wchar g_version[] = L"ectomorph";
const wchar g_version[] = L"solvent";
//const wchar_t g_version[] = L"miasma";
//const wchar_t g_version[] = L"ectomorph";
const wchar_t g_version[] = L"solvent";
} // namespace ND
@ -86,7 +86,7 @@ NetDiag::~NetDiag () {
}
//============================================================================
void NetDiag::SetHost (unsigned srv, const wchar host[]) {
void NetDiag::SetHost (unsigned srv, const wchar_t host[]) {
critsect.Enter();
{
@ -155,7 +155,7 @@ void NetDiagDelete (NetDiag * diag) {
void NetDiagSetHost (
NetDiag * diag,
ENetProtocol protocol,
const wchar host[]
const wchar_t host[]
) {
ASSERT(diag);

View File

@ -78,11 +78,11 @@ void NetDiagDelete (NetDiag * diag);
void NetDiagSetHost (
NetDiag * diag,
ENetProtocol protocol,
const wchar name[]
const wchar_t name[]
);
typedef void ( __cdecl * FNetDiagDumpProc)(
const wchar fmt[],
const wchar_t fmt[],
...
);
typedef void (*FNetDiagTestCallback)(

View File

@ -110,8 +110,8 @@ void NetDiagSys (
ASSERT(callback);
{ // Timestamp
wchar str[256];
qword time = TimeGetTime();
wchar_t str[256];
uint64_t time = TimeGetTime();
TimePrettyPrint(time, arrsize(str), str);
dump(L"[SYS] Time: %s UTC", str);
}
@ -121,7 +121,7 @@ void NetDiagSys (
}
{ // Product
wchar product[128];
wchar_t product[128];
ProductString(product, arrsize(product));
dump(L"[SYS] Product: %s", product);
}
@ -139,9 +139,9 @@ void NetDiagSys (
}
{ // System
word cpuCaps;
dword cpuVendor[3];
word cpuSignature;
uint16_t cpuCaps;
uint32_t cpuVendor[3];
uint16_t cpuSignature;
CpuGetInfo(&cpuCaps, cpuVendor, &cpuSignature);
SYSTEM_INFO info;
GetSystemInfo(&info);