mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
beshare: fix x86_64 build.
crashes on quit.
This commit is contained in:
@@ -17,15 +17,17 @@ HOMEPAGE="https://github.com/HaikuArchives/BeShare"
|
||||
COPYRIGHT="1999-2012 Jeremy Friesner"
|
||||
LICENSE="Public Domain
|
||||
libsanta"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/HaikuArchives/BeShare/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="b936e4de10a555204521747f48de8fadf22530fa5186bdc06eecaa26bf97ae6f"
|
||||
SOURCE_FILENAME="beshare-$portVersion.tar.gz"
|
||||
SOURCE_DIR="BeShare-$portVersion"
|
||||
SOURCE_URI_2="https://public.msli.com/lcs/muscle/muscle6.11.zip"
|
||||
CHECKSUM_SHA256_2="7cf3c92095f46e5a0858852e7d387d11fdf8e1e95a4de26b5e68e8319a373340"
|
||||
PATCHES="beshare-2.35.patchset"
|
||||
PATCHES_2="muscle-6.11.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 ?x86_64"
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
|
||||
210
haiku-apps/beshare/patches/beshare-2.35.patchset
Normal file
210
haiku-apps/beshare/patches/beshare-2.35.patchset
Normal file
@@ -0,0 +1,210 @@
|
||||
From 1ff8d4b8809bde8b3f359577fd4fd47f08ad1a3f Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sat, 29 Sep 2018 23:28:05 +0200
|
||||
Subject: support for x86_64.
|
||||
|
||||
|
||||
diff --git a/source/ResultsView.cpp b/source/ResultsView.cpp
|
||||
index 186e5ed..7d6b434 100644
|
||||
--- a/source/ResultsView.cpp
|
||||
+++ b/source/ResultsView.cpp
|
||||
@@ -67,7 +67,7 @@ void
|
||||
ResultsView::MouseDown(BPoint where)
|
||||
{
|
||||
BPoint pt;
|
||||
- ulong buttons;
|
||||
+ uint32 buttons;
|
||||
|
||||
GetMouse(&pt, &buttons);
|
||||
|
||||
diff --git a/source/ShareFileTransfer.cpp b/source/ShareFileTransfer.cpp
|
||||
index b0bdf58..00c1074 100644
|
||||
--- a/source/ShareFileTransfer.cpp
|
||||
+++ b/source/ShareFileTransfer.cpp
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
&& (offset > 0)) {
|
||||
off_t uploadOffset = 0LL; // default to starting the upload at the beginning of the file
|
||||
const uint8 * hisDigest;
|
||||
- size_t numBytes;
|
||||
+ uint32 numBytes;
|
||||
if ((msg->FindData("md5", B_RAW_TYPE, i, (const void **) &hisDigest, &numBytes) == B_NO_ERROR)
|
||||
&& (numBytes == MD5_DIGEST_SIZE)) {
|
||||
// Okay, the requestor has told us enough so that we can check our local file...
|
||||
@@ -1098,7 +1098,7 @@ ShareFileTransfer::MessageReceived(const MessageRef& msgRef)
|
||||
fieldName = iter.GetFieldName();
|
||||
if (strncmp(fieldName(), "beshare:", 8)) { // don't save our attributes, they aren't necessary
|
||||
const void * attrData;
|
||||
- size_t attrSize;
|
||||
+ uint32 attrSize;
|
||||
uint32 c;
|
||||
type_code type;
|
||||
|
||||
@@ -1134,7 +1134,7 @@ ShareFileTransfer::MessageReceived(const MessageRef& msgRef)
|
||||
{
|
||||
TRACE_SHAREFILETRANFER(("%s::%s : TRANSFER_COMMAND_FILE_DATA\n",CLASSNAME, __func__));
|
||||
uint8 * data;
|
||||
- size_t numBytes;
|
||||
+ uint32 numBytes;
|
||||
if ((_uploadSession == false)
|
||||
&& (msg->FindDataPointer("data", B_RAW_TYPE, (void **) &data, &numBytes) == B_NO_ERROR)) {
|
||||
bool abortSession = false;
|
||||
diff --git a/source/TransferListView.cpp b/source/TransferListView.cpp
|
||||
index e3a421f..f4f7314 100644
|
||||
--- a/source/TransferListView.cpp
|
||||
+++ b/source/TransferListView.cpp
|
||||
@@ -95,7 +95,7 @@ TransferListView::MouseDown(BPoint where)
|
||||
{
|
||||
TRACE_TRANSFERLISTVIEW(("TransferListView::MouseDown begin\n"));
|
||||
BPoint pt;
|
||||
- ulong buttons;
|
||||
+ uint32 buttons;
|
||||
|
||||
GetMouse(&pt, &buttons);
|
||||
|
||||
diff --git a/source/UserListView.cpp b/source/UserListView.cpp
|
||||
index 2b5d653..75ce507 100644
|
||||
--- a/source/UserListView.cpp
|
||||
+++ b/source/UserListView.cpp
|
||||
@@ -30,7 +30,7 @@ void
|
||||
UserListView::MouseDown(BPoint where)
|
||||
{
|
||||
BPoint pt;
|
||||
- ulong buttons;
|
||||
+ uint32 buttons;
|
||||
|
||||
GetMouse(&pt, &buttons);
|
||||
if (buttons & B_SECONDARY_MOUSE_BUTTON) {
|
||||
--
|
||||
2.19.0
|
||||
|
||||
|
||||
From 9275676095dc243ddc58fa3cbd6a073c1f676070 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sat, 29 Sep 2018 23:57:07 +0200
|
||||
Subject: fix gcc7 warnings.
|
||||
|
||||
|
||||
diff --git a/source/ChatWindow.cpp b/source/ChatWindow.cpp
|
||||
index e56bb7b..8510311 100644
|
||||
--- a/source/ChatWindow.cpp
|
||||
+++ b/source/ChatWindow.cpp
|
||||
@@ -1178,7 +1178,7 @@ ChatWindow::GetAppSubdir(const char * subDirName, BDirectory & subDir, bool crea
|
||||
// If the directory is already there, use it
|
||||
if ((error = subDir.SetTo(path.Path())) != B_OK) {
|
||||
//This one we need to create, it's the "main" diretory
|
||||
- if (error = subDir.CreateDirectory(path.Path(), &subDir) != B_OK)
|
||||
+ if ((error = subDir.CreateDirectory(path.Path(), &subDir)) != B_OK)
|
||||
return error;
|
||||
}
|
||||
|
||||
diff --git a/source/RemoteUserItem.cpp b/source/RemoteUserItem.cpp
|
||||
index 04cbb6c..fea1eac 100644
|
||||
--- a/source/RemoteUserItem.cpp
|
||||
+++ b/source/RemoteUserItem.cpp
|
||||
@@ -128,9 +128,9 @@ RemoteUserItem::SetNumSharedFiles(int32 bw)
|
||||
char temp[100] = "?";
|
||||
if (_numSharedFiles >= 0) {
|
||||
if ((_firewalled)&&(_shareWindow->GetFirewalled()))
|
||||
- sprintf(temp, "(%li)", _numSharedFiles);
|
||||
+ sprintf(temp, "(%" B_PRIi32 ")", _numSharedFiles);
|
||||
else
|
||||
- sprintf(temp, "%li", _numSharedFiles);
|
||||
+ sprintf(temp, "%" B_PRIi32, _numSharedFiles);
|
||||
}
|
||||
SetColumnContent(REMOTE_USER_COLUMN_FILES, temp, false, true);
|
||||
_shareWindow->RefreshUserItem(this);
|
||||
@@ -147,9 +147,9 @@ RemoteUserItem::SetUploadStats(uint32 cu, uint32 mu)
|
||||
char temp[128];
|
||||
if (_curUploads < NO_FILE_LIMIT) {
|
||||
if (_maxUploads >= NO_FILE_LIMIT)
|
||||
- sprintf(temp, "(%lu) 0%%", _curUploads);
|
||||
+ sprintf(temp, "(%" B_PRIu32 ") 0%%", _curUploads);
|
||||
else
|
||||
- sprintf(temp, "(%lu/%lu) %.0f%%", _curUploads, _maxUploads, GetLoadFactor()*100.0f);
|
||||
+ sprintf(temp, "(%" B_PRIu32 "/%" B_PRIu32 ") %.0f%%", _curUploads, _maxUploads, GetLoadFactor()*100.0f);
|
||||
} else
|
||||
strcpy(temp, "?");
|
||||
|
||||
diff --git a/source/ResultsView.cpp b/source/ResultsView.cpp
|
||||
index 7d6b434..d43e8c6 100644
|
||||
--- a/source/ResultsView.cpp
|
||||
+++ b/source/ResultsView.cpp
|
||||
@@ -131,7 +131,7 @@ ResultsView::InitiateDrag(BPoint /*point*/, int32 /*index*/, bool /*wasSelected*
|
||||
RemoteUserItem * owner = item->GetOwner();
|
||||
uint64 ID = owner->GetInstallID();
|
||||
char strbuf[17];
|
||||
- sprintf(strbuf,"%Lx", ID);
|
||||
+ sprintf(strbuf,"%" B_PRIx64, ID);
|
||||
|
||||
String URL;
|
||||
URL << "beshare://"
|
||||
diff --git a/source/ShareColumn.cpp b/source/ShareColumn.cpp
|
||||
index bee53ee..2016e7a 100644
|
||||
--- a/source/ShareColumn.cpp
|
||||
+++ b/source/ShareColumn.cpp
|
||||
@@ -76,7 +76,7 @@ GetFileCellText(const RemoteFileItem * item) const
|
||||
if (msg.FindInt64(attrName, &v) == B_NO_ERROR)
|
||||
{
|
||||
if (strcmp(attrName, "beshare:File Size") == 0) GetByteSizeString(v, _buf);
|
||||
- else sprintf(_buf, "%Li", v);
|
||||
+ else sprintf(_buf, "%" B_PRIi64, v);
|
||||
}
|
||||
}
|
||||
break;
|
||||
diff --git a/source/ShareWindow.cpp b/source/ShareWindow.cpp
|
||||
index 2c6b05e..c364438 100644
|
||||
--- a/source/ShareWindow.cpp
|
||||
+++ b/source/ShareWindow.cpp
|
||||
@@ -2169,7 +2169,7 @@ ShareWindow::MessageReceived(BMessage* msg)
|
||||
MessageRef pmsg = GetMessageFromPool();
|
||||
if (pmsg())
|
||||
{
|
||||
- pmsg()->AddString(PR_NAME_TEXT_LINE, "GET /servers.txt HTTP/1.1\nUser-Agent: BeShare/"VERSION_STRING"\nHost: "AUTO_UPDATER_SERVER"\n\n");
|
||||
+ pmsg()->AddString(PR_NAME_TEXT_LINE, "GET /servers.txt HTTP/1.1\nUser-Agent: BeShare/" VERSION_STRING "\nHost: " AUTO_UPDATER_SERVER "\n\n");
|
||||
_checkServerListThread.SendMessageToSessions(pmsg);
|
||||
}
|
||||
}
|
||||
@@ -2756,7 +2756,7 @@ UpdateConnectStatus(bool titleToo)
|
||||
|
||||
char buf[200];
|
||||
strcpy(buf, str(STR_CONNECT_TO));
|
||||
- strncat(buf, sname, sizeof(buf));
|
||||
+ strncat(buf, sname, sizeof(buf) - 1);
|
||||
buf[sizeof(buf)-1] = '\0';
|
||||
_connectMenuItem->SetLabel(buf);
|
||||
|
||||
diff --git a/source/TransferListView.cpp b/source/TransferListView.cpp
|
||||
index f4f7314..13e0348 100644
|
||||
--- a/source/TransferListView.cpp
|
||||
+++ b/source/TransferListView.cpp
|
||||
@@ -278,11 +278,12 @@ TransferListView::MouseDown(BPoint where)
|
||||
for (int i = 0; (idx = CurrentSelection(i)) >= 0; i++) {
|
||||
ShareFileTransfer* xfr = (ShareFileTransfer *) ItemAt(idx);
|
||||
if (xfr->IsUploadSession()) {
|
||||
- if (xfr->IsWaitingOnLocal() == false)
|
||||
+ if (xfr->IsWaitingOnLocal() == false) {
|
||||
xfr->RequeueTransfer();
|
||||
xfr->SetBeginTransferEnabled(false);
|
||||
- }else
|
||||
+ } else
|
||||
xfr->AbortSession(true, true);
|
||||
+ }
|
||||
}
|
||||
win->DequeueTransferSessions();
|
||||
} else if (result == resumeDownload) {
|
||||
diff --git a/source/md5.cpp b/source/md5.cpp
|
||||
index 26c1ddf..548d8dc 100644
|
||||
--- a/source/md5.cpp
|
||||
+++ b/source/md5.cpp
|
||||
@@ -136,7 +136,7 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx)
|
||||
|
||||
byteSwap(ctx->buf, 4);
|
||||
memcpy(digest, ctx->buf, 16);
|
||||
- memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
|
||||
+ memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
|
||||
}
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
--
|
||||
2.19.0
|
||||
|
||||
58
haiku-apps/beshare/patches/muscle-6.11.patchset
Normal file
58
haiku-apps/beshare/patches/muscle-6.11.patchset
Normal file
@@ -0,0 +1,58 @@
|
||||
From a8b6f2f1b8505643fc4c66e2a0ba4f22a3948857 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sat, 29 Sep 2018 23:28:47 +0200
|
||||
Subject: support for x86_64.
|
||||
|
||||
|
||||
diff --git a/muscle/besupport/ConvertMessages.cpp b/muscle/besupport/ConvertMessages.cpp
|
||||
index 83b4642..67c3669 100644
|
||||
--- a/muscle/besupport/ConvertMessages.cpp
|
||||
+++ b/muscle/besupport/ConvertMessages.cpp
|
||||
@@ -81,7 +81,7 @@ status_t ConvertFromBMessage(const BMessage & from, Message & to)
|
||||
for (int32 j=0; j<count; j++)
|
||||
{
|
||||
const void * nextItem;
|
||||
- int32 itemSize;
|
||||
+ ssize_t itemSize;
|
||||
if (from.FindData(name, type, j, &nextItem, &itemSize) != B_NO_ERROR) return B_ERROR;
|
||||
|
||||
// do any necessary translation from the Be data types to Muscle data types
|
||||
diff --git a/muscle/support/MuscleSupport.h b/muscle/support/MuscleSupport.h
|
||||
index 5c12471..e03830a 100644
|
||||
--- a/muscle/support/MuscleSupport.h
|
||||
+++ b/muscle/support/MuscleSupport.h
|
||||
@@ -180,6 +180,9 @@ typedef void * muscleVoidPointer; /* it's a bit easier, syntax-wise, to use thi
|
||||
# if !((defined(BONE))||(defined(BONE_VERSION))||(defined(__HAIKU__)))
|
||||
# define BEOS_OLD_NETSERVER
|
||||
# endif
|
||||
+# ifdef __x86_64__
|
||||
+# define MUSCLE_64_BIT_PLATFORM 1
|
||||
+# endif
|
||||
#else
|
||||
# define B_ERROR -1
|
||||
# define B_NO_ERROR 0
|
||||
diff --git a/muscle/util/FilePathInfo.cpp b/muscle/util/FilePathInfo.cpp
|
||||
index ce520d1..e240fee 100644
|
||||
--- a/muscle/util/FilePathInfo.cpp
|
||||
+++ b/muscle/util/FilePathInfo.cpp
|
||||
@@ -59,7 +59,7 @@ void FilePathInfo :: SetFilePath(const char * optFilePath)
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
#else
|
||||
-# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(__APPLE__)
|
||||
+# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(__APPLE__) && !defined(__HAIKU__)
|
||||
struct stat64 statInfo;
|
||||
if (stat64(optFilePath, &statInfo) == 0)
|
||||
# else
|
||||
@@ -72,7 +72,7 @@ void FilePathInfo :: SetFilePath(const char * optFilePath)
|
||||
if (S_ISREG(statInfo.st_mode)) _flags |= (1L<<FPI_FLAG_ISREGULARFILE);
|
||||
|
||||
_size = statInfo.st_size;
|
||||
-# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(_POSIX_SOURCE)
|
||||
+# if defined(MUSCLE_64_BIT_PLATFORM) && !defined(_POSIX_SOURCE) && !defined(__HAIKU__)
|
||||
_atime = InternalizeTimeSpec(statInfo.st_atimespec);
|
||||
# if !defined(__APPLE__) || (__DARWIN_64_BIT_INO_T == 1)
|
||||
_ctime = InternalizeTimeSpec(statInfo.st_birthtimespec);
|
||||
--
|
||||
2.19.0
|
||||
|
||||
Reference in New Issue
Block a user