riscos: Fix warnings SDL-1.2
authorCameron Cawley <ccawley2011@gmail.com>
Fri, 26 Apr 2019 17:34:41 +0100
branchSDL-1.2
changeset 127798f5a01f3a9bd
parent 12778 c47cdc60c1b3
child 12780 395d43be372d
riscos: Fix warnings
src/joystick/riscos/SDL_sysjoystick.c
src/video/riscos/SDL_riscosFullScreenVideo.c
src/video/riscos/SDL_wimpvideo.c
     1.1 --- a/src/joystick/riscos/SDL_sysjoystick.c	Fri Apr 26 17:41:20 2019 +0100
     1.2 +++ b/src/joystick/riscos/SDL_sysjoystick.c	Fri Apr 26 17:34:41 2019 +0100
     1.3 @@ -89,13 +89,9 @@
     1.4   */
     1.5  int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
     1.6  {
     1.7 -	_kernel_swi_regs regs;
     1.8 -
     1.9  	if(!(joystick->hwdata=SDL_malloc(sizeof(struct joystick_hwdata))))
    1.10  		return -1;
    1.11  
    1.12 -	regs.r[0] = joystick->index;
    1.13 -
    1.14  	/* Don't know how to get exact count of buttons so assume max of 4 for now */
    1.15  	joystick->nbuttons=4;
    1.16  
     2.1 --- a/src/video/riscos/SDL_riscosFullScreenVideo.c	Fri Apr 26 17:41:20 2019 +0100
     2.2 +++ b/src/video/riscos/SDL_riscosFullScreenVideo.c	Fri Apr 26 17:34:41 2019 +0100
     2.3 @@ -311,7 +311,7 @@
     2.4  	/* Video memory should be in r[5] */
     2.5  	this->info.video_mem = regs.r[5]/1024;
     2.6  
     2.7 -	enumInfo = (unsigned char *)SDL_malloc(-regs.r[7]);
     2.8 +	enumInfo = (char *)SDL_malloc(-regs.r[7]);
     2.9  	if (enumInfo == NULL)
    2.10  	{
    2.11  		SDL_OutOfMemory();
    2.12 @@ -379,7 +379,7 @@
    2.13  static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects)
    2.14  {
    2.15        int j;
    2.16 -      char *to, *from;
    2.17 +      unsigned char *to, *from;
    2.18        int pitch = this->screen->pitch;
    2.19        int row;
    2.20        int xmult = this->screen->format->BytesPerPixel;
    2.21 @@ -402,7 +402,7 @@
    2.22  static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects)
    2.23  {
    2.24     int j;
    2.25 -   char *to, *from;
    2.26 +   unsigned char *to, *from;
    2.27     int pitch = this->screen->pitch;
    2.28     int width_bytes;
    2.29     int src_skip_bytes;
    2.30 @@ -432,7 +432,7 @@
    2.31  static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects)
    2.32  {
    2.33     int j;
    2.34 -   char *to, *from;
    2.35 +   unsigned char *to, *from;
    2.36     int pitch = this->screen->pitch;
    2.37     int width_bytes;
    2.38     int src_skip_bytes;
    2.39 @@ -460,7 +460,7 @@
    2.40  static void FULLSCREEN_UpdateRects32bpp(_THIS, int numrects, SDL_Rect *rects)
    2.41  {
    2.42     int j;
    2.43 -   char *to, *from;
    2.44 +   unsigned char *to, *from;
    2.45     int pitch = this->screen->pitch;
    2.46     int width;
    2.47  
    2.48 @@ -734,7 +734,7 @@
    2.49     RISCOS_StoreWimpMode();
    2.50     if (FULLSCREEN_SetMode(width, height, bpp))
    2.51     {
    2.52 -       char *buffer = this->hidden->alloc_bank; /* This is start of sprite data */
    2.53 +       unsigned char *buffer = this->hidden->alloc_bank; /* This is start of sprite data */
    2.54         /* Support back buffer mode only */
    2.55         if (riscos_backbuffer == 0) riscos_backbuffer = 1;
    2.56  
     3.1 --- a/src/video/riscos/SDL_wimpvideo.c	Fri Apr 26 17:41:20 2019 +0100
     3.2 +++ b/src/video/riscos/SDL_wimpvideo.c	Fri Apr 26 17:34:41 2019 +0100
     3.3 @@ -30,6 +30,7 @@
     3.4  
     3.5  #include "SDL_video.h"
     3.6  #include "SDL_mouse.h"
     3.7 +#include "SDL_timer.h"
     3.8  #include "../SDL_sysvideo.h"
     3.9  #include "../SDL_pixels_c.h"
    3.10  #include "../../events/SDL_events_c.h"
    3.11 @@ -84,7 +85,7 @@
    3.12     Uint32 Rmask = 0;
    3.13     Uint32 Gmask = 0;
    3.14     Uint32 Bmask = 0;
    3.15 -   char *buffer = NULL;
    3.16 +   unsigned char *buffer = NULL;
    3.17     int bytesPerPixel = 1;
    3.18  
    3.19     /* Don't support double buffering in Wimp mode */
    3.20 @@ -437,9 +438,9 @@
    3.21     int width = this->screen->w;
    3.22     int height = this->screen->h;
    3.23     int bpp = this->screen->format->BitsPerPixel;
    3.24 -   char *buffer = NULL;
    3.25 -   char *old_bank[2];
    3.26 -   char *old_alloc_bank;
    3.27 +   unsigned char *buffer = NULL;
    3.28 +   unsigned char *old_bank[2];
    3.29 +   unsigned char *old_alloc_bank;
    3.30  
    3.31     /* Ensure flags are OK */
    3.32     this->screen->flags &= ~(SDL_DOUBLEBUF|SDL_HWSURFACE);
    3.33 @@ -447,7 +448,7 @@
    3.34     if (this->hidden->bank[0] == this->hidden->alloc_bank || riscos_backbuffer == 0)
    3.35     {
    3.36        /* Need to create a sprite for the screen and copy the data to it */
    3.37 -      char *data;
    3.38 +      unsigned char *data;
    3.39        buffer = WIMP_CreateBuffer(width, height, bpp);
    3.40        data = buffer + 60;         /* Start of sprite data */
    3.41        if (bpp == 8) data += 2048;  /* 8bpp sprite have palette first */