[PATCH] Fix 2 Show-stopping Compile Errors
Posted: Fri Dec 26, 2008 12:42 pm
Using:
Linux fargle 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64 GNU/Linux
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
The code will not compile at all without these two changes - both fatal compile errors dealing with loss of precision when casting.
------------- snip ----------------
Index: common/CRC16.cpp
===================================================================
--- common/CRC16.cpp (revision 180)
+++ common/CRC16.cpp (working copy)
@@ -308,7 +308,7 @@
ecx ^= eax; //xor ecx, eax
ecx &= 0xFF; //and ecx, 0FFh
esi = IntArray[ecx]; //mov esi, dword_0_10115D38[ecx*4]
- ecx = (int) buf; //mov ecx, [esp+4+arg_0]
+ ecx = (unsigned long) buf; //mov ecx, [esp+4+arg_0]
eax = eax >> 8; //sar eax, 8
eax &= 0x00FFFFFF; //and eax, 0FFFFFFh
eax ^= esi; //xor eax, esi
Index: client.cpp
===================================================================
--- client.cpp (revision 180)
+++ client.cpp (working copy)
@@ -1336,7 +1336,7 @@
MClients.lock();
for(client_iter=client_list.begin(); client_list.size() > 0 && client_iter!=client_list.end(); client_iter++){
client = *client_iter;
- LogFile->write(EQEMuLog::Debug, "World: ClientList[0x%08x]::FindByAccountID(0x%08x) client[0x%08x]", (int32) this, account_id, client);
+ LogFile->write(EQEMuLog::Debug, "World: ClientList[0x%08x]::FindByAccountID(0x%08x) client[0x%08x]", (ClientList *) this, account_id, client);
if (client->GetAccountID() == account_id) {
ret = client;
break;
Linux fargle 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64 GNU/Linux
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
The code will not compile at all without these two changes - both fatal compile errors dealing with loss of precision when casting.
------------- snip ----------------
Index: common/CRC16.cpp
===================================================================
--- common/CRC16.cpp (revision 180)
+++ common/CRC16.cpp (working copy)
@@ -308,7 +308,7 @@
ecx ^= eax; //xor ecx, eax
ecx &= 0xFF; //and ecx, 0FFh
esi = IntArray[ecx]; //mov esi, dword_0_10115D38[ecx*4]
- ecx = (int) buf; //mov ecx, [esp+4+arg_0]
+ ecx = (unsigned long) buf; //mov ecx, [esp+4+arg_0]
eax = eax >> 8; //sar eax, 8
eax &= 0x00FFFFFF; //and eax, 0FFFFFFh
eax ^= esi; //xor eax, esi
Index: client.cpp
===================================================================
--- client.cpp (revision 180)
+++ client.cpp (working copy)
@@ -1336,7 +1336,7 @@
MClients.lock();
for(client_iter=client_list.begin(); client_list.size() > 0 && client_iter!=client_list.end(); client_iter++){
client = *client_iter;
- LogFile->write(EQEMuLog::Debug, "World: ClientList[0x%08x]::FindByAccountID(0x%08x) client[0x%08x]", (int32) this, account_id, client);
+ LogFile->write(EQEMuLog::Debug, "World: ClientList[0x%08x]::FindByAccountID(0x%08x) client[0x%08x]", (ClientList *) this, account_id, client);
if (client->GetAccountID() == account_id) {
ret = client;
break;