FreeBSD Bugzilla – Attachment 174361 Details for
Bug 212365
[PATCH] net-p2p/retroshare: Add upstream patches to fix the build in C++11 mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
retroshare-cxx11.diff (text/plain), 18.51 KB, created by
Raphael Kubo da Costa
on 2016-09-04 08:09:54 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Raphael Kubo da Costa
Created:
2016-09-04 08:09:54 UTC
Size:
18.51 KB
patch
obsolete
>diff --git a/net-p2p/retroshare/files/patch-git_16c59af9 b/net-p2p/retroshare/files/patch-git_16c59af9 >new file mode 100644 >index 0000000..1b00f30 >--- /dev/null >+++ b/net-p2p/retroshare/files/patch-git_16c59af9 >@@ -0,0 +1,40 @@ >+This is a partial backport of the upstream commit mentioned below; >+only the bits relevant to making the code build in C++11 mode were >+included. >+ >+From 16c59af9f4490de8691df1b6730a9bec97639e3d Mon Sep 17 00:00:00 2001 >+From: Phenom <retrosharephenom@gmail.com> >+Date: Sat, 12 Mar 2016 13:25:10 +0100 >+Subject: [PATCH] Correct Colored Name Contrast in chat, same way than text. >+ >+diff --git retroshare-gui/src/util/HandleRichText.cpp retroshare-gui/src/util/HandleRichText.cpp >+index 886bb60..d3adda3 100644 >+--- retroshare-gui/src/util/HandleRichText.cpp >++++ retroshare-gui/src/util/HandleRichText.cpp >+@@ -258,7 +258,7 @@ void RsHtml::embedHtml(QTextDocument *textDocument, QDomDocument& doc, QDomEleme >+ return; >+ >+ QDomNodeList children = currentElement.childNodes(); >+- for(uint index = 0; index < children.length(); index++) { >++ for(uint index = 0; index < (uint)children.length(); index++) { >+ QDomNode node = children.item(index); >+ if(node.isElement()) { >+ // child is an element, we skip it if it's an <a> tag >+@@ -473,7 +473,7 @@ static void findElements(QDomDocument& doc, QDomElement& currentElement, const Q >+ } >+ >+ QDomNodeList children = currentElement.childNodes(); >+- for (uint index = 0; index < children.length(); index++) { >++ for (uint index = 0; index < (uint)children.length(); index++) { >+ QDomNode node = children.item(index); >+ if (node.isElement()) { >+ QDomElement element = node.toElement(); >+@@ -651,7 +652,7 @@ static void optimizeHtml(QDomDocument& doc >+ bool addBR = false; >+ >+ QDomNodeList children = currentElement.childNodes(); >+- for (uint index = 0; index < children.length(); ) { >++ for (uint index = 0; index < (uint)children.length(); ) { >+ QDomNode node = children.item(index); >+ if (node.isElement()) { >+ QDomElement element = node.toElement(); >diff --git a/net-p2p/retroshare/files/patch-git_5e94c772 b/net-p2p/retroshare/files/patch-git_5e94c772 >new file mode 100644 >index 0000000..b5e56ea >--- /dev/null >+++ b/net-p2p/retroshare/files/patch-git_5e94c772 >@@ -0,0 +1,173 @@ >+From 5e94c772b3e6033d37cb29d307e8df6ce0c33d1d Mon Sep 17 00:00:00 2001 >+From: Nyfor <arkanum@web.de> >+Date: Mon, 4 Apr 2016 12:07:09 +0200 >+Subject: [PATCH] Fixed compilation for Clang. >+ >+diff --git libretroshare/src/grouter/p3grouter.h libretroshare/src/grouter/p3grouter.h >+index 1626da7..8c6fbab 100644 >+--- libretroshare/src/grouter/p3grouter.h >++++ libretroshare/src/grouter/p3grouter.h >+@@ -225,20 +225,13 @@ class p3GRouter: public RsGRouter, public RsTurtleClientService, public p3Servic >+ void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ; >+ >+ static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item); >+-#ifdef __APPLE__ >+-public: >+-#endif >+- class nullstream: public std::ostream {}; >+ >+ std::ostream& grouter_debug() const >+ { >+- static nullstream null ; >+- >++ static std::ostream null(0); >+ return _debug_enabled?(std::cerr):null; >+ } >+-#ifdef __APPLE__ >+-private: >+-#endif >++ >+ void routePendingObjects() ; >+ void handleTunnels() ; >+ void autoWash() ; >+@@ -364,5 +357,3 @@ class p3GRouter: public RsGRouter, public RsTurtleClientService, public p3Servic >+ >+ uint64_t _random_salt ; >+ }; >+- >+-template<typename T> p3GRouter::nullstream& operator<<(p3GRouter::nullstream& ns,const T&) { return ns ; } >+diff --git libretroshare/src/rsserver/rsinit.cc libretroshare/src/rsserver/rsinit.cc >+index d064dab..dce5a3c 100644 >+--- libretroshare/src/rsserver/rsinit.cc >++++ libretroshare/src/rsserver/rsinit.cc >+@@ -366,11 +366,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck >+ #ifdef LOCALNET_TESTING >+ >> parameter('R',"restrict-port" ,portRestrictions ,"port1-port2","Apply port restriction" ,false) >+ #endif >+-#ifdef __APPLE__ >+ >> help('h',"help","Display this Help") ; >+-#else >+- >> help() ; >+-#endif >+ >+ as.defaultErrorHandling(true) ; >+ >+diff --git libretroshare/src/util/argstream.h libretroshare/src/util/argstream.h >+index 83fb30f..325d76f 100644 >+--- libretroshare/src/util/argstream.h >++++ libretroshare/src/util/argstream.h >+@@ -140,16 +140,11 @@ namespace >+ protected: >+ inline OptionHolder(char s, >+ const char* l, >+- const char* desc); >+-#ifdef __APPLE__ >++ const char* desc); >+ friend OptionHolder help(char s, >+ const char* l, >+ const char* desc); >+-#else >+- friend OptionHolder help(char s='h', >+- const char* l="help", >+- const char* desc="Display this help"); >+-#endif >++ >+ private: >+ std::string shortName_; >+ std::string longName_; >+diff --git retroshare-gui/src/gui/elastic/graphwidget.cpp retroshare-gui/src/gui/elastic/graphwidget.cpp >+index 571cdc8..dd32051 100644 >+--- retroshare-gui/src/gui/elastic/graphwidget.cpp >++++ retroshare-gui/src/gui/elastic/graphwidget.cpp >+@@ -259,7 +259,7 @@ void GraphWidget::keyPressEvent(QKeyEvent *event) >+ } >+ } >+ >+-static void convolveWithGaussian(double *forceMap,int S,int /*s*/) >++static void convolveWithGaussian(double *forceMap,unsigned int S,int /*s*/) >+ { >+ static double *bf = NULL ; >+ >+@@ -267,8 +267,8 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/) >+ { >+ bf = new double[S*S*2] ; >+ >+- for(int i=0;i<S;++i) >+- for(int j=0;j<S;++j) >++ for(unsigned int i=0;i<S;++i) >++ for(unsigned int j=0;j<S;++j) >+ { >+ int x = (i<S/2)?i:(S-i) ; >+ int y = (j<S/2)?j:(S-j) ; >+@@ -284,8 +284,8 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/) >+ unsigned long nn[2] = {S,S}; >+ fourn(&forceMap[-1],&nn[-1],2,1) ; >+ >+- for(int i=0;i<S;++i) >+- for(int j=0;j<S;++j) >++ for(unsigned int i=0;i<S;++i) >++ for(unsigned int j=0;j<S;++j) >+ { >+ float a = forceMap[2*(i+S*j)]*bf[2*(i+S*j)] - forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)+1] ; >+ float b = forceMap[2*(i+S*j)]*bf[2*(i+S*j)+1] + forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)] ; >+@@ -296,7 +296,7 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/) >+ >+ fourn(&forceMap[-1],&nn[-1],2,-1) ; >+ >+- for(int i=0;i<S*S*2;++i) >++ for(unsigned int i=0;i<S*S*2;++i) >+ forceMap[i] /= S*S; >+ } >+ >+diff --git retroshare-gui/src/rshare.cpp retroshare-gui/src/rshare.cpp >+index fe7c102..58e6fce 100644 >+--- retroshare-gui/src/rshare.cpp >++++ retroshare-gui/src/rshare.cpp >+@@ -362,21 +362,21 @@ Rshare::showUsageMessageBox() >+ out << "<table>"; >+ //out << trow(tcol("-"ARG_HELP) + >+ // tcol(tr("Displays this usage message and exits."))); >+- out << trow(tcol("-"ARG_RESET) + >++ out << trow(tcol("-" ARG_RESET) + >+ tcol(tr("Resets ALL stored RetroShare settings."))); >+- out << trow(tcol("-"ARG_DATADIR" <dir>") + >++ out << trow(tcol("-" ARG_DATADIR" <dir>") + >+ tcol(tr("Sets the directory RetroShare uses for data files."))); >+- out << trow(tcol("-"ARG_LOGFILE" <file>") + >++ out << trow(tcol("-" ARG_LOGFILE" <file>") + >+ tcol(tr("Sets the name and location of RetroShare's logfile."))); >+- out << trow(tcol("-"ARG_LOGLEVEL" <level>") + >++ out << trow(tcol("-" ARG_LOGLEVEL" <level>") + >+ tcol(tr("Sets the verbosity of RetroShare's logging.") + >+ "<br>[" + Log::logLevels().join("|") +"]")); >+- out << trow(tcol("-"ARG_GUISTYLE" <style>") + >++ out << trow(tcol("-" ARG_GUISTYLE" <style>") + >+ tcol(tr("Sets RetroShare's interface style.") + >+ "<br>[" + QStyleFactory::keys().join("|") + "]")); >+- out << trow(tcol("-"ARG_GUISTYLESHEET" <stylesheet>") + >++ out << trow(tcol("-" ARG_GUISTYLESHEET" <stylesheet>") + >+ tcol(tr("Sets RetroShare's interface stylesheets."))); >+- out << trow(tcol("-"ARG_LANGUAGE" <language>") + >++ out << trow(tcol("-" ARG_LANGUAGE" <language>") + >+ tcol(tr("Sets RetroShare's language.") + >+ "<br>[" + LanguageSupport::languageCodes().join("|") + "]")); >+ out << "</table>"; >+diff --git retroshare-nogui/src/retroshare.cc retroshare-nogui/src/retroshare.cc >+index 59a1bf1..7ad45b0 100644 >+--- retroshare-nogui/src/retroshare.cc >++++ retroshare-nogui/src/retroshare.cc >+@@ -85,12 +85,9 @@ int main(int argc, char **argv) >+ args >> parameter("docroot", docroot, "path", "Serve static files from this path.", false); >+ // unfinished >+ //args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false); >+- args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)"); >+-#ifdef __APPLE__ >++ args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)"); >+ args >> help('h',"help","Display this Help"); >+-#else >+- args >> help(); >+-#endif >++ >+ if (args.helpRequested()) >+ { >+ std::cerr << args.usage() << std::endl; >diff --git a/net-p2p/retroshare/files/patch-git_aca88308 b/net-p2p/retroshare/files/patch-git_aca88308 >new file mode 100644 >index 0000000..24171c3 >--- /dev/null >+++ b/net-p2p/retroshare/files/patch-git_aca88308 >@@ -0,0 +1,146 @@ >+This patch is required for the build to succeed in C++11 mode. >+ >+From aca88308eae16ab67627593c0df2fce7beb02e89 Mon Sep 17 00:00:00 2001 >+From: zeners <zener@sbg.at> >+Date: Tue, 29 Mar 2016 21:22:14 +0200 >+Subject: [PATCH] compatible to g++11 / QT5 >+ >+method suggested by cyril >+ >+diff --git libretroshare/src/pqi/pqiqosstreamer.cc libretroshare/src/pqi/pqiqosstreamer.cc >+index 898f2b5..fc0dc20 100644 >+--- libretroshare/src/pqi/pqiqosstreamer.cc >++++ libretroshare/src/pqi/pqiqosstreamer.cc >+@@ -25,6 +25,8 @@ >+ >+ #include "pqiqosstreamer.h" >+ >++const float pqiQoSstreamer::PQI_QOS_STREAMER_ALPHA = 2.0f ; >++ >+ pqiQoSstreamer::pqiQoSstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin) >+ : pqithreadstreamer(parent,rss,peerid,bio_in,bio_flagsin), pqiQoS(PQI_QOS_STREAMER_MAX_LEVELS, PQI_QOS_STREAMER_ALPHA) >+ { >+diff --git libretroshare/src/pqi/pqiqosstreamer.h libretroshare/src/pqi/pqiqosstreamer.h >+index b85ac32..574ba94 100644 >+--- libretroshare/src/pqi/pqiqosstreamer.h >++++ libretroshare/src/pqi/pqiqosstreamer.h >+@@ -34,7 +34,7 @@ class pqiQoSstreamer: public pqithreadstreamer, public pqiQoS >+ pqiQoSstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin); >+ >+ static const uint32_t PQI_QOS_STREAMER_MAX_LEVELS = 10 ; >+- static const float PQI_QOS_STREAMER_ALPHA = 2.0 ; >++ static const float PQI_QOS_STREAMER_ALPHA ; >+ >+ virtual void locked_storeInOutputQueue(void *ptr,int priority) ; >+ virtual int locked_out_queue_size() const { return _total_item_count ; } >+diff --git libretroshare/src/retroshare/rsreputations.h libretroshare/src/retroshare/rsreputations.h >+index 484aabb..8db42ee 100644 >+--- libretroshare/src/retroshare/rsreputations.h >++++ libretroshare/src/retroshare/rsreputations.h >+@@ -31,8 +31,8 @@ >+ class RsReputations >+ { >+ public: >+- static const float REPUTATION_THRESHOLD_ANTI_SPAM = 1.4f ; >+- static const float REPUTATION_THRESHOLD_DEFAULT = 1.0f ; >++ static const float REPUTATION_THRESHOLD_ANTI_SPAM; >++ static const float REPUTATION_THRESHOLD_DEFAULT; >+ >+ // This is the interface file for the reputation system >+ // >+diff --git libretroshare/src/rsserver/p3face-server.cc libretroshare/src/rsserver/p3face-server.cc >+index 746ebac..b769136 100644 >+--- libretroshare/src/rsserver/p3face-server.cc >++++ libretroshare/src/rsserver/p3face-server.cc >+@@ -69,6 +69,10 @@ static double getCurrentTS() >+ return cts; >+ } >+ >++const double RsServer::minTimeDelta = 0.1; // 25; >++const double RsServer::maxTimeDelta = 0.5; >++const double RsServer::kickLimit = 0.15; >++ >+ >+ RsServer::RsServer() >+ : coreMutex("RsServer") >+diff --git libretroshare/src/rsserver/p3face.h libretroshare/src/rsserver/p3face.h >+index 23efa58..51f05a5 100644 >+--- libretroshare/src/rsserver/p3face.h >++++ libretroshare/src/rsserver/p3face.h >+@@ -194,9 +194,9 @@ class RsServer: public RsControl, public RsTickingThread >+ double mAvgTickRate ; >+ double mTimeDelta ; >+ >+- static const double minTimeDelta = 0.1; // 25; >+- static const double maxTimeDelta = 0.5; >+- static const double kickLimit = 0.15; >++ static const double minTimeDelta; // 25; >++ static const double maxTimeDelta; >++ static const double kickLimit; >+ }; >+ >+ /* Helper function to convert windows paths >+diff --git libretroshare/src/services/p3gxsreputation.cc libretroshare/src/services/p3gxsreputation.cc >+index dd7a46d..b78ca1f 100644 >+--- libretroshare/src/services/p3gxsreputation.cc >++++ libretroshare/src/services/p3gxsreputation.cc >+@@ -303,6 +303,10 @@ void p3GxsReputation::updateActiveFriends() >+ >+ } >+ >++const float RsReputations::REPUTATION_THRESHOLD_ANTI_SPAM = 1.4f ; >++const float RsReputations::REPUTATION_THRESHOLD_DEFAULT = 1.0f ; >++ >++ >+ static RsReputations::Opinion safe_convert_uint32t_to_opinion(uint32_t op) >+ { >+ return RsReputations::Opinion(std::min((uint32_t)op,UPPER_LIMIT)) ; >+diff --git retroshare-gui/src/gui/elastic/node.cpp retroshare-gui/src/gui/elastic/node.cpp >+index 7755172..bc33151 100644 >+--- retroshare-gui/src/gui/elastic/node.cpp >++++ retroshare-gui/src/gui/elastic/node.cpp >+@@ -87,6 +87,12 @@ Node::Node(const std::string& node_string,GraphWidget::NodeType type,GraphWidget >+ _auth = GraphWidget::ELASTIC_NODE_AUTH_FULL ; >+ } >+ >++const float Node::MASS_FACTOR = 10 ; >++const float Node::FRICTION_FACTOR = 10.8f ; >++const float Node::REPULSION_FACTOR = 4; >++const float Node::NODE_DISTANCE = 130.0f ; >++ >++ >+ void Node::addEdge(Edge *edge) >+ { >+ edgeList << edge; >+diff --git retroshare-gui/src/gui/elastic/node.h retroshare-gui/src/gui/elastic/node.h >+index d7bcd5f..13c717b 100644 >+--- retroshare-gui/src/gui/elastic/node.h >++++ retroshare-gui/src/gui/elastic/node.h >+@@ -118,10 +118,10 @@ class Node : public QObject, public QGraphicsItem >+ RsPeerId _ssl_id ; >+ RsPgpId _gpg_id ; >+ >+- static const float MASS_FACTOR = 10 ; >+- static const float FRICTION_FACTOR = 10.8 ; >+- static const float REPULSION_FACTOR = 4 ; >+- static const float NODE_DISTANCE = 130.0 ; >++ static const float MASS_FACTOR; >++ static const float FRICTION_FACTOR; >++ static const float REPULSION_FACTOR; >++ static const float NODE_DISTANCE; >+ }; >+ >+ #endif >+diff --git retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp >+index fe2e1aa..a3381b2 100644 >+--- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp >++++ retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp >+@@ -1565,7 +1565,7 @@ void GxsForumThreadWidget::setMsgReadStatus(QList<QTreeWidgetItem*> &rows, bool >+ // LIKE THIS BELOW... >+ //std::string grpId = (*Row)->data(COLUMN_THREAD_DATA, ROLE_THREAD_GROUPID).toString().toStdString(); >+ >+- RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), msgId); >++ RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), RsGxsMessageId(msgId)); >+ >+ uint32_t token; >+ rsGxsForums->setMessageReadStatus(token, msgPair, read); >diff --git a/net-p2p/retroshare/files/patch-libretroshare_src_grouter_p3grouter.h b/net-p2p/retroshare/files/patch-libretroshare_src_grouter_p3grouter.h >deleted file mode 100644 >index de6b5fd..0000000 >--- a/net-p2p/retroshare/files/patch-libretroshare_src_grouter_p3grouter.h >+++ /dev/null >@@ -1,20 +0,0 @@ >---- libretroshare/src/grouter/p3grouter.h.orig 2016-02-05 19:04:46 UTC >-+++ libretroshare/src/grouter/p3grouter.h >-@@ -225,7 +225,7 @@ private: >- void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ; >- >- static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item); >--#ifdef __APPLE__ >-+#if defined(__APPLE__) || defined(__FreeBSD__) >- public: >- #endif >- class nullstream: public std::ostream {}; >-@@ -236,7 +236,7 @@ public: >- >- return _debug_enabled?(std::cerr):null; >- } >--#ifdef __APPLE__ >-+#if defined(__APPLE__) || defined(__FreeBSD__) >- private: >- #endif >- void routePendingObjects() ; >diff --git a/net-p2p/retroshare/files/patch-libretroshare_src_rsserver_rsinit.cc b/net-p2p/retroshare/files/patch-libretroshare_src_rsserver_rsinit.cc >deleted file mode 100644 >index 1506c51..0000000 >--- a/net-p2p/retroshare/files/patch-libretroshare_src_rsserver_rsinit.cc >+++ /dev/null >@@ -1,11 +0,0 @@ >---- libretroshare/src/rsserver/rsinit.cc.orig 2016-02-05 19:04:46 UTC >-+++ libretroshare/src/rsserver/rsinit.cc >-@@ -367,7 +367,7 @@ int RsInit::InitRetroShare(int argcIgnor >- #ifdef LOCALNET_TESTING >- >> parameter('R',"restrict-port" ,portRestrictions ,"port1-port2","Apply port restriction" ,false) >- #endif >--#ifdef __APPLE__ >-+#if defined(__APPLE__) || defined(__FreeBSD__) >- >> help('h',"help","Display this Help") ; >- #else >- >> help() ; >diff --git a/net-p2p/retroshare/files/patch-libretroshare_src_util_argstream.h b/net-p2p/retroshare/files/patch-libretroshare_src_util_argstream.h >deleted file mode 100644 >index be2113c..0000000 >--- a/net-p2p/retroshare/files/patch-libretroshare_src_util_argstream.h >+++ /dev/null >@@ -1,11 +0,0 @@ >---- libretroshare/src/util/argstream.h.orig 2016-02-05 19:04:46 UTC >-+++ libretroshare/src/util/argstream.h >-@@ -141,7 +141,7 @@ namespace >- inline OptionHolder(char s, >- const char* l, >- const char* desc); >--#ifdef __APPLE__ >-+#if defined(__APPLE__) || defined(__FreeBSD__) >- friend OptionHolder help(char s, >- const char* l, >- const char* desc); >diff --git a/net-p2p/retroshare/files/patch-retroshare-nogui_src_retroshare.cc b/net-p2p/retroshare/files/patch-retroshare-nogui_src_retroshare.cc >deleted file mode 100644 >index 3b44940..0000000 >--- a/net-p2p/retroshare/files/patch-retroshare-nogui_src_retroshare.cc >+++ /dev/null >@@ -1,11 +0,0 @@ >---- retroshare-nogui/src/retroshare.cc.orig 2016-02-05 19:04:46 UTC >-+++ retroshare-nogui/src/retroshare.cc >-@@ -86,7 +86,7 @@ int main(int argc, char **argv) >- // unfinished >- //args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false); >- args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)"); >--#ifdef __APPLE__ >-+#if defined(__APPLE__) || defined(__FreeBSD__) >- args >> help('h',"help","Display this Help"); >- #else >- args >> help();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212365
: 174361