From e89db5b44930c598e8fae6bfeac8a236995baeda Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 2 Mar 2018 13:17:12 -0500 Subject: [PATCH] Fix for pointer/int comparison --- games-emulation/desmume/Manifest | 6 +++ .../desmume/desmume-0.9.11-r1.ebuild | 35 ++++++++++++++ ...0.9.11-fix-pointer-conversion-warning.diff | 11 +++++ .../desmume/files/desmume-0.9.11-gcc6.patch | 47 +++++++++++++++++++ ...me-0.9.11-pointer-int-comparison-fix.patch | 12 +++++ games-emulation/desmume/metadata.xml | 14 ++++++ 6 files changed, 125 insertions(+) create mode 100644 games-emulation/desmume/Manifest create mode 100644 games-emulation/desmume/desmume-0.9.11-r1.ebuild create mode 100644 games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff create mode 100644 games-emulation/desmume/files/desmume-0.9.11-gcc6.patch create mode 100644 games-emulation/desmume/files/desmume-0.9.11-pointer-int-comparison-fix.patch create mode 100644 games-emulation/desmume/metadata.xml diff --git a/games-emulation/desmume/Manifest b/games-emulation/desmume/Manifest new file mode 100644 index 0000000..1c03d02 --- /dev/null +++ b/games-emulation/desmume/Manifest @@ -0,0 +1,6 @@ +AUX desmume-0.9.11-fix-pointer-conversion-warning.diff 370 BLAKE2B 8e019cf69a13b3669166f1ee04d26e6538a392e494d356b2eeabd43ac69fe9489ddeda146054ab5d1f821b3a52719d58ae493ca870f46461eacaab26ffb9eba1 SHA512 f7d5f4ac4d96f244aa6ee81a90f64e754aceebf075f1c4ff84dde2d1d2beaf617631569c5aa9a8afb40ae4499067e2233ba00a4b9d606a9608915714766d0bff +AUX desmume-0.9.11-gcc6.patch 1991 BLAKE2B ffb0a58f7317aa50fe17c4abe1ba6c9bbf9cb937736479214b86187c32af8c1659aa719eccce184a5f0fa1b31f15634276fb676bf97ec64feba603fa89ee289f SHA512 e9249a613f1bf3b6d72dcce47cbc39daeadb1b4f7b9be2748b537ec3389a61f46b5f15f5a10d55bc4b1dbd69dd87526b5ce79e58b539cf432679da9bc803e0cd +AUX desmume-0.9.11-pointer-int-comparison-fix.patch 455 BLAKE2B 81a55e333c031d7c28c067455c47477b961c8ab7fa5e5f037b9b967bd8d2324903da136978f3ff9bd60cdc2953cb9f06a5797be8c0db2598fdd5a1248c9c54d9 SHA512 c0db6f17841cc2a9c4b7547a0087124f6489681436156ce8a20e212fb949ffb049119a1d5c3b01006163f16916351925b746fa7378657b8599e299ed0465a6f9 +DIST desmume-0.9.11.tar.gz 5359305 BLAKE2B 31764dcb2d0facf32eddd5c66f40e2268f8afd5c2562bf246b93bb60c191d7888587991732014dee11417016515a4367bda9acf79f699703754aa904dcaeeb01 SHA512 160cb6ec0ede04ad1fbddde2b7b04aa41fa464c8338d7eb9d7536196a82d8d716889b40be4fb831a22e3fe8532b947f7f0b41311601b6842be2516dff7cae46c +EBUILD desmume-0.9.11-r1.ebuild 807 BLAKE2B 9b12e16127ccd22cd8a38d67b2d03d222740075c59210c850dad549bc84948438642060b15d6dc7f3290dc4c5cf6f686a91addd9b24c769c1bb48b90e1b9537e SHA512 51cf26731c490043971166dac9cb662dfbb1730b6a6a2675ea03a4bc58db54c5c47b881a413875ebea17f0b85723e8aa1835431f689d2c85c169baedbc9db9c3 +MISC metadata.xml 407 BLAKE2B a64ba166734f13f34fec0ca394d4d51bc70f2cb9539981e068e544f3139584ee3ec2da89a02ef9203008cb73213213adb148c978311ae36d95749e553d10605b SHA512 89d3a5b608525bfa1f05503017619520d82c663241668c3d5fa5602e625cbfe02564b04d7bac0e97bbe53ff8eba08a6895fb0e8cd519d0d88efd29a0ca64ac4b diff --git a/games-emulation/desmume/desmume-0.9.11-r1.ebuild b/games-emulation/desmume/desmume-0.9.11-r1.ebuild new file mode 100644 index 0000000..7713a29 --- /dev/null +++ b/games-emulation/desmume/desmume-0.9.11-r1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="Nintendo DS emulator" +HOMEPAGE="http://desmume.org/" +SRC_URI="mirror://sourceforge/desmume/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND=">=x11-libs/gtk+-2.8.0:2 + gnome-base/libglade + x11-libs/gtkglext + virtual/opengl + sys-libs/zlib + dev-libs/zziplib + media-libs/libsdl[joystick,opengl,video] + x11-libs/agg" +DEPEND="${RDEPEND} + virtual/pkgconfig + dev-util/intltool" + +DOCS=( AUTHORS ChangeLog README README.LIN ) + +# fix QA compiler warning, see +# https://sourceforge.net/p/desmume/patches/172/ +PATCHES=( + "${FILESDIR}/${P}-fix-pointer-conversion-warning.diff" + "${FILESDIR}/${P}-gcc6.patch" + "${FILESDIR}/${P}-pointer-int-comparison-fix.patch" +) diff --git a/games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff b/games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff new file mode 100644 index 0000000..8975085 --- /dev/null +++ b/games-emulation/desmume/files/desmume-0.9.11-fix-pointer-conversion-warning.diff @@ -0,0 +1,11 @@ +--- a/src/path.h 2015-02-14 16:05:26.000000000 +0100 ++++ b/src/path.h 2016-07-11 12:09:59.591987169 +0200 +@@ -375,7 +375,7 @@ + else if (strchr(strftimeArgs, *p)) + { + char tmp[MAX_PATH]; +- char format[] = { '%', *p, NULL }; ++ char format[] = { '%', *p, '\0' }; + strftime(tmp, MAX_PATH, format, time_struct); + file.append(tmp); + } diff --git a/games-emulation/desmume/files/desmume-0.9.11-gcc6.patch b/games-emulation/desmume/files/desmume-0.9.11-gcc6.patch new file mode 100644 index 0000000..761ccef --- /dev/null +++ b/games-emulation/desmume/files/desmume-0.9.11-gcc6.patch @@ -0,0 +1,47 @@ +--- a/src/wifi.cpp ++++ b/src/wifi.cpp +@@ -314,9 +314,9 @@ + + #if (WIFI_LOGGING_LEVEL >= 1) + #if WIFI_LOG_USE_LOGC +- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__); ++ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__); + #else +- #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__); ++ #define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__); + #endif + #else + #define WIFI_LOG(level, ...) {} +--- a/src/MMU_timing.h ++++ b/src/MMU_timing.h +@@ -155,8 +155,8 @@ + enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT }; + enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT }; + enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT }; +- enum { TAGMASK = (u32)(~0 << TAGSHIFT) }; +- enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) }; ++ enum { TAGMASK = (u32)(~0U << TAGSHIFT) }; ++ enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) }; + enum { WORDSIZE = sizeof(u32) }; + enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE }; + enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY }; +--- a/src/ctrlssdl.cpp ++++ b/src/ctrlssdl.cpp +@@ -200,7 +200,7 @@ + break; + case SDL_JOYAXISMOTION: + /* Dead zone of 50% */ +- if( (abs(event.jaxis.value) >> 14) != 0 ) ++ if( ((u32)abs(event.jaxis.value) >> 14) != 0 ) + { + key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1); + if (event.jaxis.value > 0) { +@@ -370,7 +370,7 @@ + Note: button constants have a 1bit offset. */ + case SDL_JOYAXISMOTION: + key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1); +- if( (abs(event->jaxis.value) >> 14) != 0 ) ++ if( ((u32)abs(event->jaxis.value) >> 14) != 0 ) + { + if (event->jaxis.value > 0) + key_code |= 1; diff --git a/games-emulation/desmume/files/desmume-0.9.11-pointer-int-comparison-fix.patch b/games-emulation/desmume/files/desmume-0.9.11-pointer-int-comparison-fix.patch new file mode 100644 index 0000000..e09a1a5 --- /dev/null +++ b/games-emulation/desmume/files/desmume-0.9.11-pointer-int-comparison-fix.patch @@ -0,0 +1,12 @@ +diff -Naur a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp +--- a/src/utils/libfat/directory.cpp 2015-02-14 10:05:26.000000000 -0500 ++++ b/src/utils/libfat/directory.cpp 2018-03-02 13:15:20.349936425 -0500 +@@ -139,7 +139,7 @@ + int bytes; + size_t count = 0; + +- while (count < len-1 && src != '\0') { ++ while (count < len-1 && src) { + bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps); + if (bytes > 0) { + *dst = (ucs2_t)tempChar; diff --git a/games-emulation/desmume/metadata.xml b/games-emulation/desmume/metadata.xml new file mode 100644 index 0000000..d906b04 --- /dev/null +++ b/games-emulation/desmume/metadata.xml @@ -0,0 +1,14 @@ + + + + + hanno@gentoo.org + + + games@gentoo.org + Gentoo Games Project + + + desmume + +