Skip to content

Commit

Permalink
riscos: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Apr 26, 2019
1 parent a1c8bcf commit 1d47bb7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/joystick/riscos/SDL_sysjoystick.c
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/video/riscos/SDL_riscosFullScreenVideo.c
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
11 changes: 6 additions & 5 deletions src/video/riscos/SDL_wimpvideo.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -437,17 +438,17 @@ 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);

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 */
Expand Down

0 comments on commit 1d47bb7

Please sign in to comment.