From owner-svn-ports-all@freebsd.org Fri Mar 31 09:13:13 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE11D2616C; Fri, 31 Mar 2017 09:13:13 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E890789C; Fri, 31 Mar 2017 09:13:12 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V9DC0h065382; Fri, 31 Mar 2017 09:13:12 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V9DCbw065381; Fri, 31 Mar 2017 09:13:12 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201703310913.v2V9DCbw065381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Fri, 31 Mar 2017 09:13:12 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r437344 - head/games/cake X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 09:13:13 -0000 Author: danfe Date: Fri Mar 31 09:13:11 2017 New Revision: 437344 URL: https://svnweb.freebsd.org/changeset/ports/437344 Log: Make sure `games/cake' runs OK on amd64 (and possibly other 64-bit architectures): - Console::SetFontSize() method calls Console::Recalculate_NLines() which might access ConsoleLines[] array before it is constructed, Recalculate_NLines() is explicitly called after ConsoleLines[] is allocated and populated, so just comment out problematic call in SetFontSize(); it is called only once anyway (the problem did not exhibit itself on i386 for some reason); - The code assumes that sizeof(long) == 4 in too many places, e.g. in on-disk file format layouts and such. Fixing all structures would be too much trouble; instead, simply replace those long's with int's, [un]signed as appropriate. Modified: head/games/cake/Makefile Modified: head/games/cake/Makefile ============================================================================== --- head/games/cake/Makefile Fri Mar 31 09:11:09 2017 (r437343) +++ head/games/cake/Makefile Fri Mar 31 09:13:11 2017 (r437344) @@ -3,7 +3,7 @@ PORTNAME= cake PORTVERSION= 2005.12.26 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= games MASTER_SITES= http://freebsd.nsu.ru/distfiles/ DISTNAME= ${PORTNAME}_src_${PORTVERSION:S/.//g} @@ -39,6 +39,15 @@ post-patch: .SILENT ${WRKSRC}/cake/sound.h # Use traditional mapping for console key (tilde) ${REINPLACE_CMD} -e 's/167/96/' ${WRKSRC}/main.cpp +# Avoid segmentation fault on amd64 (uninitialized memory access) + ${REINPLACE_CMD} -e '1281s:Recalculate_NLines()://&:' \ + ${WRKSRC}/cake/console.cpp +# The code assumes that sizeof(long) == 4 in too many places :( + ${REINPLACE_CMD} -e '/typedef/s/ long//' ${WRKSRC}/cake/files.h + ${REINPLACE_CMD} -e '/typedef/s/long/int/' ${WRKSRC}/cake/types.h + ${REINPLACE_CMD} -e 's/unsigned long/DWORD/' ${WRKSRC}/cake/system.h + ${REINPLACE_CMD} -e 's/unsigned long/unsigned int/' \ + ${WRKSRC}/cake/zip/Crc32.h ${WRKSRC}/cake/zip/Unzip.h # Fixes for GCC 4.x and Clang 4.0 ${REINPLACE_CMD} -e 's/Mat3x2:://' ${WRKSRC}/cake/math.h ${REINPLACE_CMD} -e '2852s/numverts/&[0]/' ${WRKSRC}/cake/q3bsp.cpp