dungeon-crawl: fix narrowing conversion error on archs where char is

unsigned by default (ppc, arm). Tested on macppc where it fixes the
build with gcc-8.

OK phessler@
This commit is contained in:
cwen 2019-04-16 16:09:45 +00:00
parent 305d688b62
commit 00fc6f6d38
3 changed files with 45 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.12 2018/11/25 21:06:38 naddy Exp $
# $OpenBSD: Makefile,v 1.13 2019/04/16 16:09:45 cwen Exp $
COMMENT= dungeon crawl
CATEGORIES= games
@ -9,7 +9,7 @@ DISTNAME= dc400b26-src
EXTRACT_SUFX= .tbz2
V= 4.0.0b26
PKGNAME= dungeon-crawl-$V
REVISION = 4
REVISION = 5
BUILD_DEPENDS+= archivers/bzip2

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-source_direct_cc,v 1.1 2019/04/16 16:09:45 cwen Exp $
ppc, arm: fix the build where char is unsigned by default
Index: source/direct.cc
--- source/direct.cc.orig
+++ source/direct.cc
@@ -44,8 +44,8 @@
// x and y offsets in the following order:
// SW, S, SE, W, E, NW, N, NE
-static const char xcomp[9] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
-static const char ycomp[9] = { 1, 1, 1, 0, 0, 0, -1, -1, -1 };
+static const signed char xcomp[9] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
+static const signed char ycomp[9] = { 1, 1, 1, 0, 0, 0, -1, -1, -1 };
static const char dirchars[19] = { "b1j2n3h4.5l6y7k8u9" };
static const char DOSidiocy[10] = { "OPQKSMGHI" };
static const char *aim_prompt = "Aim (move cursor or -/+/=, change mode with CTRL-F, select with . or >)";

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-source_mon-util_h,v 1.1 2019/04/16 16:09:45 cwen Exp $
ppc, arm: fix build where char is unsigned by default
Index: source/mon-util.h
--- source/mon-util.h.orig
+++ source/mon-util.h
@@ -115,7 +115,7 @@ struct monsterentry
unsigned short charclass PACKED; //
- char holiness PACKED; // -1=holy,0=normal,1=undead,2=very very evil
+ signed char holiness PACKED; // -1=holy,0=normal,1=undead,2=very very evil
short resist_magic PACKED; // (positive is ??)
// max damage in a turn is total of these four?
@@ -144,7 +144,7 @@ struct monsterentry
// 0=no zombie, 1=small zombie (z) 107, 2=_BIG_ zombie (Z) 108
char zombie_size PACKED;
// 0-12: see above, -1=random one of (0-7)
- char shouts PACKED;
+ signed char shouts PACKED;
// AI things?
char intel PACKED; // 0=none, 1=worst...4=best