pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
opentyrian: update patches for -Werror
Module Name: pkgsrc-wip
Committed By: Yorick Hardy <yorickhardy%gmail.com@localhost>
Pushed By: yhardy
Date: Sat Nov 2 18:10:11 2019 +0200
Changeset: f11a4ab8ff9cd860ffdec0c1b3de76b5500f31af
Modified Files:
opentyrian/distinfo
opentyrian/patches/patch-Makefile
opentyrian/patches/patch-src_cJSON.c
opentyrian/patches/patch-src_mainint.c
opentyrian/patches/patch-src_tyrian2.c
Added Files:
opentyrian/patches/patch-src_destruct.c
opentyrian/patches/patch-src_episodes.c
opentyrian/patches/patch-src_keyboard.c
opentyrian/patches/patch-src_network.c
Log Message:
opentyrian: update patches for -Werror
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f11a4ab8ff9cd860ffdec0c1b3de76b5500f31af
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
opentyrian/distinfo | 12 ++++++++----
opentyrian/patches/patch-Makefile | 9 +++++++++
opentyrian/patches/patch-src_cJSON.c | 10 ++++++++++
opentyrian/patches/patch-src_destruct.c | 14 ++++++++++++++
opentyrian/patches/patch-src_episodes.c | 19 +++++++++++++++++++
opentyrian/patches/patch-src_keyboard.c | 14 ++++++++++++++
opentyrian/patches/patch-src_mainint.c | 18 +++++++++++++++++-
opentyrian/patches/patch-src_network.c | 22 ++++++++++++++++++++++
opentyrian/patches/patch-src_tyrian2.c | 10 ++++++++++
9 files changed, 123 insertions(+), 5 deletions(-)
diffs:
diff --git a/opentyrian/distinfo b/opentyrian/distinfo
index e0cea3dd9a..c9ba4a950e 100644
--- a/opentyrian/distinfo
+++ b/opentyrian/distinfo
@@ -3,10 +3,14 @@ $NetBSD: distinfo,v 1.1 2015/08/19 19:36:55 yhardy Exp $
SHA1 (opentyrian-2.1.20130907-src.tar.gz) = c5b97aea3931db6889acb639e59e619162b05183
RMD160 (opentyrian-2.1.20130907-src.tar.gz) = d6e892ebc6b865fbb4e622f5fe32f6e4a7a336a3
Size (opentyrian-2.1.20130907-src.tar.gz) = 297517 bytes
-SHA1 (patch-Makefile) = f6a3a8465f4b0ac7bc67963149ce210968990615
-SHA1 (patch-src_cJSON.c) = 5a9fa580cf6264b94e09645081d5f20ed12d0f20
+SHA1 (patch-Makefile) = 4436577f10ff642d2fc882cf09e0ac0c871533d9
+SHA1 (patch-src_cJSON.c) = 29983bcaab8e0bc501541db784ff8f8e8428f891
+SHA1 (patch-src_destruct.c) = 62a1ece164a1e336468b5401ad4f4a0243f4b0dd
+SHA1 (patch-src_episodes.c) = c279e1210c664105815dcdf98bf9d6b4f09f9bc0
SHA1 (patch-src_joystick.c) = 29586d78c87e5f86286a2e83f5188b0b8ee2d998
-SHA1 (patch-src_mainint.c) = 7b50be47d9807619dd8d40fe6a7fba651dac440a
+SHA1 (patch-src_keyboard.c) = 9a530c03a774ba0cefc12f68c86f1dfa9caaa568
+SHA1 (patch-src_mainint.c) = 6fa7ca305b4721c674bea8a1f38a0019a26d0ad9
+SHA1 (patch-src_network.c) = 35943d11fbabcbcbdb2eb35d28c050678bff0f58
SHA1 (patch-src_opl.c) = c0767e456eeb7d3e73f111deb59ed186aa4cd099
SHA1 (patch-src_shots.c) = 94ecd4756622c99c1acf7d566a2009564e7110f6
-SHA1 (patch-src_tyrian2.c) = 7a28efadfb928469accde1446dd761ad8cdf46d3
+SHA1 (patch-src_tyrian2.c) = 2095c9e699ed5f0ca40515c102c0ec4c30c297a4
diff --git a/opentyrian/patches/patch-Makefile b/opentyrian/patches/patch-Makefile
index 8eac04dac0..2d5394c5cb 100644
--- a/opentyrian/patches/patch-Makefile
+++ b/opentyrian/patches/patch-Makefile
@@ -16,3 +16,12 @@ Work around "uname -o" which is not available on NetBSD.
PLATFORM := WIN32
else
PLATFORM := UNIX
+@@ -26,7 +30,7 @@ ifneq ($(MAKECMDGOALS), release)
+ else
+ EXTRA_CFLAGS += -g0 -O2 -DNDEBUG
+ endif
+-EXTRA_CFLAGS += -MMD -pedantic -Wall -Wextra -Wno-missing-field-initializers
++EXTRA_CFLAGS += -MMD -pedantic -Wall -Wextra -Wno-missing-field-initializers -Wformat-truncation=0
+ ifeq ($(WITH_NETWORK), true)
+ EXTRA_CFLAGS += -DWITH_NETWORK
+ endif
diff --git a/opentyrian/patches/patch-src_cJSON.c b/opentyrian/patches/patch-src_cJSON.c
index 4c290e8e71..e41d567e9c 100644
--- a/opentyrian/patches/patch-src_cJSON.c
+++ b/opentyrian/patches/patch-src_cJSON.c
@@ -13,3 +13,13 @@ Fix isspace() usage on NetBSD (compiled with -Werror).
++str;
return str;
}
+@@ -316,7 +316,9 @@ static const char *parse_string(cJSON *i
+
+ switch (len) {
+ case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
++ /* FALLTHROUGH */
+ case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
++ /* FALLTHROUGH */
+ case 1: *--ptr2 =(uc | firstByteMark[len]);
+ }
+ ptr2+=len;ptr+=4;
diff --git a/opentyrian/patches/patch-src_destruct.c b/opentyrian/patches/patch-src_destruct.c
new file mode 100644
index 0000000000..877c2a2544
--- /dev/null
+++ b/opentyrian/patches/patch-src_destruct.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Add FALLTHROUGH for -Werror.
+
+--- src/destruct.c.orig 2013-09-07 22:14:32.000000000 +0000
++++ src/destruct.c
+@@ -1717,6 +1717,7 @@ static void DE_RunTickGravity( void )
+ break;
+ }
+ /* else fall through and treat as a normal unit */
++ /* FALLTHROUGH */
+
+ default:
+ DE_GravityLowerUnit(unit);
diff --git a/opentyrian/patches/patch-src_episodes.c b/opentyrian/patches/patch-src_episodes.c
new file mode 100644
index 0000000000..85586a67b5
--- /dev/null
+++ b/opentyrian/patches/patch-src_episodes.c
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Use snprintf instead of sprintf (work around errors when compiling with -Werror).
+
+--- src/episodes.c.orig 2013-09-07 22:14:32.000000000 +0000
++++ src/episodes.c
+@@ -258,9 +258,9 @@ void JE_initEpisode( JE_byte newEpisode
+
+ episodeNum = newEpisode;
+
+- sprintf(levelFile, "tyrian%d.lvl", episodeNum);
+- sprintf(cube_file, "cubetxt%d.dat", episodeNum);
+- sprintf(episode_file, "levels%d.dat", episodeNum);
++ snprintf(levelFile, sizeof(levelFile), "tyrian%d.lvl", episodeNum);
++ snprintf(cube_file, sizeof(cube_file), "cubetxt%d.dat", episodeNum);
++ snprintf(episode_file, sizeof(episode_file), "levels%d.dat", episodeNum);
+
+ JE_analyzeLevel();
+ JE_loadItemDat();
diff --git a/opentyrian/patches/patch-src_keyboard.c b/opentyrian/patches/patch-src_keyboard.c
new file mode 100644
index 0000000000..aa33abede9
--- /dev/null
+++ b/opentyrian/patches/patch-src_keyboard.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Add FALLTHROUGH for -Werror.
+
+--- src/keyboard.c.orig 2013-09-07 22:14:32.000000000 +0000
++++ src/keyboard.c
+@@ -214,6 +214,7 @@ void service_SDL_events( JE_boolean clea
+ break;
+ }
+ // intentional fall-though
++ /* FALLTHROUGH */
+ case SDL_MOUSEBUTTONUP:
+ if (ev.type == SDL_MOUSEBUTTONDOWN)
+ {
diff --git a/opentyrian/patches/patch-src_mainint.c b/opentyrian/patches/patch-src_mainint.c
index 909026ed0e..b3f6bcc85c 100644
--- a/opentyrian/patches/patch-src_mainint.c
+++ b/opentyrian/patches/patch-src_mainint.c
@@ -4,7 +4,23 @@ Ensure that ship_banking is initialized (compiled with -Werror).
--- src/mainint.c.orig 2013-09-07 22:14:33.000000000 +0000
+++ src/mainint.c
-@@ -3635,7 +3635,7 @@ redo:
+@@ -1627,6 +1627,7 @@ void JE_highScoreCheck( void )
+ case '"':
+ case '\'':
+ validkey = true;
++ /* FALLTHROUGH */
+ default:
+ if (temp < 28 && (validkey || (lastkey_char >= 'A' && lastkey_char <= 'Z') || (lastkey_char >= '0' && lastkey_char <= '9')))
+ {
+@@ -2458,6 +2459,7 @@ void JE_operation( JE_byte slot )
+ case '"':
+ case '\'':
+ validkey = true;
++ /* FALLTHROUGH */
+ default:
+ if (temp < 14 && (validkey || (lastkey_char >= 'A' && lastkey_char <= 'Z') || (lastkey_char >= '0' && lastkey_char <= '9')))
+ {
+@@ -3635,7 +3637,7 @@ redo:
blit_sprite2x2(VGAScreen, this_player->x - 17, this_player->y - 7, *shapes9ptr_, 220);
blit_sprite2x2(VGAScreen, this_player->x + 7, this_player->y - 7, *shapes9ptr_, 222);
diff --git a/opentyrian/patches/patch-src_network.c b/opentyrian/patches/patch-src_network.c
new file mode 100644
index 0000000000..b4e0e519f4
--- /dev/null
+++ b/opentyrian/patches/patch-src_network.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Add FALLTHROUGH for -Werror.
+
+--- src/network.c.orig 2013-09-07 22:14:33.000000000 +0000
++++ src/network.c
+@@ -284,6 +284,7 @@ int network_check( void )
+ packet_in[i] = NULL;
+ }
+ }
++ /* FALLTHROUGH */
+
+ case PACKET_DETAILS:
+ case PACKET_WAITING:
+@@ -305,6 +306,7 @@ int network_check( void )
+ }
+
+ network_acknowledge(SDLNet_Read16(&packet_temp->data[2]));
++ /* FALLTHROUGH */
+
+ case PACKET_KEEP_ALIVE:
+ last_in_tick = SDL_GetTicks();
diff --git a/opentyrian/patches/patch-src_tyrian2.c b/opentyrian/patches/patch-src_tyrian2.c
index ecce50f1b9..a75dc4c97d 100644
--- a/opentyrian/patches/patch-src_tyrian2.c
+++ b/opentyrian/patches/patch-src_tyrian2.c
@@ -1,9 +1,19 @@
$NetBSD: patch-src_tyrian2.c,v 1.1 2015/08/19 19:36:56 yhardy Exp $
+Use snprintf instead of sprintf (work around errors when compiling with -Werror).
Initialize variables (compiled with -Werror).
--- src/tyrian2.c.orig 2013-09-07 22:14:33.000000000 +0000
+++ src/tyrian2.c
+@@ -2090,7 +2090,7 @@ draw_player_shot_loop_end:
+ strcpy(tempStr, "");
+ for (temp = 0; temp < 9; temp++)
+ {
+- sprintf(tempStr, "%s%c", tempStr, smoothies[temp] + 48);
++ snprintf(tempStr, sizeof(tempStr), "%s%c", tempStr, smoothies[temp] + 48);
+ }
+ sprintf(buffer, "SM = %s", tempStr);
+ JE_outText(VGAScreen, 30, 70, buffer, 4, 0);
@@ -4325,8 +4325,8 @@ void JE_eventSystem( void )
case 19: /* Enemy Global Move */
Home |
Main Index |
Thread Index |
Old Index