pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/games/assaultcube assaultcube: Backport gcc6 fixes fro...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bf8e0eca175b
branches:  trunk
changeset: 397851:bf8e0eca175b
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Jul 05 08:01:31 2019 +0000

description:
assaultcube: Backport gcc6 fixes from upstream.

This compiled successfully on NetBSD-current with gcc7, so it seems this
mainly helps other OSes.

diffstat:

 games/assaultcube/Makefile                                       |   4 +-
 games/assaultcube/distinfo                                       |  16 +++-
 games/assaultcube/patches/patch-source_src_bot_bot__waypoint.cpp |  48 ++++++++++
 games/assaultcube/patches/patch-source_src_command.cpp           |  22 ++++
 games/assaultcube/patches/patch-source_src_command.h             |  21 ++++
 games/assaultcube/patches/patch-source_src_crypto.cpp            |  22 ++++
 games/assaultcube/patches/patch-source_src_editing.cpp           |  36 +++++++
 games/assaultcube/patches/patch-source_src_entity.h              |  22 ++++
 games/assaultcube/patches/patch-source_src_main.cpp              |  29 ++++++
 games/assaultcube/patches/patch-source_src_platform.h            |  36 +++++++
 games/assaultcube/patches/patch-source_src_protos.h              |  23 ++++
 games/assaultcube/patches/patch-source_src_rendercubes.cpp       |  35 +++++++
 games/assaultcube/patches/patch-source_src_rendertext.cpp        |  31 ++++++
 games/assaultcube/patches/patch-source_src_tools.h               |  23 ++++
 games/assaultcube/patches/patch-source_src_world.cpp             |  26 +++++
 games/assaultcube/patches/patch-source_src_worldrender.cpp       |  26 +++++
 16 files changed, 417 insertions(+), 3 deletions(-)

diffs (truncated from 495 to 300 lines):

diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/Makefile
--- a/games/assaultcube/Makefile        Fri Jul 05 07:59:12 2019 +0000
+++ b/games/assaultcube/Makefile        Fri Jul 05 08:01:31 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.2 2019/07/01 04:08:09 ryoon Exp $
+# $NetBSD: Makefile,v 1.3 2019/07/05 08:01:31 nia Exp $
 
 PKGNAME=       assaultcube-1.2.0.2
-PKGREVISION=   1
+PKGREVISION=   2
 DISTNAME=      AssaultCube_v${PKGVERSION_NOREV}
 CATEGORIES=    games
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=assaultcube/}
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/distinfo
--- a/games/assaultcube/distinfo        Fri Jul 05 07:59:12 2019 +0000
+++ b/games/assaultcube/distinfo        Fri Jul 05 08:01:31 2019 +0000
@@ -1,7 +1,21 @@
-$NetBSD: distinfo,v 1.1 2019/06/30 21:44:30 nia Exp $
+$NetBSD: distinfo,v 1.2 2019/07/05 08:01:31 nia Exp $
 
 SHA1 (AssaultCube_v1.2.0.2.tar.bz2) = 16b5239c1e2129ba980aee2b96ee52c6128e5821
 RMD160 (AssaultCube_v1.2.0.2.tar.bz2) = 861c5d59e8313b7dd8548605f08d6829dca76326
 SHA512 (AssaultCube_v1.2.0.2.tar.bz2) = e2a0d3380db6d2ac2773ea90703fd572504729b9214a6c105f39aefa4c06ff48720634c6601efdad8b9b3b22dec9bc3a9ea7e094839042bc3ff5cfdd88eac976
 Size (AssaultCube_v1.2.0.2.tar.bz2) = 48181347 bytes
 SHA1 (patch-source_src_Makefile) = 8825c40bf869166708a1f9277b1f77901137771d
+SHA1 (patch-source_src_bot_bot__waypoint.cpp) = 5ded14f79b69ee6ec6c2e9628452a1d6db0d406e
+SHA1 (patch-source_src_command.cpp) = 9bf2127eff468fd213bf66d345daab982b1c0722
+SHA1 (patch-source_src_command.h) = 300f62adb527224c420ed2a6ce3044660fdb4e7a
+SHA1 (patch-source_src_crypto.cpp) = fff2b1cf9cac8c4dd9999fc99ed5ce3200f331fc
+SHA1 (patch-source_src_editing.cpp) = 7bf829a47233358fe14341691e84c9bd5ff880b7
+SHA1 (patch-source_src_entity.h) = ab67abee7df1587eb01877a9aea64a1b28a940ea
+SHA1 (patch-source_src_main.cpp) = 4b3dc7617cb36054ed6de111e8994d22d2e0267b
+SHA1 (patch-source_src_platform.h) = 82530eef173f161ed33cee368c0afd6ccd5644a7
+SHA1 (patch-source_src_protos.h) = 0944251480debf25e8dc25463307c223ffebbfbb
+SHA1 (patch-source_src_rendercubes.cpp) = 740f5dc169a5e0b331437fd157238a5323a0c866
+SHA1 (patch-source_src_rendertext.cpp) = 3082ca174416c21157ef56fb4d09f3ae3653a47d
+SHA1 (patch-source_src_tools.h) = a6c0ca4a28b51fc437ed69fe3e7ea48f07c711cb
+SHA1 (patch-source_src_world.cpp) = 2b48cddb24109c018dc70a3e94417c43178ae101
+SHA1 (patch-source_src_worldrender.cpp) = fb7341ad70fcb242982a5f02d7ab0fe3759245d0
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_bot_bot__waypoint.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_bot_bot__waypoint.cpp  Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-source_src_bot_bot__waypoint.cpp,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/bot/bot_waypoint.cpp.orig       2013-11-10 18:50:03.000000000 +0000
++++ source/src/bot/bot_waypoint.cpp
+@@ -1221,7 +1221,7 @@ void CWaypointClass::CalcCost(node_s *pN
+                     flCost += (1.0f-flFraction)*0.5f;
+                }
+ 
+-               if ((abs(a) > 4) || (abs(b) > 4)) continue;
++               if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
+ 
+                vec from = to;
+                to.z -= (JUMP_HEIGHT - 1.0f);
+@@ -1249,7 +1249,7 @@ void CWaypointClass::CalcCost(node_s *pN
+                     flCost += (1.0f-flFraction)*0.5f;
+                }
+ 
+-               if ((abs(a) > 4) || (abs(b) > 4)) continue;
++               if ((iabs(a) > 4) || (iabs(b) > 4)) continue;
+ 
+                vec from = to;
+                to.z -= (JUMP_HEIGHT - 1.0f);
+@@ -1671,12 +1671,12 @@ node_s *CWaypointClass::GetNearestTrigge
+ void CWaypointClass::GetNodeIndexes(const vec &v_origin, short *i, short *j)
+ {
+      // Function code by cheesy and PMB
+-     //*i = abs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
+-     //*j = abs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
++     //*i = iabs((int)((int)(v_origin.x + (2*ssize)) / SECTOR_SIZE));
++     //*j = iabs((int)((int)(v_origin.y + (2*ssize)) / SECTOR_SIZE));
+      //*i = (int)((v_origin.x) / ssize * MAX_MAP_GRIDS);
+      //*j = (int)((v_origin.y) / ssize * MAX_MAP_GRIDS);
+-     *i = abs((int)((v_origin.x) / MAX_MAP_GRIDS));
+-     *j = abs((int)((v_origin.y) / MAX_MAP_GRIDS));
++     *i = iabs((int)((v_origin.x) / MAX_MAP_GRIDS));
++     *j = iabs((int)((v_origin.y) / MAX_MAP_GRIDS));
+ 
+      if (*i > MAX_MAP_GRIDS - 1)
+           *i = MAX_MAP_GRIDS - 1;
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_command.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_command.cpp    Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-source_src_command.cpp,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/command.cpp.orig        2013-11-09 18:48:58.000000000 +0000
++++ source/src/command.cpp
+@@ -497,7 +497,7 @@ char *executeret(const char *p)         
+             if(lc<=seer_t1.length())
+             {
+                 int dt = seer_t1[seer_index] - seer_t1[lc];
+-                if(abs(dt)<2)
++                if(iabs(dt)<2)
+                 {
+                     conoutf("SCRIPT EXECUTION warning [%d:%s]", &p, p);
+                     seer_t2.add(seer_t1[seer_index]);
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_command.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_command.h      Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-source_src_command.h,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/command.h.orig  2013-10-22 18:57:19.000000000 +0000
++++ source/src/command.h
+@@ -86,6 +86,7 @@ enum { IEXC_CORE = 0, IEXC_CFG, IEXC_PRO
+ #define VARNP(name, global, min, cur, max) int global = variable(#name, min, cur, max, &global, NULL, true)
+ #define VARF(name, min, cur, max, body)  extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, false)
+ #define VARFP(name, min, cur, max, body) extern int name; void var_##name() { body; } int name = variable(#name, min, cur, max, &name, var_##name, true)
++#define VARNFP(name, global, min, cur, max, body) extern int global; void var_##name() { body; } int global = variable(#name, min, cur, max, &global, var_##name, true)
+ 
+ #define FVARP(name, min, cur, max) float name = fvariable(#name, min, cur, max, &name, NULL, true)
+ #define FVAR(name, min, cur, max)  float name = fvariable(#name, min, cur, max, &name, NULL, false)
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_crypto.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_crypto.cpp     Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-source_src_crypto.cpp,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/crypto.cpp.orig 2013-10-09 08:27:37.000000000 +0000
++++ source/src/crypto.cpp
+@@ -763,7 +763,7 @@ bool hashstring(const char *str, char *r
+ const char *genpwdhash(const char *name, const char *pwd, int salt)
+ {
+     static string temp;
+-    formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, abs(PROTOCOL_VERSION));
++    formatstring(temp)("%s %d %s %s %d", pwd, salt, name, pwd, iabs(PROTOCOL_VERSION));
+     tiger::hashval hash;
+     tiger::hash((uchar *)temp, (int)strlen(temp), hash);
+     formatstring(temp)("%llx %llx %llx", hash.chunks[0], hash.chunks[1], hash.chunks[2]);
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_editing.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_editing.cpp    Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-source_src_editing.cpp,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/editing.cpp.orig        2013-10-22 18:57:16.000000000 +0000
++++ source/src/editing.cpp
+@@ -126,11 +126,11 @@ void checkselections()
+ void makesel(bool isnew)
+ {
+     block &cursel = sels.last(); //RR 10/12/12 - FIXEME, error checking should happen with "isnew", not here checking if it really is new.
+-    if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), abs(lastx-cx)+1, abs(lasty-cy)+1, max(lasth, ch));
++    if(isnew || sels.length() == 0) addselection(min(lastx, cx), min(lasty, cy), iabs(lastx-cx)+1, iabs(lasty-cy)+1, max(lasth, ch));
+     else
+     {
+         cursel.x = min(lastx, cx); cursel.y = min(lasty, cy);
+-        cursel.xs = abs(lastx-cx)+1; cursel.ys = abs(lasty-cy)+1;
++        cursel.xs = iabs(lastx-cx)+1; cursel.ys = iabs(lasty-cy)+1;
+         cursel.h = max(lasth, ch);
+         correctsel(cursel);
+     }
+@@ -645,7 +645,7 @@ void movemap(int xo, int yo, int zo) // 
+     }
+     if(xo || yo)
+     {
+-        block b = { max(-xo, 0), max(-yo, 0), ssize - abs(xo), ssize - abs(yo) }, *cp = blockcopy(b);
++        block b = { max(-xo, 0), max(-yo, 0), ssize - iabs(xo), ssize - iabs(yo) }, *cp = blockcopy(b);
+         cp->x = max(xo, 0);
+         cp->y = max(yo, 0);
+         blockpaste(*cp);
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_entity.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_entity.h       Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-source_src_entity.h,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/entity.h.orig   2013-10-22 18:57:16.000000000 +0000
++++ source/src/entity.h
+@@ -540,7 +540,7 @@ public:
+     {
+         const int maxskin[2] = { 4, 6 };
+         t = team_base(t < 0 ? team : t);
+-        nextskin[t] = abs(s) % maxskin[t];
++        nextskin[t] = iabs(s) % maxskin[t];
+     }
+ };
+ 
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_main.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_main.cpp       Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-source_src_main.cpp,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/main.cpp.orig   2013-10-29 09:33:15.000000000 +0000
++++ source/src/main.cpp
+@@ -513,11 +513,11 @@ void setresdata(char *s, enet_uint32 c)
+ COMMANDF(screenres, "ii", (int *w, int *h) { screenres(*w, *h); });
+ 
+ static int curgamma = 100;
+-VARFP(gamma, 30, 100, 300,
++VARNFP(gamma, vgamma, 30, 100, 300,
+ {
+-    if(gamma == curgamma) return;
+-    curgamma = gamma;
+-    float f = gamma/100.0f;
++    if(vgamma == curgamma) return;
++    curgamma = vgamma;
++    float f = vgamma/100.0f;
+     if(SDL_SetGamma(f,f,f)==-1) conoutf("Could not set gamma: %s", SDL_GetError());
+ });
+ 
diff -r 8422b0e86089 -r bf8e0eca175b games/assaultcube/patches/patch-source_src_platform.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/assaultcube/patches/patch-source_src_platform.h     Fri Jul 05 08:01:31 2019 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-source_src_platform.h,v 1.1 2019/07/05 08:01:31 nia Exp $
+
+[PATCH] fix some errors and warnings for GCC 6
+
+- do not use std::abs() because math.h includes one, that converts ints
+  to double. Use own iabs(), which directly uses labs() instead.
+- don't use the word "gamma" as name for variables
+- don't use a homebrew round() function
+
+https://github.com/assaultcube/AC/commit/752950989b4e286459ca9aee3d61a868d7b20fa4
+
+--- source/src/platform.h.orig 2013-10-22 18:57:19.000000000 +0000
++++ source/src/platform.h
+@@ -2,14 +2,6 @@
+     #ifdef _FORTIFY_SOURCE
+         #undef _FORTIFY_SOURCE
+     #endif
+-
+-    #define gamma __gamma
+-#endif
+-
+-#include <math.h>
+-
+-#ifdef __GNUC__
+-    #undef gamma
+ #endif
+ 
+ #include <string.h>
+@@ -19,6 +11,7 @@



Home | Main Index | Thread Index | Old Index