View | Details | Raw Unified | Return to bug 212365
Collapse All | Expand All

(-)b/net-p2p/retroshare/files/patch-git_16c59af9 (+40 lines)
Added Link Here
1
This is a partial backport of the upstream commit mentioned below;
2
only the bits relevant to making the code build in C++11 mode were
3
included.
4
5
From 16c59af9f4490de8691df1b6730a9bec97639e3d Mon Sep 17 00:00:00 2001
6
From: Phenom <retrosharephenom@gmail.com>
7
Date: Sat, 12 Mar 2016 13:25:10 +0100
8
Subject: [PATCH] Correct Colored Name Contrast in chat, same way than text.
9
10
diff --git retroshare-gui/src/util/HandleRichText.cpp retroshare-gui/src/util/HandleRichText.cpp
11
index 886bb60..d3adda3 100644
12
--- retroshare-gui/src/util/HandleRichText.cpp
13
+++ retroshare-gui/src/util/HandleRichText.cpp
14
@@ -258,7 +258,7 @@ void RsHtml::embedHtml(QTextDocument *textDocument, QDomDocument& doc, QDomEleme
15
 		return;
16
 
17
 	QDomNodeList children = currentElement.childNodes();
18
-	for(uint index = 0; index < children.length(); index++) {
19
+	for(uint index = 0; index < (uint)children.length(); index++) {
20
 		QDomNode node = children.item(index);
21
 		if(node.isElement()) {
22
 			// child is an element, we skip it if it's an <a> tag
23
@@ -473,7 +473,7 @@ static void findElements(QDomDocument& doc, QDomElement& currentElement, const Q
24
 	}
25
 
26
 	QDomNodeList children = currentElement.childNodes();
27
-	for (uint index = 0; index < children.length(); index++) {
28
+	for (uint index = 0; index < (uint)children.length(); index++) {
29
 		QDomNode node = children.item(index);
30
 		if (node.isElement()) {
31
 			QDomElement element = node.toElement();
32
@@ -651,7 +652,7 @@ static void optimizeHtml(QDomDocument& doc
33
 	bool addBR = false;
34
 
35
 	QDomNodeList children = currentElement.childNodes();
36
-	for (uint index = 0; index < children.length(); ) {
37
+	for (uint index = 0; index < (uint)children.length(); ) {
38
 		QDomNode node = children.item(index);
39
 		if (node.isElement()) {
40
 			QDomElement element = node.toElement();
(-)b/net-p2p/retroshare/files/patch-git_5e94c772 (+173 lines)
Added Link Here
1
From 5e94c772b3e6033d37cb29d307e8df6ce0c33d1d Mon Sep 17 00:00:00 2001
2
From: Nyfor <arkanum@web.de>
3
Date: Mon, 4 Apr 2016 12:07:09 +0200
4
Subject: [PATCH] Fixed compilation for Clang.
5
6
diff --git libretroshare/src/grouter/p3grouter.h libretroshare/src/grouter/p3grouter.h
7
index 1626da7..8c6fbab 100644
8
--- libretroshare/src/grouter/p3grouter.h
9
+++ libretroshare/src/grouter/p3grouter.h
10
@@ -225,20 +225,13 @@ class p3GRouter: public RsGRouter, public RsTurtleClientService, public p3Servic
11
     void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ;
12
 
13
     static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item);
14
-#ifdef __APPLE__
15
-public:
16
-#endif
17
-    class nullstream: public std::ostream {};
18
 
19
     std::ostream& grouter_debug() const
20
     {
21
-        static nullstream null ;
22
-
23
+        static std::ostream null(0);
24
         return _debug_enabled?(std::cerr):null;
25
     }
26
-#ifdef __APPLE__
27
-private:
28
-#endif
29
+
30
     void routePendingObjects() ;
31
     void handleTunnels() ;
32
     void autoWash() ;
33
@@ -364,5 +357,3 @@ class p3GRouter: public RsGRouter, public RsTurtleClientService, public p3Servic
34
 
35
     uint64_t _random_salt ;
36
 };
37
-
38
-template<typename T> p3GRouter::nullstream& operator<<(p3GRouter::nullstream& ns,const T&) { return ns ; }
39
diff --git libretroshare/src/rsserver/rsinit.cc libretroshare/src/rsserver/rsinit.cc
40
index d064dab..dce5a3c 100644
41
--- libretroshare/src/rsserver/rsinit.cc
42
+++ libretroshare/src/rsserver/rsinit.cc
43
@@ -366,11 +366,7 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
44
 #ifdef LOCALNET_TESTING
45
 			   >> parameter('R',"restrict-port" ,portRestrictions             ,"port1-port2","Apply port restriction"                   ,false)
46
 #endif
47
-#ifdef __APPLE__
48
  				>> help('h',"help","Display this Help") ;
49
-#else
50
-				>> help() ;
51
-#endif
52
 
53
 			as.defaultErrorHandling(true) ;
54
 
55
diff --git libretroshare/src/util/argstream.h libretroshare/src/util/argstream.h
56
index 83fb30f..325d76f 100644
57
--- libretroshare/src/util/argstream.h
58
+++ libretroshare/src/util/argstream.h
59
@@ -140,16 +140,11 @@ namespace
60
 		protected:
61
 			inline OptionHolder(char s,
62
 					const char* l,
63
-					const char* desc);  
64
-#ifdef __APPLE__
65
+                                        const char* desc);
66
  			friend OptionHolder help(char s,
67
  					const char* l,
68
  					const char* desc);
69
-#else
70
-			friend OptionHolder help(char s='h',
71
-					const char* l="help",
72
-					const char* desc="Display this help");
73
-#endif
74
+
75
 		private:
76
 			std::string shortName_;
77
 			std::string longName_;
78
diff --git retroshare-gui/src/gui/elastic/graphwidget.cpp retroshare-gui/src/gui/elastic/graphwidget.cpp
79
index 571cdc8..dd32051 100644
80
--- retroshare-gui/src/gui/elastic/graphwidget.cpp
81
+++ retroshare-gui/src/gui/elastic/graphwidget.cpp
82
@@ -259,7 +259,7 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
83
     }
84
 }
85
 
86
-static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
87
+static void convolveWithGaussian(double *forceMap,unsigned int S,int /*s*/)
88
 {
89
 	static double *bf = NULL ;
90
 
91
@@ -267,8 +267,8 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
92
 	{
93
 		bf = new double[S*S*2] ;
94
 
95
-		for(int i=0;i<S;++i)
96
-			for(int j=0;j<S;++j)
97
+        for(unsigned int i=0;i<S;++i)
98
+            for(unsigned int j=0;j<S;++j)
99
 			{
100
 				int x = (i<S/2)?i:(S-i) ;
101
 				int y = (j<S/2)?j:(S-j) ;
102
@@ -284,8 +284,8 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
103
 	unsigned long nn[2] = {S,S};
104
 	fourn(&forceMap[-1],&nn[-1],2,1) ;
105
 
106
-	for(int i=0;i<S;++i)
107
-		for(int j=0;j<S;++j)
108
+    for(unsigned int i=0;i<S;++i)
109
+        for(unsigned int j=0;j<S;++j)
110
 		{
111
 			float a = forceMap[2*(i+S*j)]*bf[2*(i+S*j)] - forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)+1] ;
112
 			float b = forceMap[2*(i+S*j)]*bf[2*(i+S*j)+1] + forceMap[2*(i+S*j)+1]*bf[2*(i+S*j)] ;
113
@@ -296,7 +296,7 @@ static void convolveWithGaussian(double *forceMap,int S,int /*s*/)
114
 
115
 	fourn(&forceMap[-1],&nn[-1],2,-1) ;
116
 
117
-	for(int i=0;i<S*S*2;++i)
118
+    for(unsigned int i=0;i<S*S*2;++i)
119
 		forceMap[i] /= S*S;
120
 }
121
 
122
diff --git retroshare-gui/src/rshare.cpp retroshare-gui/src/rshare.cpp
123
index fe7c102..58e6fce 100644
124
--- retroshare-gui/src/rshare.cpp
125
+++ retroshare-gui/src/rshare.cpp
126
@@ -362,21 +362,21 @@ Rshare::showUsageMessageBox()
127
   out << "<table>";
128
   //out << trow(tcol("-"ARG_HELP) + 
129
   //            tcol(tr("Displays this usage message and exits.")));
130
-  out << trow(tcol("-"ARG_RESET) +
131
+  out << trow(tcol("-" ARG_RESET) +
132
               tcol(tr("Resets ALL stored RetroShare settings.")));
133
-  out << trow(tcol("-"ARG_DATADIR" &lt;dir&gt;") +
134
+  out << trow(tcol("-" ARG_DATADIR" &lt;dir&gt;") +
135
               tcol(tr("Sets the directory RetroShare uses for data files.")));
136
-  out << trow(tcol("-"ARG_LOGFILE" &lt;file&gt;") +
137
+  out << trow(tcol("-" ARG_LOGFILE" &lt;file&gt;") +
138
               tcol(tr("Sets the name and location of RetroShare's logfile.")));
139
-  out << trow(tcol("-"ARG_LOGLEVEL" &lt;level&gt;") +
140
+  out << trow(tcol("-" ARG_LOGLEVEL" &lt;level&gt;") +
141
               tcol(tr("Sets the verbosity of RetroShare's logging.") +
142
                    "<br>[" + Log::logLevels().join("|") +"]"));
143
-  out << trow(tcol("-"ARG_GUISTYLE" &lt;style&gt;") +
144
+  out << trow(tcol("-" ARG_GUISTYLE" &lt;style&gt;") +
145
               tcol(tr("Sets RetroShare's interface style.") +
146
                    "<br>[" + QStyleFactory::keys().join("|") + "]"));
147
-  out << trow(tcol("-"ARG_GUISTYLESHEET" &lt;stylesheet&gt;") +
148
+  out << trow(tcol("-" ARG_GUISTYLESHEET" &lt;stylesheet&gt;") +
149
               tcol(tr("Sets RetroShare's interface stylesheets.")));                   
150
-  out << trow(tcol("-"ARG_LANGUAGE" &lt;language&gt;") + 
151
+  out << trow(tcol("-" ARG_LANGUAGE" &lt;language&gt;") +
152
               tcol(tr("Sets RetroShare's language.") +
153
                    "<br>[" + LanguageSupport::languageCodes().join("|") + "]"));
154
   out << "</table>";
155
diff --git retroshare-nogui/src/retroshare.cc retroshare-nogui/src/retroshare.cc
156
index 59a1bf1..7ad45b0 100644
157
--- retroshare-nogui/src/retroshare.cc
158
+++ retroshare-nogui/src/retroshare.cc
159
@@ -85,12 +85,9 @@ int main(int argc, char **argv)
160
     args >> parameter("docroot",      docroot,  "path", "Serve static files from this path.", false);
161
     // unfinished
162
     //args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false);
163
-    args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)");
164
-#ifdef __APPLE__    
165
+    args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)"); 
166
     args >> help('h',"help","Display this Help");
167
-#else
168
-    args >> help();
169
-#endif
170
+
171
     if (args.helpRequested())
172
     {
173
         std::cerr << args.usage() << std::endl;
(-)b/net-p2p/retroshare/files/patch-git_aca88308 (+146 lines)
Added Link Here
1
This patch is required for the build to succeed in C++11 mode.
2
3
From aca88308eae16ab67627593c0df2fce7beb02e89 Mon Sep 17 00:00:00 2001
4
From: zeners <zener@sbg.at>
5
Date: Tue, 29 Mar 2016 21:22:14 +0200
6
Subject: [PATCH] compatible to g++11 / QT5
7
8
method suggested by cyril
9
10
diff --git libretroshare/src/pqi/pqiqosstreamer.cc libretroshare/src/pqi/pqiqosstreamer.cc
11
index 898f2b5..fc0dc20 100644
12
--- libretroshare/src/pqi/pqiqosstreamer.cc
13
+++ libretroshare/src/pqi/pqiqosstreamer.cc
14
@@ -25,6 +25,8 @@
15
 
16
 #include "pqiqosstreamer.h"
17
 
18
+const float    pqiQoSstreamer::PQI_QOS_STREAMER_ALPHA      = 2.0f ;
19
+
20
 pqiQoSstreamer::pqiQoSstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin)
21
 	: pqithreadstreamer(parent,rss,peerid,bio_in,bio_flagsin), pqiQoS(PQI_QOS_STREAMER_MAX_LEVELS, PQI_QOS_STREAMER_ALPHA)
22
 {
23
diff --git libretroshare/src/pqi/pqiqosstreamer.h libretroshare/src/pqi/pqiqosstreamer.h
24
index b85ac32..574ba94 100644
25
--- libretroshare/src/pqi/pqiqosstreamer.h
26
+++ libretroshare/src/pqi/pqiqosstreamer.h
27
@@ -34,7 +34,7 @@ class pqiQoSstreamer: public pqithreadstreamer, public pqiQoS
28
 		pqiQoSstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin);
29
 
30
 		static const uint32_t PQI_QOS_STREAMER_MAX_LEVELS =  10 ;
31
-		static const float    PQI_QOS_STREAMER_ALPHA      = 2.0 ;
32
+        static const float    PQI_QOS_STREAMER_ALPHA ;
33
 
34
 		virtual void locked_storeInOutputQueue(void *ptr,int priority) ;
35
 		virtual int locked_out_queue_size() const { return _total_item_count ; }
36
diff --git libretroshare/src/retroshare/rsreputations.h libretroshare/src/retroshare/rsreputations.h
37
index 484aabb..8db42ee 100644
38
--- libretroshare/src/retroshare/rsreputations.h
39
+++ libretroshare/src/retroshare/rsreputations.h
40
@@ -31,8 +31,8 @@
41
 class RsReputations
42
 {
43
 public:
44
-    	static const float REPUTATION_THRESHOLD_ANTI_SPAM = 1.4f ;
45
-    	static const float REPUTATION_THRESHOLD_DEFAULT   = 1.0f ;
46
+        static const float REPUTATION_THRESHOLD_ANTI_SPAM;
47
+        static const float REPUTATION_THRESHOLD_DEFAULT;
48
         
49
 	// This is the interface file for the reputation system
50
 	//
51
diff --git libretroshare/src/rsserver/p3face-server.cc libretroshare/src/rsserver/p3face-server.cc
52
index 746ebac..b769136 100644
53
--- libretroshare/src/rsserver/p3face-server.cc
54
+++ libretroshare/src/rsserver/p3face-server.cc
55
@@ -69,6 +69,10 @@ static double getCurrentTS()
56
         return cts;
57
 }
58
 
59
+const double RsServer::minTimeDelta = 0.1; // 25;
60
+const double RsServer::maxTimeDelta = 0.5;
61
+const double RsServer::kickLimit = 0.15;
62
+
63
 
64
 RsServer::RsServer()
65
 	: coreMutex("RsServer")
66
diff --git libretroshare/src/rsserver/p3face.h libretroshare/src/rsserver/p3face.h
67
index 23efa58..51f05a5 100644
68
--- libretroshare/src/rsserver/p3face.h
69
+++ libretroshare/src/rsserver/p3face.h
70
@@ -194,9 +194,9 @@ class RsServer: public RsControl, public RsTickingThread
71
     double mAvgTickRate ;
72
     double mTimeDelta ;
73
 
74
-    static const double minTimeDelta = 0.1; // 25;
75
-    static const double maxTimeDelta = 0.5;
76
-    static const double kickLimit = 0.15;
77
+    static const double minTimeDelta; // 25;
78
+    static const double maxTimeDelta;
79
+    static const double kickLimit;
80
 };
81
 
82
 /* Helper function to convert windows paths
83
diff --git libretroshare/src/services/p3gxsreputation.cc libretroshare/src/services/p3gxsreputation.cc
84
index dd7a46d..b78ca1f 100644
85
--- libretroshare/src/services/p3gxsreputation.cc
86
+++ libretroshare/src/services/p3gxsreputation.cc
87
@@ -303,6 +303,10 @@ void p3GxsReputation::updateActiveFriends()
88
 
89
 }
90
 
91
+const float RsReputations::REPUTATION_THRESHOLD_ANTI_SPAM = 1.4f ;
92
+const float RsReputations::REPUTATION_THRESHOLD_DEFAULT   = 1.0f ;
93
+
94
+
95
 static RsReputations::Opinion safe_convert_uint32t_to_opinion(uint32_t op)
96
 {
97
 	return RsReputations::Opinion(std::min((uint32_t)op,UPPER_LIMIT)) ;
98
diff --git retroshare-gui/src/gui/elastic/node.cpp retroshare-gui/src/gui/elastic/node.cpp
99
index 7755172..bc33151 100644
100
--- retroshare-gui/src/gui/elastic/node.cpp
101
+++ retroshare-gui/src/gui/elastic/node.cpp
102
@@ -87,6 +87,12 @@ Node::Node(const std::string& node_string,GraphWidget::NodeType type,GraphWidget
103
 		_auth = GraphWidget::ELASTIC_NODE_AUTH_FULL ;
104
 }
105
 
106
+const float Node::MASS_FACTOR = 10 ;
107
+const float Node::FRICTION_FACTOR = 10.8f ;
108
+const float Node::REPULSION_FACTOR = 4;
109
+const float Node::NODE_DISTANCE = 130.0f ;
110
+
111
+
112
 void Node::addEdge(Edge *edge)
113
 {
114
     edgeList << edge;
115
diff --git retroshare-gui/src/gui/elastic/node.h retroshare-gui/src/gui/elastic/node.h
116
index d7bcd5f..13c717b 100644
117
--- retroshare-gui/src/gui/elastic/node.h
118
+++ retroshare-gui/src/gui/elastic/node.h
119
@@ -118,10 +118,10 @@ class Node : public QObject, public QGraphicsItem
120
 	 RsPeerId _ssl_id ;
121
 	 RsPgpId _gpg_id ;
122
 
123
-	 static const float MASS_FACTOR = 10 ;
124
-	 static const float FRICTION_FACTOR = 10.8 ;
125
-	 static const float REPULSION_FACTOR = 4 ;
126
-	 static const float NODE_DISTANCE = 130.0 ;
127
+     static const float MASS_FACTOR;
128
+     static const float FRICTION_FACTOR;
129
+     static const float REPULSION_FACTOR;
130
+     static const float NODE_DISTANCE;
131
 };
132
 
133
 #endif
134
diff --git retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp
135
index fe2e1aa..a3381b2 100644
136
--- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp
137
+++ retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp
138
@@ -1565,7 +1565,7 @@ void GxsForumThreadWidget::setMsgReadStatus(QList<QTreeWidgetItem*> &rows, bool
139
 			// LIKE THIS BELOW...
140
 			//std::string grpId = (*Row)->data(COLUMN_THREAD_DATA, ROLE_THREAD_GROUPID).toString().toStdString();
141
 
142
-			RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), msgId);
143
+            RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), RsGxsMessageId(msgId));
144
 
145
 			uint32_t token;
146
 			rsGxsForums->setMessageReadStatus(token, msgPair, read);
(-)a/net-p2p/retroshare/files/patch-libretroshare_src_grouter_p3grouter.h (-20 lines)
Removed Link Here
1
--- libretroshare/src/grouter/p3grouter.h.orig	2016-02-05 19:04:46 UTC
2
+++ libretroshare/src/grouter/p3grouter.h
3
@@ -225,7 +225,7 @@ private:
4
     void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ;
5
 
6
     static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item);
7
-#ifdef __APPLE__
8
+#if defined(__APPLE__) || defined(__FreeBSD__)
9
 public:
10
 #endif
11
     class nullstream: public std::ostream {};
12
@@ -236,7 +236,7 @@ public:
13
 
14
         return _debug_enabled?(std::cerr):null;
15
     }
16
-#ifdef __APPLE__
17
+#if defined(__APPLE__) || defined(__FreeBSD__)
18
 private:
19
 #endif
20
     void routePendingObjects() ;
(-)a/net-p2p/retroshare/files/patch-libretroshare_src_rsserver_rsinit.cc (-11 lines)
Removed Link Here
1
--- libretroshare/src/rsserver/rsinit.cc.orig	2016-02-05 19:04:46 UTC
2
+++ libretroshare/src/rsserver/rsinit.cc
3
@@ -367,7 +367,7 @@ int RsInit::InitRetroShare(int argcIgnor
4
 #ifdef LOCALNET_TESTING
5
 			   >> parameter('R',"restrict-port" ,portRestrictions             ,"port1-port2","Apply port restriction"                   ,false)
6
 #endif
7
-#ifdef __APPLE__
8
+#if defined(__APPLE__) || defined(__FreeBSD__)
9
  				>> help('h',"help","Display this Help") ;
10
 #else
11
 				>> help() ;
(-)a/net-p2p/retroshare/files/patch-libretroshare_src_util_argstream.h (-11 lines)
Removed Link Here
1
--- libretroshare/src/util/argstream.h.orig	2016-02-05 19:04:46 UTC
2
+++ libretroshare/src/util/argstream.h
3
@@ -141,7 +141,7 @@ namespace 
4
 			inline OptionHolder(char s,
5
 					const char* l,
6
 					const char* desc);  
7
-#ifdef __APPLE__
8
+#if defined(__APPLE__) || defined(__FreeBSD__)
9
  			friend OptionHolder help(char s,
10
  					const char* l,
11
  					const char* desc);
(-)a/net-p2p/retroshare/files/patch-retroshare-nogui_src_retroshare.cc (-11 lines)
Removed Link Here
1
--- retroshare-nogui/src/retroshare.cc.orig	2016-02-05 19:04:46 UTC
2
+++ retroshare-nogui/src/retroshare.cc
3
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
4
     // unfinished
5
     //args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false);
6
     args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)");
7
-#ifdef __APPLE__    
8
+#if defined(__APPLE__) || defined(__FreeBSD__)
9
     args >> help('h',"help","Display this Help");
10
 #else
11
     args >> help();

Return to bug 212365