pkgsrc-WIP-changes archive

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

doomlegacy: Use limits.h for CHAR/SHORT/INT MAX/MIN



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <michael.baeuerle%stz-e.de@localhost>
Pushed By:	micha
Date:		Thu Jun 13 17:36:47 2019 +0200
Changeset:	248aa4ea8d2c1043b41b39431d1a40c86c8a4ee5

Modified Files:
	doomlegacy/Makefile
	doomlegacy/distinfo
	doomlegacy/patches/patch-src_doomtype.h

Log Message:
doomlegacy: Use limits.h for CHAR/SHORT/INT MAX/MIN

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=248aa4ea8d2c1043b41b39431d1a40c86c8a4ee5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 doomlegacy/Makefile                     | 10 +++----
 doomlegacy/distinfo                     |  2 +-
 doomlegacy/patches/patch-src_doomtype.h | 52 +++++++++++++++++++++++++++++----
 3 files changed, 53 insertions(+), 11 deletions(-)

diffs:
diff --git a/doomlegacy/Makefile b/doomlegacy/Makefile
index 160f97b095..cbb5bcc152 100644
--- a/doomlegacy/Makefile
+++ b/doomlegacy/Makefile
@@ -8,22 +8,22 @@ DISTNAME=		${PKGNAME:S/-/_/}_source
 DISTFILES=		${DEFAULT_DISTFILES} doomlegacy_${VERS}_common.zip
 EXTRACT_SUFX=		.tar.bz2
 
-
 MAINTAINER=		micha%NetBSD.org@localhost
 HOMEPAGE=		http://doomlegacy.sourceforge.net/
 COMMENT=		The legacy of Doom
 LICENSE=		gnu-gpl-v2
 
-# Tested on GNU/Linux and NetBSD
+# Tested to work on Linux/ppc (Big Endian) and NetBSD/amd64 (Little Endian)
 # Source has support for the other listed OS too (may need additional work)
 ONLY_FOR_PLATFORM=	Darwin-*-* DragonFly-*-* FreeBSD-*-* Linux-*-* \
 			NetBSD-*-* OpenBSD-*-* SunOS-*-*
 
+USE_TOOLS+=		gmake
 MAKE_JOBS_SAFE=		no
 
 .include "../../mk/bsd.prefs.mk"
+.include "../../mk/endian.mk"
 
-USE_TOOLS+=		gmake
 .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
 MAKE_FLAGS+=		OS=FREEBSD
 .elif ${OPSYS} == "NetBSD"
@@ -36,11 +36,10 @@ MAKE_FLAGS+=		OS=LINUX
 .endif
 MAKE_FLAGS+=		HAVE_MIXER=1 DEBUG=0
 
-.include "../../mk/endian.mk"
-
 .if ${MACHINE_ENDIAN} == "big"
 CFLAGS+=		-D__BIG_ENDIAN__
 .endif
+CFLAGS+=		-Wno-char-subscripts
 
 # DOOMWADDIR is intentionally shared with other Doom packages
 DOOMWADDIR?=		share/doom
@@ -60,6 +59,7 @@ do-install:
 		${INSTALL_DATA} legacy.wad				\
 			${DESTDIR}${PREFIX}/${DOOMWADDIR}/legacy.wad
 
+# Ensure that at least the shareware Episode 1 of Doom is available
 DEPENDS+=		doom1-[0-9]*:../../games/doom1
 
 BUILDLINK_API_DEPENDS.SDL_mixer+=	SDL_mixer>=1.2.7
diff --git a/doomlegacy/distinfo b/doomlegacy/distinfo
index 70a14563fa..c44c71763a 100644
--- a/doomlegacy/distinfo
+++ b/doomlegacy/distinfo
@@ -10,6 +10,6 @@ SHA512 (doomlegacy_1.47.2_source.tar.bz2) = e2e182c18dd24c14e954f791c58e44119457
 Size (doomlegacy_1.47.2_source.tar.bz2) = 2276199 bytes
 SHA1 (patch-Makefile) = a1aea57169fc1325182dcc2afeeaa953353f2823
 SHA1 (patch-src_Makefile) = 37375b1728cd13ec55ce48b333e6817d0d974c88
-SHA1 (patch-src_doomtype.h) = 09d0942116ce512d9cd46e5b6f1d4fc3f9e97420
+SHA1 (patch-src_doomtype.h) = fefe08ca5fbe8d11325e32ca833a73d3acb36ea1
 SHA1 (patch-src_i__tcp.c) = 1c0c6017d24640217e29ed238e210850329d0e75
 SHA1 (patch-src_sdl_i__system.c) = 17524680559b81ae755d781f63f3c5d34e1f14b6
diff --git a/doomlegacy/patches/patch-src_doomtype.h b/doomlegacy/patches/patch-src_doomtype.h
index 823567fc86..bac103e887 100644
--- a/doomlegacy/patches/patch-src_doomtype.h
+++ b/doomlegacy/patches/patch-src_doomtype.h
@@ -1,16 +1,16 @@
 $NetBSD$
 
-Use limits.h for NetBSD too.
+Always use limits.h for pkgsrc.
 
 --- src/doomtype.h.orig	2018-07-16 09:17:06.000000000 +0000
 +++ src/doomtype.h
-@@ -165,17 +165,8 @@ int strlwr(char *n);
+@@ -165,53 +165,37 @@ int strlwr(char *n);
  #endif
  
  
 -// Predefined with some OS.
 -#ifdef __WIN32__
-+// For pkgsrc: All POSIX comformant OS should have limits.h
++// For pkgsrc: Only POSIX conformant OS are supported
  #include <limits.h>
 -#elif defined( MACOS_DI ) || defined( __MACH__ ) || defined( FREEBSD )
 -#include <limits.h>
@@ -21,5 +21,47 @@ Use limits.h for NetBSD too.
 -//#include <limits.h>
 -#endif
  
- // [WDJ] This is very dangerous considering 32 bit and 64 bit systems,
- // should use stdint.h values instead.
+-// [WDJ] This is very dangerous considering 32 bit and 64 bit systems,
+-// should use stdint.h values instead.
+-// These are obsolete defines from values.h.
+ #ifndef MAXCHAR
+ // unused
+-#define MAXCHAR   ((char)0x7f)
++#define MAXCHAR   CHAR_MAX
+ #endif
+ 
+ #ifndef MAXSHORT
+-// defined in values.h
+ // used in r_segs.c
+-#define MAXSHORT  ((short)0x7fff)
++#define MAXSHORT  SHRT_MAX
+ #endif
+ 
+ #ifndef MAXINT
+-// defined in values.h
+ // used in many places
+-#define MAXINT    ((int)0x7fffffff)
++#define MAXINT    INT_MAX
+ #endif
+ 
+ #ifndef MINCHAR
+ // unused
+-#define MINCHAR   ((char)0x80)
++#define MINCHAR   CHAR_MIN
+ #endif
+ 
+ #ifndef MINSHORT
+-// defined in values.h
+ // unused
+-#define MINSHORT  ((short)0x8000)
++#define MINSHORT  SHRT_MIN
+ #endif
+ 
+ #ifndef MININT
+-// defined in values.h
+ // used in many places
+-#define MININT    ((int)0x80000000)
++#define MININT    INT_MIN
+ #endif
+ 
+ // Sound effect id type.


Home | Main Index | Thread Index | Old Index