summaryrefslogtreecommitdiff
path: root/games-arcade/sdb/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
commita978c074e4272bb901fbe4a10de0a7b2af574f17 (patch)
tree8c764c1cc0576389ce22abd317bceba71ea5732d /games-arcade/sdb/files
parent40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (diff)
gentoo resync : 04.05.2021
Diffstat (limited to 'games-arcade/sdb/files')
-rw-r--r--games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch45
-rw-r--r--games-arcade/sdb/files/sdb-1.0.2-return-type.patch56
2 files changed, 101 insertions, 0 deletions
diff --git a/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch b/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch
new file mode 100644
index 000000000000..f0a20657b900
--- /dev/null
+++ b/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/787710
+--- a/src/md2.h
++++ b/src/md2.h
+@@ -68,7 +68,7 @@ struct tMaterialInfo
+ {
+ char strName[255];
+ char strFile[255];
+- byte color[3];
++ sdb_byte color[3];
+ int textureId;
+ float uTile;
+ float vTile;
+@@ -151,8 +151,8 @@ struct tMd2Header
+
+ struct tMd2AliasTriangle
+ {
+- byte vertex[3];
+- byte lightNormalIndex;
++ sdb_byte vertex[3];
++ sdb_byte lightNormalIndex;
+ };
+
+ struct tMd2Triangle
+--- a/src/models.h
++++ b/src/models.h
+@@ -43,7 +43,7 @@ struct tMaterialInfo
+ {
+ char strName[255]; // The texture name
+ char strFile[255]; // The texture file name (If this is set it's a texture map)
+- byte color[3]; // The color of the object (R, G, B)
++ sdb_byte color[3]; // The color of the object (R, G, B)
+ int texureId; // the texture ID
+ float uTile; // u tiling of texture
+ float vTile; // v tiling of texture
+--- a/src/sdb.h
++++ b/src/sdb.h
+@@ -175,7 +175,7 @@ using namespace std;
+ #define MOUSE_BUTTON_2 -2
+ #define MOUSE_BUTTON_3 -3
+
+-typedef unsigned char byte;
++typedef unsigned char sdb_byte;
+
+ enum TEXTURE_NAMES {
+ // Fonts
diff --git a/games-arcade/sdb/files/sdb-1.0.2-return-type.patch b/games-arcade/sdb/files/sdb-1.0.2-return-type.patch
new file mode 100644
index 000000000000..9750eedb9919
--- /dev/null
+++ b/games-arcade/sdb/files/sdb-1.0.2-return-type.patch
@@ -0,0 +1,56 @@
+Fix -Werror=return-type warnings to prevent gcc-8+ from
+corrupting caller's stack.
+
+Also detected by -fsanitize=undefined as:
+runtime error: execution reached the end of a value-returning
+function without returning a value
+--- a/src/input.cpp
++++ b/src/input.cpp
+@@ -103,5 +103,6 @@ float InputHandler::bindingState(int key)
+ }
+ else
+ return 0.0;
++ return 0.0;
+ }
+
+--- a/src/objects.h
++++ b/src/objects.h
+@@ -545,12 +545,12 @@ class Object : public LevelObject
+ bool Augmented() { return augmented; }
+ void Augment() { model[1].set(MDL_PLAYER_TORSO2); augmented = true; }
+
+- virtual Weapon* Wpn() {}
+- virtual int CurrWeapon() {}
++ virtual Weapon* Wpn() { return 0; }
++ virtual int CurrWeapon() { return 0; }
+ virtual void selectWeapon(int wp) {}
+- virtual char weaponState(int wp) {}
+- virtual char keyState(int wp) {}
+- virtual Vector2D* WeaponPoint() {}
++ virtual char weaponState(int wp) { return 0; }
++ virtual char keyState(int wp) { return 0; }
++ virtual Vector2D* WeaponPoint() { return 0; }
+
+ void giveKey(int key) { keys |= 1 << key-1; }
+ virtual void givePowerup(int idx) {}
+--- a/src/sdb.h
++++ b/src/sdb.h
+@@ -370,7 +370,7 @@ class Vector2D
+ void set(float nx, float ny) { c[X] = nx; c[Y] = ny; c[Z] = 0; }
+ void apply() { glVertex3fv(c); }
+ void print() { printf("(%f, %f)\n", c[X], c[Y]); }
+- Vector2D operator = (Vector2D v) { c[X] = v.c[X]; c[Y] = v.c[Y]; }
++ Vector2D operator = (Vector2D v) { c[X] = v.c[X]; c[Y] = v.c[Y]; return *this; }
+ void operator += (Vector2D v) { c[X] += v.c[X]; c[Y] += v.c[Y]; }
+ void operator -= (Vector2D v) { c[X] -= v.c[X]; c[Y] -= v.c[Y]; }
+ void operator += (float s) { c[X] += s; c[Y] += s; }
+--- a/src/weapons.cpp
++++ b/src/weapons.cpp
+@@ -135,6 +135,7 @@ bool Weapon::fire(float x, float y, float head, float h)
+ }
+ else
+ return false;
++ return false;
+ }
+
+ void Weapon::releaseTrigger(float x, float y, float head, float h)