File: 0008-fix-build-with-gcc11.patch

package info (click to toggle)
ns2 2.35%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 79,396 kB
  • sloc: cpp: 172,923; tcl: 107,167; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 829; awk: 525; csh: 355
file content (62 lines) | stat: -rw-r--r-- 2,399 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Description: Fix build with gcc-11
Author: Marcos Talau <talau@debian.org>
Bug-Debian: https://bugs.debian.org/984253
Last-Update: 2022-11-20

Index: ns2-2.35+dfsg/tcp/tcp-fack.cc
===================================================================
--- ns2-2.35+dfsg.orig/tcp/tcp-fack.cc
+++ ns2-2.35+dfsg/tcp/tcp-fack.cc
@@ -84,7 +84,7 @@ void FackTcpAgent::oldack(Packet* pkt)
 	 * retract maxseq_. The following line of code helps in those cases. For
 	 * versions of TCP, it is a NOP.
 */
-	maxseq_ = max(maxseq_, highest_ack_);
+	maxseq_ = max(int(maxseq_), int(highest_ack_));
 	if (t_seqno_ < last_ack_ + 1)
 		t_seqno_ = last_ack_ + 1;
 	newtimer(pkt);
Index: ns2-2.35+dfsg/tcp/tcp-fs.cc
===================================================================
--- ns2-2.35+dfsg.orig/tcp/tcp-fs.cc
+++ ns2-2.35+dfsg/tcp/tcp-fs.cc
@@ -65,7 +65,7 @@ TcpFsAgent::output_helper(Packet *pkt)
 	double now = Scheduler::instance().clock();
 	double idle_time = now - last_recv_time_;
 	double timeout = ((t_srtt_ >> 3) + t_rttvar_) * tcp_tick_ ;
-	maxseq_ = max(maxseq_, highest_ack_);
+	maxseq_ = max(int(maxseq_), int(highest_ack_));
 
 	/* 
 	 * if the connection has been idle (with no outstanding data) for long 
@@ -172,7 +172,7 @@ TcpFsAgent::recv_newack_helper(Packet *p
 	else
 		ackcount = 1;
 	newack(pkt);
-	maxseq_ = max(maxseq_, highest_ack_);
+	maxseq_ = max(int(maxseq_), int(highest_ack_));
 	if (t_exact_srtt_ != 0) {
 		delta = tao - t_exact_srtt_;
 		if (delta < 0)
@@ -208,7 +208,7 @@ NewRenoTcpFsAgent::partialnewack_helper(
 {
 	partialnewack(pkt);
 	/* Do this because we may have retracted maxseq_ */
-	maxseq_ = max(maxseq_, highest_ack_);
+	maxseq_ = max(int(maxseq_), int(highest_ack_));
 	if (fs_mode_ && fast_loss_recov_) {
 		/* 
 		 * A partial new ack implies that more than one packet has been lost
Index: ns2-2.35+dfsg/tcp/tcp-linux.cc
===================================================================
--- ns2-2.35+dfsg.orig/tcp/tcp-linux.cc
+++ ns2-2.35+dfsg/tcp/tcp-linux.cc
@@ -151,7 +151,7 @@ unsigned char LinuxTcpAgent::ack_process
 	if (flag&FLAG_DATA_ACKED) {
 		highest_ack_ = tcph->seqno();
 		linux_.snd_una = (highest_ack_+1)*linux_.mss_cache;
-		maxseq_ = max(maxseq_, highest_ack_);
+		maxseq_ = max(int(maxseq_), int(highest_ack_));
 		if (t_seqno_ < highest_ack_ + 1) {
 			t_seqno_ = highest_ack_ + 1;
 			linux_.snd_nxt = t_seqno_*linux_.mss_cache;