From 228124c666546f259be4a1ddcdf8d6439429d66d Mon Sep 17 00:00:00 2001 From: Michael Fitzmayer Date: Thu, 6 Feb 2025 20:53:38 +0100 Subject: [PATCH] [Nokia N-Gage] Remove redundant code after cleaning up the native Symbian API, this fixes several compiler warnings. --- src/SDL.c | 5 +---- src/audio/ngage/SDL_ngageaudio.cpp | 4 ++-- src/core/ngage/SDL_ngage.cpp | 9 --------- src/filesystem/ngage/SDL_sysfilesystem.cpp | 4 ---- src/locale/ngage/SDL_syslocale.cpp | 4 ---- src/main/ngage/SDL_sysmain_main.cpp | 4 ---- src/render/ngage/SDL_render_ngage.c | 20 ++++++++++++++++++++ src/render/ngage/SDL_render_ngage_c.h | 6 ------ src/render/ngage/SDL_render_ngage_c.hpp | 2 +- src/render/ngage/SDL_render_ops.cpp | 1 + src/time/ngage/SDL_systime.cpp | 4 ---- src/timer/ngage/SDL_systimer.cpp | 4 ---- src/video/ngage/SDL_ngagevideo.h | 4 ---- 13 files changed, 25 insertions(+), 46 deletions(-) diff --git a/src/SDL.c b/src/SDL.c index e2aa659b621005..7727300833c16d 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -93,10 +93,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_MICRO_VERSION_max, SDL_MICRO_VERSION <= 999); extern SDL_NORETURN void SDL_ExitProcess(int exitcode); SDL_NORETURN void SDL_ExitProcess(int exitcode) { -#if defined(SDL_PLATFORM_NGAGE) - extern void NGAGE_ExitApp(int exitcode); - NGAGE_ExitApp(exitcode); -#elif defined(SDL_PLATFORM_WINDOWS) +#if defined(SDL_PLATFORM_WINDOWS) /* "if you do not know the state of all threads in your process, it is better to call TerminateProcess than ExitProcess" https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */ diff --git a/src/audio/ngage/SDL_ngageaudio.cpp b/src/audio/ngage/SDL_ngageaudio.cpp index 0a749a5c1a45b1..f0a0385ff2b364 100644 --- a/src/audio/ngage/SDL_ngageaudio.cpp +++ b/src/audio/ngage/SDL_ngageaudio.cpp @@ -242,7 +242,6 @@ TInt CAudio::ProcessThreadCB(TAny* aPtr) { if (device) { - SDL_PrivateAudioData* phdata = (SDL_PrivateAudioData*)device->hidden; SDL_PlaybackAudioThreadIterate(device); } else @@ -355,7 +354,8 @@ TInt AudioThreadCB(TAny* aParams) while (gAudioRunning) { // Allow active scheduler to process any events. - CActiveScheduler::RunIfReady(0, CActive::EPriorityIdle); + TInt error; + CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle); if (!once) { diff --git a/src/core/ngage/SDL_ngage.cpp b/src/core/ngage/SDL_ngage.cpp index d2a9e05a82290d..4e541b4b1ce0e0 100644 --- a/src/core/ngage/SDL_ngage.cpp +++ b/src/core/ngage/SDL_ngage.cpp @@ -20,10 +20,6 @@ */ #include "SDL_internal.h" -#ifdef NULL -#undef NULL -#endif - #include #include #include @@ -32,11 +28,6 @@ extern "C" { #endif -void NGAGE_ExitApp(int exitcode) -{ - User::Exit(exitcode); -} - bool NGAGE_IsClassicModel() { int phone_id; diff --git a/src/filesystem/ngage/SDL_sysfilesystem.cpp b/src/filesystem/ngage/SDL_sysfilesystem.cpp index 0790dfc1c32572..311c22f7a9bb6e 100644 --- a/src/filesystem/ngage/SDL_sysfilesystem.cpp +++ b/src/filesystem/ngage/SDL_sysfilesystem.cpp @@ -28,10 +28,6 @@ extern "C" { } #endif -#ifdef NULL -#undef NULL -#endif - #include #include #include diff --git a/src/locale/ngage/SDL_syslocale.cpp b/src/locale/ngage/SDL_syslocale.cpp index 3dd7ed62281555..d88a27aedbe925 100644 --- a/src/locale/ngage/SDL_syslocale.cpp +++ b/src/locale/ngage/SDL_syslocale.cpp @@ -21,10 +21,6 @@ #include "SDL_internal.h" #include "../SDL_syslocale.h" -#ifdef NULL -#undef NULL -#endif - #include #include #include diff --git a/src/main/ngage/SDL_sysmain_main.cpp b/src/main/ngage/SDL_sysmain_main.cpp index 9b4ed63f1a4436..817f2ccea03318 100644 --- a/src/main/ngage/SDL_sysmain_main.cpp +++ b/src/main/ngage/SDL_sysmain_main.cpp @@ -28,10 +28,6 @@ extern "C" { } #endif -#ifdef NULL -#undef NULL -#endif - #include #include #include diff --git a/src/render/ngage/SDL_render_ngage.c b/src/render/ngage/SDL_render_ngage.c index 3507fd99f04e3c..14ea700f0d89b4 100644 --- a/src/render/ngage/SDL_render_ngage.c +++ b/src/render/ngage/SDL_render_ngage.c @@ -22,6 +22,26 @@ #ifdef SDL_VIDEO_RENDER_NGAGE +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#ifndef Int2Fix +#define Int2Fix(i) ((i)<<16) +#endif + +#ifndef Fix2Int +#define Fix2Int(i) ((((unsigned int)(i)>0xFFFF0000)?0:((i)>>16))) +#endif + +#ifndef Fix2Real +#define Fix2Real(i) ((i)/65536.0) +#endif + +#ifndef Real2Fix +#define Real2Fix(i) ((int)((i)*65536.0)) +#endif + #include "SDL_render_ngage_c.h" #include "../SDL_sysrender.h" diff --git a/src/render/ngage/SDL_render_ngage_c.h b/src/render/ngage/SDL_render_ngage_c.h index f4cf612ff19be8..8093a06f53d9ec 100644 --- a/src/render/ngage/SDL_render_ngage_c.h +++ b/src/render/ngage/SDL_render_ngage_c.h @@ -31,12 +31,6 @@ extern "C" { #include "../SDL_sysrender.h" -#define M_PI 3.14159265358979323846 -#define Int2Fix(i) ((i)<<16) -#define Fix2Int(i) ((((unsigned int)(i)>0xFFFF0000)?0:((i)>>16))) -#define Fix2Real(i) ((i)/65536.0) -#define Real2Fix(i) ((int)((i)*65536.0)) - typedef struct NGAGE_RendererData { SDL_Rect* viewport; diff --git a/src/render/ngage/SDL_render_ngage_c.hpp b/src/render/ngage/SDL_render_ngage_c.hpp index a36b6aa9f25c70..f0c2537e685511 100644 --- a/src/render/ngage/SDL_render_ngage_c.hpp +++ b/src/render/ngage/SDL_render_ngage_c.hpp @@ -31,7 +31,7 @@ class CRenderer: public MDirectScreenAccess { public: static CRenderer* NewL(); - ~CRenderer(); + virtual ~CRenderer(); // Rendering functions. void Clear(TUint32 iColor); diff --git a/src/render/ngage/SDL_render_ops.cpp b/src/render/ngage/SDL_render_ops.cpp index 95342681b6cf68..4632bddcd07291 100644 --- a/src/render/ngage/SDL_render_ops.cpp +++ b/src/render/ngage/SDL_render_ops.cpp @@ -20,6 +20,7 @@ */ #include "SDL_internal.h" +#include <3dtypes.h> #include "SDL_render_ops.hpp" void ApplyColorMod(void *dest, void *source, int pitch, int width, int height, SDL_FColor color) diff --git a/src/time/ngage/SDL_systime.cpp b/src/time/ngage/SDL_systime.cpp index e35f7f40982fec..5d8eaa4fe08476 100644 --- a/src/time/ngage/SDL_systime.cpp +++ b/src/time/ngage/SDL_systime.cpp @@ -20,10 +20,6 @@ */ #include "SDL_internal.h" -#ifdef NULL -#undef NULL -#endif - #include #include #include diff --git a/src/timer/ngage/SDL_systimer.cpp b/src/timer/ngage/SDL_systimer.cpp index 52276d9d1b4a85..07b257e8eee693 100644 --- a/src/timer/ngage/SDL_systimer.cpp +++ b/src/timer/ngage/SDL_systimer.cpp @@ -20,10 +20,6 @@ */ #include "SDL_internal.h" -#ifdef NULL -#undef NULL -#endif - #include #include diff --git a/src/video/ngage/SDL_ngagevideo.h b/src/video/ngage/SDL_ngagevideo.h index 3c44cc02aac0ac..3153d6be80e089 100644 --- a/src/video/ngage/SDL_ngagevideo.h +++ b/src/video/ngage/SDL_ngagevideo.h @@ -27,10 +27,6 @@ #ifndef _SDL_ngagevideo_h #define _SDL_ngagevideo_h -#ifdef NULL -#undef NULL -#endif - typedef struct SDL_VideoData { SDL_DisplayMode mode;