commit 3cc93c90d5f85aa440b4d66f5254f7686d62784a
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Thu Jul 28 16:27:37 2016 +0100
fix gcc6 compile issue
desmume.spec | 38 +++++++++++++++++++++++++-------------
gcc6_fixes.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 13 deletions(-)
---
diff --git a/desmume.spec b/desmume.spec
index cf468a9..2f929b6 100644
--- a/desmume.spec
+++ b/desmume.spec
@@ -1,6 +1,6 @@
Name: desmume
Version: 0.9.11
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A Nintendo DS emulator
License: GPLv2+
@@ -10,13 +10,16 @@ Source0:
http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch0: %{name}-0.9.11-dontlookinbuilddir.patch
# Use system tinyxml instead of the embedded copy
Patch1: %{name}-0.9.11-tinyxml.patch
+Patch2: gcc6_fixes.patch
BuildRequires: gtkglext-devel
BuildRequires: libglade2-devel
BuildRequires: openal-soft-devel
BuildRequires: compat-lua-devel
-BuildRequires: zziplib-devel
+BuildRequires: zziplib-devel
+%if 0%{?fedora} <= 24
BuildRequires: agg-devel
+%endif
BuildRequires: tinyxml-devel
# Not yet in Fedora
#BuildRequires: soundtouch-devel >= 1.5.0
@@ -53,6 +56,8 @@ This is the CLI version.
%setup -q
%patch0 -p1
%patch1 -p1
+sed -i 's/\r//' src/MMU_timing.h
+%patch2 -p1
# Remove bundled tinyxml
rm -rf src/utils/tinyxml
@@ -125,60 +130,67 @@ desktop-file-install \
%post
-touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+/usr/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :
%post glade
-touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+/usr/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
- touch --no-create %{_datadir}/icons/hicolor &>/dev/null
- gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+ /usr/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :
%postun glade
if [ $1 -eq 0 ] ; then
- touch --no-create %{_datadir}/icons/hicolor &>/dev/null
- gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+ /usr/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+ /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
-gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%posttrans glade
-gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
+%doc AUTHORS ChangeLog README README.LIN
+%license COPYING
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/32x32/apps/DeSmuME.xpm
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/%{name}.1*
-%doc AUTHORS ChangeLog COPYING README README.LIN
%files glade -f %{name}-glade.lang
+%doc AUTHORS ChangeLog README README.LIN
+%license COPYING
%{_bindir}/%{name}-glade
%{_datadir}/%{name}-glade
%{_datadir}/icons/hicolor/32x32/apps/DeSmuME-glade.xpm
%{_datadir}/applications/%{name}-glade.desktop
%{_mandir}/man1/%{name}-glade.1*
-%doc AUTHORS ChangeLog COPYING README README.LIN
%files cli
+%doc AUTHORS ChangeLog README README.LIN
+%license COPYING
%{_bindir}/%{name}-cli
%{_mandir}/man1/%{name}-cli.1*
-%doc AUTHORS ChangeLog COPYING README README.LIN
%changelog
+* Thu Jul 28 2016 Leigh Scott <leigh123linux(a)googlemail.com> - 0.9.11-2
+- fix gcc6 compile issue
+- quick spec file clean up
+
* Thu May 14 2015 Andrea Musuruane <musuruan(a)gmail.com> - 0.9.11-1
- Updated to upstream version 0.9.11
- Spec file cleanup
diff --git a/gcc6_fixes.patch b/gcc6_fixes.patch
new file mode 100644
index 0000000..c588374
--- /dev/null
+++ b/gcc6_fixes.patch
@@ -0,0 +1,46 @@
+--- 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;
+
+--- a/src/wifi.cpp
++++ b/src/wifi.cpp
+@@ -316,7 +316,7 @@
+ #if WIFI_LOG_USE_LOGC
+ #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, ...) {}
+