libretro / beetle-ngp-libretro

Standalone port of Mednafen NGP to the libretro API, itself a fork of Neopop.
GNU General Public License v2.0
11 stars 44 forks source link

Fix clang build with casts. #65

Closed orbea closed 5 years ago

orbea commented 5 years ago

Fixes the build with clang-8.0.0 by using static casts as suggested by the compiler.

Same issue and solution as PR https://github.com/libretro/blueMSX-libretro/pull/94.

Updating the core with changes from upstream mednafen would probably also help, but that is a more involved process than I feel confident in doing. It can always be done later after a quick fix.

orbea commented 5 years ago

travis failure is unrelated.

inactive123 commented 5 years ago

I don't think it's a good idea to get further into C++ here, if anything ,the core should become more completely C-based.

orbea commented 5 years ago

@twinaphex That is beyond the scope of this PR, this is a c++ file already and if someone wants to change that then that should be done in a followup PR.

ghost commented 5 years ago

Would clang accept plain typecast?

{ &(gfx->S1SO_H), static_cast<uint32_t>(SF_IS_BOOL(&(gfx->S1SO_H)) ? 1 : sizeof(gfx->S1SO_H)), 0x80000000 | (SF_IS_BOOL(&(gfx->S1SO_H)) ? 0x08000000 : 0), "S1SO_H" },

-->

{ &(gfx->S1SO_H), (uint32_t)(SF_IS_BOOL(&(gfx->S1SO_H)) ? 1 : sizeof(gfx->S1SO_H)), 0x80000000 | (SF_IS_BOOL(&(gfx->S1SO_H)) ? 0x08000000 : 0), "S1SO_H" },
orbea commented 5 years ago

Yes, I updated the PR.