Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-action/armagetronad/, games-action/armagetronad/files/
Date: Sun, 30 Jul 2017 09:10:13
Message-Id: 1501405733.85673de37c260f353160cc32452383eea2406a13.soap@gentoo
1 commit: 85673de37c260f353160cc32452383eea2406a13
2 Author: Peter Levine <plevine457 <AT> gmail <DOT> com>
3 AuthorDate: Wed Jul 19 08:14:31 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 30 09:08:53 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85673de3
7
8 games-action/armagetronad: Fix building with GCC-6
9
10 Bug: https://bugs.gentoo.org/show_bug.cgi?id=617768
11 Package-Manager: Portage-2.3.6, Repoman-2.3.2
12 Closes: https://github.com/gentoo/gentoo/pull/5133
13
14 .../armagetronad/armagetronad-0.2.8.3.3-r1.ebuild | 4 +-
15 .../files/armagetronad-0.2.8.3.3-gcc6.patch | 222 +++++++++++++++++++++
16 2 files changed, 225 insertions(+), 1 deletion(-)
17
18 diff --git a/games-action/armagetronad/armagetronad-0.2.8.3.3-r1.ebuild b/games-action/armagetronad/armagetronad-0.2.8.3.3-r1.ebuild
19 index a6fc79e3a85..7aa64769890 100644
20 --- a/games-action/armagetronad/armagetronad-0.2.8.3.3-r1.ebuild
21 +++ b/games-action/armagetronad/armagetronad-0.2.8.3.3-r1.ebuild
22 @@ -1,4 +1,4 @@
23 -# Copyright 1999-2016 Gentoo Foundation
24 +# Copyright 1999-2017 Gentoo Foundation
25 # Distributed under the terms of the GNU General Public License v2
26
27 EAPI=6
28 @@ -28,6 +28,8 @@ RDEPEND="
29 )"
30 DEPEND=${RDEPEND}
31
32 +PATCHES=( "${FILESDIR}"/${P}-gcc6.patch )
33 +
34 src_prepare() {
35 default
36 sed -i -e 's#aa_docdir=.*$#aa_docdir=${docdir}#' configure || die
37
38 diff --git a/games-action/armagetronad/files/armagetronad-0.2.8.3.3-gcc6.patch b/games-action/armagetronad/files/armagetronad-0.2.8.3.3-gcc6.patch
39 new file mode 100644
40 index 00000000000..0cd6e5bc1d6
41 --- /dev/null
42 +++ b/games-action/armagetronad/files/armagetronad-0.2.8.3.3-gcc6.patch
43 @@ -0,0 +1,222 @@
44 +Bug: https://bugs.gentoo.org/show_bug.cgi?id=617768
45 +Commit: https://sourceforge.net/p/armagetronad/code/10845/
46 +
47 +--- a/src/engine/eNetGameObject.cpp
48 ++++ b/src/engine/eNetGameObject.cpp
49 +@@ -85,7 +85,7 @@
50 + eNetGameObject::eNetGameObject(eGrid *grid, const eCoord &pos,const eCoord &dir,
51 + ePlayerNetID* p,bool autodelete)
52 + :eGameObject(grid, pos,dir,NULL,autodelete),
53 +-nNetObject(p->Owner()),player(p){
54 ++ nNetObject(Owner(p)),player(p){
55 + lastClientsideAction=0;
56 + if (sn_GetNetState()!=nCLIENT)
57 + RequestSync();
58 +@@ -205,7 +205,7 @@
59 +
60 + void eNetGameObject::SetPlayer(ePlayerNetID* a_player)
61 + {
62 +- tASSERT( !a_player || Owner() == player->Owner() );
63 ++ tASSERT( !a_player || Owner() == Owner(player) );
64 + player = a_player;
65 + if ( laggometerSmooth == 0 && sn_GetNetState() != nCLIENT )
66 + laggometerSmooth = laggometer = se_GetPing( player );
67 +--- a/src/engine/ePlayer.cpp
68 ++++ b/src/engine/ePlayer.cpp
69 +@@ -56,6 +56,7 @@
70 + #include "nConfig.h"
71 + #include "nNetwork.h"
72 + #include <time.h>
73 ++#include <climits>
74 +
75 + int se_lastSaidMaxEntries = 8;
76 +
77 +@@ -1689,9 +1690,9 @@
78 + // foo (Red Team) --> Blue Team: some message here
79 + eTeam *senderTeam = sender->CurrentTeam();
80 + console << tColoredString::ColorString(1,1,.5) << " (";
81 +- console << *senderTeam;
82 ++ console << senderTeam;
83 + console << tColoredString::ColorString(1,1,.5) << ") --> ";
84 +- console << *team;
85 ++ console << team;
86 + }
87 +
88 + console << tColoredString::ColorString(1,1,.5) << ": ";
89 +@@ -1923,7 +1924,7 @@
90 + else {
91 + eTeam *senderTeam = sender->CurrentTeam();
92 + say << tColoredString::ColorString(1,1,.5) << " (";
93 +- say << *team;
94 ++ say << team;
95 + say << tColoredString::ColorString(1,1,.5) << " ) --> ";
96 + say << senderTeam;
97 + }
98 +@@ -3941,7 +3942,7 @@
99 + sg_ClampPingCharity( ::pingCharity );
100 + }
101 +
102 +-static int IMPOSSIBLY_LOW_SCORE=(-1 << 31);
103 ++static int IMPOSSIBLY_LOW_SCORE=INT_MIN;
104 +
105 + static nSpamProtectionSettings se_chatSpamSettings( 1.0f, "SPAM_PROTECTION_CHAT", tOutput("$spam_protection") );
106 +
107 +--- a/src/engine/eTeam.cpp
108 ++++ b/src/engine/eTeam.cpp
109 +@@ -31,20 +31,21 @@
110 + #include "nConfig.h"
111 +
112 + #include <set>
113 ++#include <climits>
114 +
115 +-tString & operator << ( tString &s, const eTeam & team)
116 ++tString & operator << ( tString &s, const eTeam * team)
117 + {
118 +- if ( !(&team) )
119 ++ if ( !team )
120 + return s << tOutput("$player_spectator_message");
121 + else
122 +- return s << team.GetColoredName();
123 ++ return s << team->GetColoredName();
124 + }
125 +-std::ostream & operator << ( std::ostream &s, const eTeam & team)
126 ++std::ostream & operator << ( std::ostream &s, const eTeam * team)
127 + {
128 +- if ( !(&team) )
129 ++ if ( !team )
130 + return s << tOutput("$player_spectator_message");
131 + else
132 +- return s << team.GetColoredName();
133 ++ return s << team->GetColoredName();
134 + }
135 +
136 + #define TEAMCOLORS 8
137 +@@ -75,7 +76,7 @@
138 + // static tList<eTeam> se_ColoredTeams;
139 + static eTeam * se_ColoredTeams[TEAMCOLORS]={0,0,0,0,0,0,0,0};
140 +
141 +-static int IMPOSSIBLY_LOW_SCORE=(-1 << 31);
142 ++static int IMPOSSIBLY_LOW_SCORE=INT_MIN;
143 +
144 + // class that creates config items for one team
145 + // TEAM_(NAME|RED|GREEN|BLUE)_X
146 +--- a/src/engine/eTeam.h
147 ++++ b/src/engine/eTeam.h
148 +@@ -32,8 +32,8 @@
149 + #include "nNetObject.h"
150 + #include "tList.h"
151 +
152 +-tString & operator << ( tString&, const eTeam&);
153 +-std::ostream & operator << ( std::ostream&, const eTeam&);
154 ++tString & operator << ( tString&, const eTeam*);
155 ++std::ostream & operator << ( std::ostream&, const eTeam*);
156 +
157 + template<class T> class nConfItem;
158 +
159 +--- a/src/network/nNetObject.h
160 ++++ b/src/network/nNetObject.h
161 +@@ -128,7 +128,16 @@
162 +
163 + virtual void Dump( tConsole& con ); // dumps object stats
164 +
165 ++ static unsigned short ID(nNetObject const *pThis)
166 ++ {
167 ++ if (pThis)
168 ++ return pThis->id;
169 ++ else
170 ++ return 0;
171 ++ }
172 ++
173 + unsigned short ID() const{
174 ++ tASSERT(this);
175 + if (this)
176 + return id;
177 + else
178 +@@ -135,7 +144,16 @@
179 + return 0;
180 + }
181 +
182 ++ static unsigned short Owner(nNetObject const *pThis)
183 ++ {
184 ++ if (pThis)
185 ++ return pThis->owner;
186 ++ else
187 ++ return ::sn_myNetID;
188 ++ }
189 ++
190 + unsigned short Owner() const{
191 ++ tASSERT(this);
192 + if (this)
193 + return owner;
194 + else
195 +--- a/src/tools/tLocale.cpp
196 ++++ b/src/tools/tLocale.cpp
197 +@@ -731,6 +731,13 @@
198 +
199 + // and a special implementation for the locales and strings:
200 + tOutput& operator << (tOutput &o, const char *locale){
201 ++ return o.AddString(locale);
202 ++}
203 ++
204 ++tOutput & tOutput::AddString(char const * locale)
205 ++{
206 ++ tOutput & o = *this;
207 ++
208 + int len = strlen(locale);
209 + if (len == 0)
210 + return o;
211 +--- a/src/tools/tLocale.h
212 ++++ b/src/tools/tLocale.h
213 +@@ -81,7 +81,7 @@
214 +
215 + tOutputItemBase *anchor;
216 +
217 +- tOutput& operator << (const tOutput &o);
218 ++ // tOutput& operator << (const tOutput &o);
219 + public:
220 + tOutput();
221 + ~tOutput();
222 +@@ -91,6 +91,7 @@
223 + void AddLiteral(const char *); // adds a language independent string
224 + void AddLocale(const char *); // adds a language dependant string
225 + void AddSpace(); // adds a simple space
226 ++ tOutput & AddString(char const * pString); // checks the string, delegates to correct Add...()-Function
227 +
228 + // set a template parameter at this position of the output string
229 + tOutput & SetTemplateParameter(int num, const char *parameter);
230 +@@ -113,7 +114,7 @@
231 +
232 + SetTemplateParameter(1, template1);
233 +
234 +- *this << identifier;
235 ++ AddString(identifier);
236 + }
237 +
238 + template< class T1, class T2 >
239 +@@ -125,7 +126,7 @@
240 + SetTemplateParameter(1, template1);
241 + SetTemplateParameter(2, template2);
242 +
243 +- *this << identifier;
244 ++ AddString(identifier);
245 + }
246 +
247 + template< class T1, class T2, class T3 >
248 +@@ -138,7 +139,7 @@
249 + SetTemplateParameter(2, template2);
250 + SetTemplateParameter(3, template3);
251 +
252 +- *this << identifier;
253 ++ AddString(identifier);
254 + }
255 +
256 + template< class T1, class T2, class T3, class T4 >
257 +@@ -152,7 +153,7 @@
258 + SetTemplateParameter(3, template3);
259 + SetTemplateParameter(4, template4);
260 +
261 +- *this << identifier;
262 ++ AddString(identifier);
263 + }
264 +
265 + tOutput(const tOutput &o); // copy constructor