From d15a8bc890b6ca5284f7b781f396e0060d37f92f Mon Sep 17 00:00:00 2001 From: Erik Salter Date: Thu, 21 May 2026 12:49:14 -0400 Subject: [PATCH] Fix arm64 build against current toolchain --- Nestopia.xcodeproj/project.pbxproj | 10 ++++++++-- core/NstPpu.cpp | 22 +++++++++++----------- core/input/NstInpTurboFile.cpp | 6 +++--- core/input/NstInpZapper.cpp | 4 ++-- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Nestopia.xcodeproj/project.pbxproj b/Nestopia.xcodeproj/project.pbxproj index 2fc8af6..8ef77c7 100644 --- a/Nestopia.xcodeproj/project.pbxproj +++ b/Nestopia.xcodeproj/project.pbxproj @@ -2288,7 +2288,10 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.openemu.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = Nestopia; SKIP_INSTALL = YES; - WARNING_CFLAGS = "-Wno-switch-enum"; + WARNING_CFLAGS = ( + "-Wno-switch-enum", + "-Wno-c++11-narrowing", + ); WRAPPER_EXTENSION = oecoreplugin; }; name = Debug; @@ -2310,7 +2313,10 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.openemu.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = Nestopia; SKIP_INSTALL = YES; - WARNING_CFLAGS = "-Wno-switch-enum"; + WARNING_CFLAGS = ( + "-Wno-switch-enum", + "-Wno-c++11-narrowing", + ); WRAPPER_EXTENSION = oecoreplugin; }; name = Release; diff --git a/core/NstPpu.cpp b/core/NstPpu.cpp index 9fe3bee..7666992 100644 --- a/core/NstPpu.cpp +++ b/core/NstPpu.cpp @@ -312,17 +312,17 @@ namespace Nes { const byte data[11] = { - static_cast(regs.ctrl[0]), - static_cast(regs.ctrl[1]), - static_cast(regs.status), - static_cast(scroll.address & 0xFF), - static_cast(scroll.address >> 8), - static_cast(scroll.latch & 0xFF), - static_cast(scroll.latch >> 8), - static_cast(scroll.xFine | scroll.toggle << 3), - static_cast(regs.oam), - static_cast(io.buffer), - static_cast(io.latch) + byte( regs.ctrl[0] ), + byte( regs.ctrl[1] ), + byte( regs.status ), + byte( scroll.address & 0xFF ), + byte( scroll.address >> 8 ), + byte( scroll.latch & 0xFF ), + byte( scroll.latch >> 8 ), + byte( scroll.xFine | scroll.toggle << 3 ), + byte( regs.oam ), + byte( io.buffer ), + byte( io.latch ) }; state.Begin( AsciiId<'R','E','G'>::V ).Write( data ).End(); diff --git a/core/input/NstInpTurboFile.cpp b/core/input/NstInpTurboFile.cpp index 12f6ce2..0db2877 100644 --- a/core/input/NstInpTurboFile.cpp +++ b/core/input/NstInpTurboFile.cpp @@ -65,9 +65,9 @@ namespace Nes const byte data[3] = { - static_cast(pos & 0xFF), - static_cast(pos >> 8), - static_cast(count | (old << 1) | (out << 2)) + byte( pos & 0xFF ), + byte( pos >> 8 ), + byte( count | (old << 1) | (out << 2) ) }; saver.Begin( AsciiId<'R','E','G'>::V ).Write( data ).End(); diff --git a/core/input/NstInpZapper.cpp b/core/input/NstInpZapper.cpp index f7d189b..baf89dd 100644 --- a/core/input/NstInpZapper.cpp +++ b/core/input/NstInpZapper.cpp @@ -137,8 +137,8 @@ namespace Nes { const byte data[2] = { - static_cast(arcade ? shifter ? 0x1 : 0x3 : 0x0), - static_cast(arcade ? stream : 0x00) + byte( arcade ? shifter ? 0x1 : 0x3 : 0x0 ), + byte( arcade ? stream : 0x00 ) }; saver.Begin( AsciiId<'Z','P'>::R(0,0,id) ).Write( data ).End();