Skip to content

Commit

Permalink
[Nokia N-Gage] Remove redundant code after cleaning up the native Sym…
Browse files Browse the repository at this point in the history
…bian API, this fixes several compiler warnings.
  • Loading branch information
mupfdev committed Feb 8, 2025
1 parent f9f83e5 commit 228124c
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 46 deletions.
5 changes: 1 addition & 4 deletions src/SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions src/audio/ngage/SDL_ngageaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ TInt CAudio::ProcessThreadCB(TAny* aPtr)
{
if (device)
{
SDL_PrivateAudioData* phdata = (SDL_PrivateAudioData*)device->hidden;
SDL_PlaybackAudioThreadIterate(device);
}
else
Expand Down Expand Up @@ -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)
{
Expand Down
9 changes: 0 additions & 9 deletions src/core/ngage/SDL_ngage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
*/
#include "SDL_internal.h"

#ifdef NULL
#undef NULL
#endif

#include <e32std.h>
#include <e32svr.h>
#include <hal.h>
Expand All @@ -32,11 +28,6 @@
extern "C" {
#endif

void NGAGE_ExitApp(int exitcode)
{
User::Exit(exitcode);
}

bool NGAGE_IsClassicModel()
{
int phone_id;
Expand Down
4 changes: 0 additions & 4 deletions src/filesystem/ngage/SDL_sysfilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ extern "C" {
}
#endif

#ifdef NULL
#undef NULL
#endif

#include <e32base.h>
#include <e32std.h>
#include <f32file.h>
Expand Down
4 changes: 0 additions & 4 deletions src/locale/ngage/SDL_syslocale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include "SDL_internal.h"
#include "../SDL_syslocale.h"

#ifdef NULL
#undef NULL
#endif

#include <e32std.h>
#include <bautils.h>
#include <e32base.h>
Expand Down
4 changes: 0 additions & 4 deletions src/main/ngage/SDL_sysmain_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ extern "C" {
}
#endif

#ifdef NULL
#undef NULL
#endif

#include <e32std.h>
#include <estlib.h>
#include <stdlib.h>
Expand Down
20 changes: 20 additions & 0 deletions src/render/ngage/SDL_render_ngage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 0 additions & 6 deletions src/render/ngage/SDL_render_ngage_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/render/ngage/SDL_render_ngage_c.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CRenderer: public MDirectScreenAccess
{
public:
static CRenderer* NewL();
~CRenderer();
virtual ~CRenderer();

// Rendering functions.
void Clear(TUint32 iColor);
Expand Down
1 change: 1 addition & 0 deletions src/render/ngage/SDL_render_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions src/time/ngage/SDL_systime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
*/
#include "SDL_internal.h"

#ifdef NULL
#undef NULL
#endif

#include <bautils.h>
#include <e32base.h>
#include <e32cons.h>
Expand Down
4 changes: 0 additions & 4 deletions src/timer/ngage/SDL_systimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
*/
#include "SDL_internal.h"

#ifdef NULL
#undef NULL
#endif

#include <e32std.h>
#include <e32hal.h>

Expand Down
4 changes: 0 additions & 4 deletions src/video/ngage/SDL_ngagevideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
#ifndef _SDL_ngagevideo_h
#define _SDL_ngagevideo_h

#ifdef NULL
#undef NULL
#endif

typedef struct SDL_VideoData
{
SDL_DisplayMode mode;
Expand Down

0 comments on commit 228124c

Please sign in to comment.