commit:     9bf0d9a9e6c1c4f4d56b731b77dabc728f0889c8
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Sat Sep 18 23:48:09 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 19 00:38:17 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bf0d9a9

games-emulation/desmume: fix build with clang

Closes: https://bugs.gentoo.org/739144
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/22331
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../desmume/desmume-0.9.11_p20210409-r1.ebuild            |  1 +
 .../desmume/files/desmume-0.9.11_p20210409-clang.patch    | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/games-emulation/desmume/desmume-0.9.11_p20210409-r1.ebuild 
b/games-emulation/desmume/desmume-0.9.11_p20210409-r1.ebuild
index c3a84760618..9cc9dd36624 100644
--- a/games-emulation/desmume/desmume-0.9.11_p20210409-r1.ebuild
+++ b/games-emulation/desmume/desmume-0.9.11_p20210409-r1.ebuild
@@ -36,6 +36,7 @@ DEPEND="
 PATCHES=(
        "${FILESDIR}"/${P}-fix-gtk-cliopts.patch
        "${FILESDIR}"/${P}-openal-automagic.patch
+       "${FILESDIR}"/${P}-clang.patch
 )
 
 DOCS=( ${PN}/{AUTHORS,ChangeLog,README,README.LIN,doc/.} )

diff --git a/games-emulation/desmume/files/desmume-0.9.11_p20210409-clang.patch 
b/games-emulation/desmume/files/desmume-0.9.11_p20210409-clang.patch
new file mode 100644
index 00000000000..e80cebced38
--- /dev/null
+++ b/games-emulation/desmume/files/desmume-0.9.11_p20210409-clang.patch
@@ -0,0 +1,15 @@
+Fix build with clang https://bugs.gentoo.org/739144
+
+--- a/desmume/src/texcache.cpp
++++ b/desmume/src/texcache.cpp
+@@ -1165,8 +1165,8 @@ void NDSTextureUnpack4x4(const size_t sr
+       
+       for (size_t y = 0, d = 0; y < yTmpSize; y++)
+       {
+-              u32 tmpPos[4]={(y<<2)*sizeX,((y<<2)+1)*sizeX,
+-                      ((y<<2)+2)*sizeX,((y<<2)+3)*sizeX};
++              u32 tmpPos[4]={u32(y<<2)*sizeX,u32((y<<2)+1)*sizeX,
++                      u32((y<<2)+2)*sizeX,u32((y<<2)+3)*sizeX};
+               for (size_t x = 0; x < xTmpSize; x++, d++)
+               {
+                       if (d >= limit)

Reply via email to