Package: xmule
Version: 1.9.5-1
Severity: normal
Tags: patch
When building 'xmule' on amd64/unstable with gcc-4.0,
I get the following error:
==== Building xMule ====
AddFileThread.cpp
AddFileThread.cpp: In member function 'virtual void* CAddFileThread::Entry()':
AddFileThread.cpp:112: error: cast from 'CPartFile*' to 'int' loses precision
make[2]: *** [obj/AddFileThread.o] Error 1
make[1]: *** [all] Error 2
make[1]: Leaving directory `/xmule-1.9.5'
make: *** [build-stamp] Error 2
With the attached patch 'xmule' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/xmule-1.9.5/src/AddFileThread.cpp ./src/AddFileThread.cpp
--- ../tmp-orig/xmule-1.9.5/src/AddFileThread.cpp 2005-01-06
21:35:44.000000000 +0100
+++ ./src/AddFileThread.cpp 2005-03-31 23:39:28.846407260 +0200
@@ -109,7 +109,7 @@
{
wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED,
TM_FINISHEDHASHING);
evt.SetClientData(newrecord);
- evt.SetInt((int) hashfile->owner);
+ evt.SetInt((long) hashfile->owner);
wxPostEvent(theApp.xmuledlg, evt);
}
delete[] hashfile->name;
diff -urN ../tmp-orig/xmule-1.9.5/src/BaseClient.cpp ./src/BaseClient.cpp
--- ../tmp-orig/xmule-1.9.5/src/BaseClient.cpp 2005-01-06 21:35:44.000000000
+0100
+++ ./src/BaseClient.cpp 2005-03-31 23:40:27.877339264 +0200
@@ -349,7 +349,7 @@
if
(theApp.listensocket->offensecounter.find(id) !=
theApp.listensocket->offensecounter.end())
theApp.listensocket->offensecounter[id]++;
else
-
theApp.listensocket->offensecounter[id] = (uint32_t) 1;
+
theApp.listensocket->offensecounter[id] = (unsigned long) 1;
theApp.listensocket->offensecounter[0]++;
}
}
@@ -452,7 +452,7 @@
{
uint32_t test;
data->Read( &test, 4);
- if (test == (uint32_t) "KDLM")
+ if (test == (unsigned long) "KDLM")
{
m_bIsML = true;
}
@@ -531,7 +531,7 @@
if (theApp.listensocket->offensecounter.find(id)
!= theApp.listensocket->offensecounter.end())
theApp.listensocket->offensecounter[id]++;
else
- theApp.listensocket->offensecounter[id] =
(uint32_t) 1;
+ theApp.listensocket->offensecounter[id] =
(unsigned long) 1;
}
// Detection id change [BlackRat]
/*
@@ -550,7 +550,7 @@
if (theApp.listensocket->offensecounter.find(id)
!= theApp.listensocket->offensecounter.end())
theApp.listensocket->offensecounter[id]++;
else
- theApp.listensocket->offensecounter[id] =
(uint32_t) 1;
+ theApp.listensocket->offensecounter[id] =
(unsigned long) 1;
theApp.listensocket->offensecounter[0]++;
}
theApp.listensocket->hashbase[id] = thishash;
@@ -612,7 +612,7 @@
uint8_t hashsize = 16;
data->Write( &hashsize, 1);
SendHelloTypePacket(data);
- NewSocket_SendPacketOPdata(2, OP_HELLO, data, (uint32_t) this, 0);
+ NewSocket_SendPacketOPdata(2, OP_HELLO, data, (unsigned long) this, 0);
delete data;
//faz:m_bHelloAnswerPending = true;
}
@@ -663,11 +663,11 @@
if (!bAnswer)
{
- NewSocket_SendPacketOP(2, OP_EMULEINFO, packet, (uint32_t) this,
1);
+ NewSocket_SendPacketOP(2, OP_EMULEINFO, packet, (unsigned long)
this, 1);
}
else
{
- NewSocket_SendPacketOP(2, OP_EMULEINFOANSWER, packet, (uint32_t)
this, 1);
+ NewSocket_SendPacketOP(2, OP_EMULEINFOANSWER, packet, (unsigned
long) this, 1);
}
}
}
@@ -794,7 +794,7 @@
SendHelloTypePacket(data);
if (socket)
{
- NewSocket_SendPacketOPdata(2, OP_HELLOANSWER, data, (uint32_t) this,
0);
+ NewSocket_SendPacketOPdata(2, OP_HELLOANSWER, data, (unsigned long)
this, 0);
}
delete data;
}
@@ -1205,18 +1205,18 @@
if (theApp.uploadqueue->IsDownloading(this))
{
SetUploadState(US_UPLOADING);
- NewSocket_SendPacketOPdata(2, OP_ACCEPTUPLOADREQ, NULL, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_ACCEPTUPLOADREQ, NULL, (unsigned
long) this, 0);
}
}
if (m_iFileListRequested == 1)
{
if (m_bSharedDirectories)
{
- NewSocket_SendPacketOPdata(2, OP_ASKSHAREDDIRS, NULL, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_ASKSHAREDDIRS, NULL, (unsigned
long) this, 0);
}
else
{
- NewSocket_SendPacketOPdata(2, OP_ASKSHAREDFILES, NULL, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_ASKSHAREDFILES, NULL, (unsigned
long) this, 0);
}
}
}
@@ -1445,7 +1445,7 @@
Packet *packet = new Packet(OP_PUBLICKEY,
theApp.clientcredits->GetPubKeyLen() + 1, OP_EMULEPROT);
memcpy(packet->pBuffer + 1, theApp.clientcredits->GetPublicKey(),
theApp.clientcredits->GetPubKeyLen());
packet->pBuffer[0] = theApp.clientcredits->GetPubKeyLen();
- NewSocket_SendPacketOP(2, OP_PUBLICKEY, packet, (uint32_t) this,
0);
+ NewSocket_SendPacketOP(2, OP_PUBLICKEY, packet, (unsigned long)
this, 0);
m_SecureIdentState = IS_SIGNATURENEEDED;
}
}
@@ -1530,7 +1530,7 @@
{
packet->pBuffer[1 + siglen] = byChaIPKind;
}
- NewSocket_SendPacketOP(2, OP_SIGNATURE, packet,
(uint32_t) this, 0);
+ NewSocket_SendPacketOP(2, OP_SIGNATURE, packet,
(unsigned long) this, 0);
m_SecureIdentState = IS_ALLREQUESTSSEND;
}
}
@@ -1619,7 +1619,7 @@
Packet *packet = new Packet(OP_SECIDENTSTATE, 5, OP_EMULEPROT);
packet->pBuffer[0] = nValue;
memcpy(packet->pBuffer + 1, &dwRandom, sizeof(dwRandom));
- NewSocket_SendPacketOP(2, OP_SECIDENTSTATE, packet, (uint32_t)
this, 0);
+ NewSocket_SendPacketOP(2, OP_SECIDENTSTATE, packet, (unsigned
long) this, 0);
}
}
}
@@ -1781,7 +1781,7 @@
{
if (socket->IsConnected())
{
- NewSocket_SendPacket(4, packet, (uint32_t) this, 0);
+ NewSocket_SendPacket(4, packet, (unsigned long) this, 0);
}
else
{
diff -urN ../tmp-orig/xmule-1.9.5/src/ClientCredits.cpp ./src/ClientCredits.cpp
--- ../tmp-orig/xmule-1.9.5/src/ClientCredits.cpp 2005-03-31
23:46:32.822913843 +0200
+++ ./src/ClientCredits.cpp 2005-03-31 23:41:03.427673759 +0200
@@ -106,7 +106,7 @@
void CClientCredits::ShowCHandPK(uint32_t challenge, unsigned char * pk, int
length)
{
- printf(" credits=%u challenge=%u length=%d publickey=", (uint32_t)
this, challenge, length);
+ printf(" credits=%lu challenge=%u length=%d publickey=", (unsigned
long) this, challenge, length);
for (int i = 0 ; i < length ; i++)
{
if (i < 5 || i > length - 6)
diff -urN ../tmp-orig/xmule-1.9.5/src/DownloadClient.cpp
./src/DownloadClient.cpp
--- ../tmp-orig/xmule-1.9.5/src/DownloadClient.cpp 2005-01-06
21:35:44.000000000 +0100
+++ ./src/DownloadClient.cpp 2005-03-31 23:41:42.093424129 +0200
@@ -217,13 +217,13 @@
dataFileReq = new CSafeMemFile(16);
dataFileReq->Write(reqfile->GetFileHash(), 16);
}
- NewSocket_SendPacketOPdata(2, OP_FILEREQUEST, dataFileReq, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_FILEREQUEST, dataFileReq, (unsigned
long) this, 0);
delete dataFileReq;
if (reqfile->GetPartCount() > 0)
{
CSafeMemFile dataSetReqFileID(16);
dataSetReqFileID.Write(reqfile->GetFileHash(), 16);
- NewSocket_SendPacketOPdata(2, OP_SETREQFILEID, &dataSetReqFileID,
(uint32_t) this, 0);
+ NewSocket_SendPacketOPdata(2, OP_SETREQFILEID, &dataSetReqFileID,
(unsigned long) this, 0);
}
if (IsEmuleClient())
{
@@ -237,7 +237,7 @@
reqfile->SetLastAnsweredTimeTimeout();
Packet *packet = new Packet(OP_REQUESTSOURCES, 16,
OP_EMULEPROT);
md4cpy(packet->pBuffer, reqfile->GetFileHash());
- NewSocket_SendPacketOP(2, OP_REQUESTSOURCES, packet,
(uint32_t) this, 0);
+ NewSocket_SendPacketOP(2, OP_REQUESTSOURCES, packet, (unsigned
long) this, 0);
SetLastAskedForSources();
}
}
@@ -318,7 +318,7 @@
{
Packet *packet = new Packet(OP_HASHSETREQUEST, 16);
memcpy(packet->pBuffer, reqfile->GetFileHash(), 16);
- NewSocket_SendPacketOP(2, OP_HASHSETREQUEST, packet, (uint32_t)
this, 0);
+ NewSocket_SendPacketOP(2, OP_HASHSETREQUEST, packet, (unsigned
long) this, 0);
SetDownloadState(DS_REQHASHSET);
reqfile->hashsetneeded = false;
m_bHashsetRequested = true;
@@ -329,7 +329,7 @@
SetDownloadState(DS_ONQUEUE);
data = new CSafeMemFile(16);
data->Write(this->reqfile->GetFileHash(), 16);
- NewSocket_SendPacketOPdata(2, OP_STARTUPLOADREQ, data, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_STARTUPLOADREQ, data, (unsigned
long) this, 0);
}
reqfile->NewSrcPartsInfo();
}
@@ -438,7 +438,7 @@
delete data;
data = new CSafeMemFile(16);
data->Write(this->reqfile->GetFileHash(), 16);
- NewSocket_SendPacketOPdata(2, OP_STARTUPLOADREQ, data,
(uint32_t) this, 1);
+ NewSocket_SendPacketOPdata(2, OP_STARTUPLOADREQ, data,
(unsigned long) this, 1);
}
else
{
@@ -483,7 +483,7 @@
}
if (m_PendingBlocks_list.IsEmpty())
{
- NewSocket_SendPacketOPdata(2, OP_CANCELTRANSFER, NULL, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_CANCELTRANSFER, NULL, (unsigned
long) this, 0);
SetDownloadState(DS_NONEEDEDPARTS);
}
else
@@ -521,7 +521,7 @@
data->Write( &null, 4);
}
}
- NewSocket_SendPacketOPdata(2, OP_REQUESTPARTS, data, (uint32_t)
this, 0);
+ NewSocket_SendPacketOPdata(2, OP_REQUESTPARTS, data, (unsigned
long) this, 0);
delete data;
}
}
@@ -794,7 +794,7 @@
}
if ((::GetTickCount() - m_dwLastBlockReceived) > DOWNLOADTIMEOUT)
{
- NewSocket_SendPacketOPdata(2, OP_CANCELTRANSFER, NULL, (uint32_t)
this, 1);
+ NewSocket_SendPacketOPdata(2, OP_CANCELTRANSFER, NULL, (unsigned long)
this, 1);
SetDownloadState(DS_ONQUEUE);
}
return m_nDownDatarate;
@@ -894,7 +894,7 @@
void CUpDownClient::UpdateDisplayedInfo(bool force)
{
DWORD curTick =::GetTickCount();
- if (force || curTick - m_lastRefreshedDLDisplay >
MINWAIT_BEFORE_DLDISPLAY_WINDOWUPDATE + (uint32_t)(rand() / (RAND_MAX/1000)))
+ if (force || curTick - m_lastRefreshedDLDisplay >
MINWAIT_BEFORE_DLDISPLAY_WINDOWUPDATE + (unsigned long)(rand() /
(RAND_MAX/1000)))
{
theApp.xmuledlg->transferwnd->downloadlistctrl->UpdateItem(this);
m_lastRefreshedDLDisplay = curTick;
diff -urN ../tmp-orig/xmule-1.9.5/src/ListenSocket.cpp ./src/ListenSocket.cpp
--- ../tmp-orig/xmule-1.9.5/src/ListenSocket.cpp 2005-01-06
21:35:44.000000000 +0100
+++ ./src/ListenSocket.cpp 2005-03-31 23:43:01.366560823 +0200
@@ -356,7 +356,7 @@
client->SendCommentInfo(reqfile);
Packet *packet = new Packet(data);
delete data;
- NewSocket_SendPacketOP(3, OP_FILEREQANSWER, packet,
(wxUint32) this, OP_FILEREQUEST);
+ NewSocket_SendPacketOP(3, OP_FILEREQANSWER, packet,
(unsigned long) this, OP_FILEREQUEST);
}
}
}
@@ -506,7 +506,7 @@
// send file request no such file packet (0x48)
Packet *replypacket = new Packet(OP_FILEREQANSNOFIL, 16);
memcpy(replypacket->pBuffer, packet, 16);
- NewSocket_SendPacket(3, replypacket, (wxUint32) this,
OP_SETREQFILEID);
+ NewSocket_SendPacket(3, replypacket, (unsigned long) this,
OP_SETREQFILEID);
}
else
{
@@ -529,7 +529,7 @@
data->Write( &null, 3);
}
Packet *packet = new Packet(data);
- NewSocket_SendPacketOP(3, OP_FILESTATUS, packet,
(wxUint32) this, OP_SETREQFILEID);
+ NewSocket_SendPacketOP(3, OP_FILESTATUS, packet, (unsigned
long) this, OP_SETREQFILEID);
delete data;
}
break;
@@ -626,7 +626,7 @@
}
// create a packet and send it
Packet *replypacket = new Packet( &tempfile);
- NewSocket_SendPacketOP(3, OP_ASKSHAREDFILESANSWER, replypacket,
(wxUint32) this, OP_ASKSHAREDFILES);
+ NewSocket_SendPacketOP(3, OP_ASKSHAREDFILESANSWER, replypacket,
(unsigned long) this, OP_ASKSHAREDFILES);
break;
}
case OP_ASKSHAREDFILESANSWER:
@@ -662,14 +662,14 @@
tempfile.Write(strDir.c_str(), cnt);
}
Packet *replypacket = new Packet( &tempfile);
- NewSocket_SendPacketOP(3, OP_ASKSHAREDDIRSANS, replypacket,
(wxUint32) this, OP_ASKSHAREDDIRS);
+ NewSocket_SendPacketOP(3, OP_ASKSHAREDDIRSANS, replypacket,
(unsigned long) this, OP_ASKSHAREDDIRS);
}
else
{
theApp.xmuledlg->AddLogLine(true, _("User %s (%u) requested
your shareddirectories-list->%s"),
client->GetUserName(), client->GetUserID(), _("denied"));
Packet *replypacket = new Packet(OP_ASKSHAREDDENIEDANS, 0);
- NewSocket_SendPacket(3, replypacket, (wxUint32) this,
OP_ASKSHAREDDIRS);
+ NewSocket_SendPacket(3, replypacket, (unsigned long) this,
OP_ASKSHAREDDIRS);
}
break;
}
@@ -704,14 +704,14 @@
list.RemoveHead();
}
Packet *replypacket = new Packet( &tempfile);
- NewSocket_SendPacketOP(3, OP_ASKSHAREDFILESDIRANS,
replypacket, (wxUint32) this, OP_ASKSHAREDFILESDIR);
+ NewSocket_SendPacketOP(3, OP_ASKSHAREDFILESDIRANS,
replypacket, (unsigned long) this, OP_ASKSHAREDFILESDIR);
}
else
{
theApp.xmuledlg->AddLogLine(true, _("User %s (%u)
requested your sharedfiles-list for directory %s->%s"),
client->GetUserName(), client->GetUserID(), strReqDir,
_("denied"));
Packet *replypacket = new
Packet(OP_ASKSHAREDDENIEDANS, 0);
- NewSocket_SendPacket(3, replypacket, (wxUint32) this,
OP_ASKSHAREDFILESDIR);
+ NewSocket_SendPacket(3, replypacket, (unsigned long)
this, OP_ASKSHAREDFILESDIR);
}
delete[] strReqDir;
}
@@ -742,7 +742,7 @@
tempfile.Write( &cnt, 2);
tempfile.Write(strDir, cnt);
Packet *replypacket = new Packet( &tempfile);
- NewSocket_SendPacketOP(3, OP_ASKSHAREDFILESDIR,
replypacket, (wxUint32) this, OP_ASKSHAREDDIRSANS);
+ NewSocket_SendPacketOP(3, OP_ASKSHAREDFILESDIR,
replypacket, (unsigned long) this, OP_ASKSHAREDDIRSANS);
client->SetFileListRequested(iDir + 1);
delete[] strDir;
}
@@ -881,7 +881,7 @@
Packet *tosend = file->CreateSrcInfoPacket(client);
if (tosend)
{
- NewSocket_SendPacket(3, tosend, (wxUint32)
this, OP_REQUESTSOURCES);
+ NewSocket_SendPacket(3, tosend, (unsigned
long) this, OP_REQUESTSOURCES);
}
}
}
diff -urN ../tmp-orig/xmule-1.9.5/src/NewFunctions.cpp ./src/NewFunctions.cpp
--- ../tmp-orig/xmule-1.9.5/src/NewFunctions.cpp 2005-01-06
21:35:44.000000000 +0100
+++ ./src/NewFunctions.cpp 2005-03-31 23:43:32.555713017 +0200
@@ -228,7 +228,7 @@
{
toinsert->Data2 = 0;
}
- toinsert->Data = (uint32_t) data;
+ toinsert->Data = (unsigned long) data;
toinsert->prev = base->prev;
toinsert->next = base;
if(key) {
@@ -264,7 +264,7 @@
{
toinsert->Data2 = 0;
}
- toinsert->Data = (uint32_t) data;
+ toinsert->Data = (unsigned long) data;
toinsert->prev = base;
toinsert->next = base->next;
if(key) {
diff -urN ../tmp-orig/xmule-1.9.5/src/NewSockets.cpp ./src/NewSockets.cpp
--- ../tmp-orig/xmule-1.9.5/src/NewSockets.cpp 2005-01-06 21:35:44.000000000
+0100
+++ ./src/NewSockets.cpp 2005-03-31 23:43:59.433673538 +0200
@@ -285,8 +285,8 @@
value -= 400;
if (newprefs04_opt[value])
{
- printf("r_ProcessPacket(%u)->%02x_%s(%d) size=%d
client=%u\n", value, opcode,
- (const char *)(newprefs04info[opcode].Mid(17)), opcode, size,
(wxUint32) client);
+ printf("r_ProcessPacket(%u)->%02x_%s(%d) size=%d
client=%lu\n", value, opcode,
+ (const char *)(newprefs04info[opcode].Mid(17)), opcode, size,
(unsigned long) client);
}
}
else
diff -urN ../tmp-orig/xmule-1.9.5/src/StatisticsDlg.cpp ./src/StatisticsDlg.cpp
--- ../tmp-orig/xmule-1.9.5/src/StatisticsDlg.cpp 2005-01-06
21:35:44.000000000 +0100
+++ ./src/StatisticsDlg.cpp 2005-03-31 23:44:47.996568244 +0200
@@ -905,7 +905,7 @@
//,TVE_EXPAND);:
stattree->Expand(item);
temp = "";
- for (ix = 0 ; ix < 3 * (int) stattree->GetItemData(item) ; ix++) temp
+= " ";
+ for (ix = 0 ; ix < 3 * (long) stattree->GetItemData(item) ; ix++) temp
+= " ";
text += "<br>" + temp + stattree->GetItemText(item);
}
// set the string
diff -urN ../tmp-orig/xmule-1.9.5/src/UDPSocket.cpp ./src/UDPSocket.cpp
--- ../tmp-orig/xmule-1.9.5/src/UDPSocket.cpp 2005-01-06 21:35:44.000000000
+0100
+++ ./src/UDPSocket.cpp 2005-03-31 23:45:13.403804518 +0200
@@ -223,7 +223,7 @@
newsi->sin_addr.s_addr = addr;
wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, TM_DNSDONE);
evt.SetClientData(socket);
- evt.SetInt((int) newsi);
+ evt.SetInt((long) newsi);
wxPostEvent(theApp.xmuledlg, evt);
}
}
diff -urN ../tmp-orig/xmule-1.9.5/src/UploadClient.cpp ./src/UploadClient.cpp
--- ../tmp-orig/xmule-1.9.5/src/UploadClient.cpp 2005-01-06
21:35:44.000000000 +0100
+++ ./src/UploadClient.cpp 2005-03-31 23:46:03.185470711 +0200
@@ -612,7 +612,7 @@
Packet *tosend = m_BlockSend_queue.RemoveHead();
uint32_t nBlockSize = tosend->GetRealPacketSize();
m_nMaxSendAllowed -= nBlockSize;
- NewSocket_SendPacket(0, tosend, (uint32_t) this, nBlockSize);
+ NewSocket_SendPacket(0, tosend, (unsigned long) this,
nBlockSize);
m_nTransferedUp += nBlockSize;
credits->AddUploaded(nBlockSize, GetIP());
if (m_BlockSend_queue.IsEmpty())
@@ -643,7 +643,7 @@
{
Packet *tosend = m_BlockSend_queue.RemoveHead();
bool bBreak = tosend->IsLastSplitted();
- NewSocket_SendPacket(0, tosend, (uint32_t) this, 0);
+ NewSocket_SendPacket(0, tosend, (unsigned long) this, 0);
}
}
@@ -659,7 +659,7 @@
for (int i = 0 ; i != parts ; i++)
data->Write(file->GetPartHash(i), 16);
Packet *packet = new Packet(data);
- NewSocket_SendPacketOP(2,OP_HASHSETANSWER, packet, (uint32_t) this, 1);
+ NewSocket_SendPacketOP(2,OP_HASHSETANSWER, packet, (unsigned long)
this, 1);
delete data;
}
}
@@ -694,7 +694,7 @@
Packet *packet = new Packet(OP_QUEUERANKING, 12, OP_EMULEPROT);
memset(packet->pBuffer, 0, 12);
memcpy(packet->pBuffer + 0, &nRank, 2);
- NewSocket_SendPacketOP(2, OP_QUEUERANKING,packet, (uint32_t) this,
0);
+ NewSocket_SendPacketOP(2, OP_QUEUERANKING,packet, (unsigned long)
this, 0);
}
}
}
@@ -725,7 +725,7 @@
}
Packet *packet = new Packet(data, OP_EMULEPROT);
delete data;
- NewSocket_SendPacketOP(2,OP_FILEDESC, packet, (uint32_t) this, 0);
+ NewSocket_SendPacketOP(2,OP_FILEDESC, packet, (unsigned long)
this, 0);
}
}
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]