From 1d47bb70501d630ac8eebfdfe276599c17a4a99f Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Fri, 26 Apr 2019 17:34:41 +0100 Subject: [PATCH] riscos: Fix warnings --- src/joystick/riscos/SDL_sysjoystick.c | 4 ---- src/video/riscos/SDL_riscosFullScreenVideo.c | 12 ++++++------ src/video/riscos/SDL_wimpvideo.c | 11 ++++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/joystick/riscos/SDL_sysjoystick.c b/src/joystick/riscos/SDL_sysjoystick.c index 934714fc6..db39ce49d 100644 --- a/src/joystick/riscos/SDL_sysjoystick.c +++ b/src/joystick/riscos/SDL_sysjoystick.c @@ -89,13 +89,9 @@ const char *SDL_SYS_JoystickName(int index) */ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) { - _kernel_swi_regs regs; - if(!(joystick->hwdata=SDL_malloc(sizeof(struct joystick_hwdata)))) return -1; - regs.r[0] = joystick->index; - /* Don't know how to get exact count of buttons so assume max of 4 for now */ joystick->nbuttons=4; diff --git a/src/video/riscos/SDL_riscosFullScreenVideo.c b/src/video/riscos/SDL_riscosFullScreenVideo.c index ff7c103d9..85b97454d 100644 --- a/src/video/riscos/SDL_riscosFullScreenVideo.c +++ b/src/video/riscos/SDL_riscosFullScreenVideo.c @@ -311,7 +311,7 @@ void FULLSCREEN_BuildModeList(_THIS) /* Video memory should be in r[5] */ this->info.video_mem = regs.r[5]/1024; - enumInfo = (unsigned char *)SDL_malloc(-regs.r[7]); + enumInfo = (char *)SDL_malloc(-regs.r[7]); if (enumInfo == NULL) { SDL_OutOfMemory(); @@ -379,7 +379,7 @@ static void FULLSCREEN_UpdateRects(_THIS, int numrects, SDL_Rect *rects) static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects) { int j; - char *to, *from; + unsigned char *to, *from; int pitch = this->screen->pitch; int row; int xmult = this->screen->format->BytesPerPixel; @@ -402,7 +402,7 @@ static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects) static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects) { int j; - char *to, *from; + unsigned char *to, *from; int pitch = this->screen->pitch; int width_bytes; int src_skip_bytes; @@ -432,7 +432,7 @@ static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects) static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects) { int j; - char *to, *from; + unsigned char *to, *from; int pitch = this->screen->pitch; int width_bytes; int src_skip_bytes; @@ -460,7 +460,7 @@ static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects) static void FULLSCREEN_UpdateRects32bpp(_THIS, int numrects, SDL_Rect *rects) { int j; - char *to, *from; + unsigned char *to, *from; int pitch = this->screen->pitch; int width; @@ -734,7 +734,7 @@ int FULLSCREEN_ToggleFromWimp(_THIS) RISCOS_StoreWimpMode(); if (FULLSCREEN_SetMode(width, height, bpp)) { - char *buffer = this->hidden->alloc_bank; /* This is start of sprite data */ + unsigned char *buffer = this->hidden->alloc_bank; /* This is start of sprite data */ /* Support back buffer mode only */ if (riscos_backbuffer == 0) riscos_backbuffer = 1; diff --git a/src/video/riscos/SDL_wimpvideo.c b/src/video/riscos/SDL_wimpvideo.c index b9d901541..d4191be1c 100644 --- a/src/video/riscos/SDL_wimpvideo.c +++ b/src/video/riscos/SDL_wimpvideo.c @@ -30,6 +30,7 @@ #include "SDL_video.h" #include "SDL_mouse.h" +#include "SDL_timer.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" #include "../../events/SDL_events_c.h" @@ -84,7 +85,7 @@ SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current, Uint32 Rmask = 0; Uint32 Gmask = 0; Uint32 Bmask = 0; - char *buffer = NULL; + unsigned char *buffer = NULL; int bytesPerPixel = 1; /* Don't support double buffering in Wimp mode */ @@ -437,9 +438,9 @@ int WIMP_ToggleFromFullScreen(_THIS) int width = this->screen->w; int height = this->screen->h; int bpp = this->screen->format->BitsPerPixel; - char *buffer = NULL; - char *old_bank[2]; - char *old_alloc_bank; + unsigned char *buffer = NULL; + unsigned char *old_bank[2]; + unsigned char *old_alloc_bank; /* Ensure flags are OK */ this->screen->flags &= ~(SDL_DOUBLEBUF|SDL_HWSURFACE); @@ -447,7 +448,7 @@ int WIMP_ToggleFromFullScreen(_THIS) if (this->hidden->bank[0] == this->hidden->alloc_bank || riscos_backbuffer == 0) { /* Need to create a sprite for the screen and copy the data to it */ - char *data; + unsigned char *data; buffer = WIMP_CreateBuffer(width, height, bpp); data = buffer + 60; /* Start of sprite data */ if (bpp == 8) data += 2048; /* 8bpp sprite have palette first */