Remove useless 'register' storage class.

It's deprecated, and any compiler we use now ignores it.
This commit is contained in:
Brandon Wright 2018-11-17 15:02:37 -06:00
parent 5d1db07e85
commit 68e13e9044
12 changed files with 75 additions and 75 deletions

View File

@ -122,8 +122,8 @@ void S9xMainLoop (void)
if (CPU.Flags & SCAN_KEYS_FLAG) if (CPU.Flags & SCAN_KEYS_FLAG)
break; break;
register uint8 Op; uint8 Op;
register struct SOpcodes *Opcodes; struct SOpcodes *Opcodes;
if (CPU.PCBase) if (CPU.PCBase)
{ {

View File

@ -403,11 +403,11 @@ static inline bool Diff (int c1, int c2)
void HQ2X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) void HQ2X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height)
{ {
register int w1, w2, w3, w4, w5, w6, w7, w8, w9; int w1, w2, w3, w4, w5, w6, w7, w8, w9;
register uint32 src1line = srcPitch >> 1; uint32 src1line = srcPitch >> 1;
register uint32 dst1line = dstPitch >> 1; uint32 dst1line = dstPitch >> 1;
register uint16 *sp = (uint16 *) srcPtr; uint16 *sp = (uint16 *) srcPtr;
register uint16 *dp = (uint16 *) dstPtr; uint16 *dp = (uint16 *) dstPtr;
uint32 pattern; uint32 pattern;
int l, y; int l, y;
@ -3102,11 +3102,11 @@ void HQ2X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, in
void HQ3X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) void HQ3X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height)
{ {
register int w1, w2, w3, w4, w5, w6, w7, w8, w9; int w1, w2, w3, w4, w5, w6, w7, w8, w9;
register uint32 src1line = srcPitch >> 1; uint32 src1line = srcPitch >> 1;
register uint32 dst1line = dstPitch >> 1; uint32 dst1line = dstPitch >> 1;
register uint16 *sp = (uint16 *) srcPtr; uint16 *sp = (uint16 *) srcPtr;
register uint16 *dp = (uint16 *) dstPtr; uint16 *dp = (uint16 *) dstPtr;
uint32 pattern; uint32 pattern;
int l, y; int l, y;
@ -6774,11 +6774,11 @@ void HQ3X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, in
void HQ4X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) void HQ4X_16 (uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height)
{ {
register int w1, w2, w3, w4, w5, w6, w7, w8, w9; int w1, w2, w3, w4, w5, w6, w7, w8, w9;
register uint32 src1line = srcPitch >> 1; uint32 src1line = srcPitch >> 1;
register uint32 dst1line = dstPitch >> 1; uint32 dst1line = dstPitch >> 1;
register uint16 *sp = (uint16 *) srcPtr; uint16 *sp = (uint16 *) srcPtr;
register uint16 *dp = (uint16 *) dstPtr; uint16 *dp = (uint16 *) dstPtr;
uint32 pattern; uint32 pattern;
int l, y; int l, y;

18
gfx.cpp
View File

@ -513,12 +513,12 @@ void S9xUpdateScreen (void)
// ignoring the true, larger size of the buffer. // ignoring the true, larger size of the buffer.
GFX.RealPPL = GFX.Pitch >> 1; GFX.RealPPL = GFX.Pitch >> 1;
for (register int32 y = (int32) GFX.StartY - 1; y >= 0; y--) for (int32 y = (int32) GFX.StartY - 1; y >= 0; y--)
{ {
register uint16 *p = GFX.Screen + y * GFX.PPL + 255; uint16 *p = GFX.Screen + y * GFX.PPL + 255;
register uint16 *q = GFX.Screen + y * GFX.RealPPL + 510; uint16 *q = GFX.Screen + y * GFX.RealPPL + 510;
for (register int x = 255; x >= 0; x--, p--, q -= 2) for (int x = 255; x >= 0; x--, p--, q -= 2)
*q = *(q + 1) = *p; *q = *(q + 1) = *p;
} }
@ -527,12 +527,12 @@ void S9xUpdateScreen (void)
else else
#endif #endif
// Have to back out of the regular speed hack // Have to back out of the regular speed hack
for (register uint32 y = 0; y < GFX.StartY; y++) for (uint32 y = 0; y < GFX.StartY; y++)
{ {
register uint16 *p = GFX.Screen + y * GFX.PPL + 255; uint16 *p = GFX.Screen + y * GFX.PPL + 255;
register uint16 *q = GFX.Screen + y * GFX.PPL + 510; uint16 *q = GFX.Screen + y * GFX.PPL + 510;
for (register int x = 255; x >= 0; x--, p--, q -= 2) for (int x = 255; x >= 0; x--, p--, q -= 2)
*q = *(q + 1) = *p; *q = *(q + 1) = *p;
} }
@ -547,7 +547,7 @@ void S9xUpdateScreen (void)
GFX.PPL = GFX.RealPPL << 1; GFX.PPL = GFX.RealPPL << 1;
GFX.DoInterlace = 2; GFX.DoInterlace = 2;
for (register int32 y = (int32) GFX.StartY - 2; y >= 0; y--) for (int32 y = (int32) GFX.StartY - 2; y >= 0; y--)
memmove(GFX.Screen + (y + 1) * GFX.PPL, GFX.Screen + y * GFX.RealPPL, GFX.PPL * sizeof(uint16)); memmove(GFX.Screen + (y + 1) * GFX.PPL, GFX.Screen + y * GFX.RealPPL, GFX.PPL * sizeof(uint16));
} }
} }

View File

@ -68,10 +68,10 @@ namespace CRC32lib
//CRC32 for char arrays //CRC32 for char arrays
unsigned int CRC32(const unsigned char *array, size_t size, register unsigned int crc32) unsigned int CRC32(const unsigned char *array, size_t size, unsigned int crc32)
{ {
const unsigned char *end_p = array+size; const unsigned char *end_p = array+size;
for (register const unsigned char *p = array; p < end_p; p++) for (const unsigned char *p = array; p < end_p; p++)
{ {
crc32 = ((crc32 >> 8) & 0x00FFFFFF) ^ crc32Table[(crc32 ^ *p) & 0xFF]; crc32 = ((crc32 >> 8) & 0x00FFFFFF) ^ crc32Table[(crc32 ^ *p) & 0xFF];
} }

View File

@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace CRC32lib namespace CRC32lib
{ {
unsigned int CRC32(const unsigned char *, size_t, register unsigned int crc32 = 0xFFFFFFFF); unsigned int CRC32(const unsigned char *, size_t, unsigned int crc32 = 0xFFFFFFFF);
} }
#endif #endif

View File

@ -133,8 +133,8 @@ void S9xSA1MainLoop (void)
S9xSA1Trace(); S9xSA1Trace();
#endif #endif
register uint8 Op; uint8 Op;
register struct SOpcodes *Opcodes; struct SOpcodes *Opcodes;
if (SA1.PCBase) if (SA1.PCBase)
{ {

View File

@ -24,11 +24,11 @@ static uint8 hrbit_even[256];
void S9xInitTileRenderer (void) void S9xInitTileRenderer (void)
{ {
register int i; int i;
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{ {
register uint32 b = 0; uint32 b = 0;
#ifdef LSB_FIRST #ifdef LSB_FIRST
if (i & 8) if (i & 8)
@ -56,8 +56,8 @@ void S9xInitTileRenderer (void)
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
{ {
register uint8 m = 0; uint8 m = 0;
register uint8 s = 0; uint8 s = 0;
if (i & 0x80) if (i & 0x80)
s |= 8; s |= 8;
@ -93,7 +93,7 @@ void S9xInitTileRenderer (void)
static uint8 ConvertTile2 (uint8 *pCache, uint32 TileAddr, uint32) static uint8 ConvertTile2 (uint8 *pCache, uint32 TileAddr, uint32)
{ {
register uint8 *tp = &Memory.VRAM[TileAddr]; uint8 *tp = &Memory.VRAM[TileAddr];
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -102,7 +102,7 @@ static uint8 ConvertTile2 (uint8 *pCache, uint32 TileAddr, uint32)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -116,7 +116,7 @@ static uint8 ConvertTile2 (uint8 *pCache, uint32 TileAddr, uint32)
static uint8 ConvertTile4 (uint8 *pCache, uint32 TileAddr, uint32) static uint8 ConvertTile4 (uint8 *pCache, uint32 TileAddr, uint32)
{ {
register uint8 *tp = &Memory.VRAM[TileAddr]; uint8 *tp = &Memory.VRAM[TileAddr];
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -125,7 +125,7 @@ static uint8 ConvertTile4 (uint8 *pCache, uint32 TileAddr, uint32)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -141,7 +141,7 @@ static uint8 ConvertTile4 (uint8 *pCache, uint32 TileAddr, uint32)
static uint8 ConvertTile8 (uint8 *pCache, uint32 TileAddr, uint32) static uint8 ConvertTile8 (uint8 *pCache, uint32 TileAddr, uint32)
{ {
register uint8 *tp = &Memory.VRAM[TileAddr]; uint8 *tp = &Memory.VRAM[TileAddr];
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -150,7 +150,7 @@ static uint8 ConvertTile8 (uint8 *pCache, uint32 TileAddr, uint32)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -178,7 +178,7 @@ static uint8 ConvertTile8 (uint8 *pCache, uint32 TileAddr, uint32)
static uint8 ConvertTile2h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile) static uint8 ConvertTile2h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
register uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2; uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2;
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -192,7 +192,7 @@ static uint8 ConvertTile2h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -206,7 +206,7 @@ static uint8 ConvertTile2h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile)
static uint8 ConvertTile4h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile) static uint8 ConvertTile4h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
register uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2; uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2;
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -220,7 +220,7 @@ static uint8 ConvertTile4h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -244,7 +244,7 @@ static uint8 ConvertTile4h_odd (uint8 *pCache, uint32 TileAddr, uint32 Tile)
static uint8 ConvertTile2h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile) static uint8 ConvertTile2h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
register uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2; uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2;
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -258,7 +258,7 @@ static uint8 ConvertTile2h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -272,7 +272,7 @@ static uint8 ConvertTile2h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile)
static uint8 ConvertTile4h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile) static uint8 ConvertTile4h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
register uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2; uint8 *tp1 = &Memory.VRAM[TileAddr], *tp2;
uint32 *p = (uint32 *) pCache; uint32 *p = (uint32 *) pCache;
uint32 non_zero = 0; uint32 non_zero = 0;
uint8 line; uint8 line;
@ -286,7 +286,7 @@ static uint8 ConvertTile4h_even (uint8 *pCache, uint32 TileAddr, uint32 Tile)
{ {
uint32 p1 = 0; uint32 p1 = 0;
uint32 p2 = 0; uint32 p2 = 0;
register uint8 pix; uint8 pix;
DOBIT( 0, 0); DOBIT( 0, 0);
DOBIT( 1, 1); DOBIT( 1, 1);
@ -564,8 +564,8 @@ void S9xSelectTileConverter (int depth, bool8 hires, bool8 sub, bool8 mosaic)
#define DRAW_TILE() \ #define DRAW_TILE() \
uint8 *pCache; \ uint8 *pCache; \
register int32 l; \ int32 l; \
register uint8 *bp, Pix; \ uint8 *bp, Pix; \
\ \
GET_CACHED_TILE(); \ GET_CACHED_TILE(); \
if (IS_BLANK_TILE()) \ if (IS_BLANK_TILE()) \
@ -659,8 +659,8 @@ void S9xSelectTileConverter (int depth, bool8 hires, bool8 sub, bool8 mosaic)
#define DRAW_TILE() \ #define DRAW_TILE() \
uint8 *pCache; \ uint8 *pCache; \
register int32 l; \ int32 l; \
register uint8 *bp, Pix, w; \ uint8 *bp, Pix, w; \
\ \
GET_CACHED_TILE(); \ GET_CACHED_TILE(); \
if (IS_BLANK_TILE()) \ if (IS_BLANK_TILE()) \
@ -771,8 +771,8 @@ void S9xSelectTileConverter (int depth, bool8 hires, bool8 sub, bool8 mosaic)
#define DRAW_TILE() \ #define DRAW_TILE() \
uint8 *pCache; \ uint8 *pCache; \
register int32 l, w; \ int32 l, w; \
register uint8 Pix; \ uint8 Pix; \
\ \
GET_CACHED_TILE(); \ GET_CACHED_TILE(); \
if (IS_BLANK_TILE()) \ if (IS_BLANK_TILE()) \
@ -821,7 +821,7 @@ void S9xSelectTileConverter (int depth, bool8 hires, bool8 sub, bool8 mosaic)
#define Pix 0 #define Pix 0
#define DRAW_TILE() \ #define DRAW_TILE() \
register uint32 l, x; \ uint32 l, x; \
\ \
GFX.RealScreenColors = IPPU.ScreenColors; \ GFX.RealScreenColors = IPPU.ScreenColors; \
GFX.ScreenColors = GFX.ClipColors ? BlackColourMap : GFX.RealScreenColors; \ GFX.ScreenColors = GFX.ClipColors ? BlackColourMap : GFX.RealScreenColors; \

View File

@ -51,7 +51,7 @@ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int
(*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{ {
register int keyshift = (int)((*(pkeys+1)) >> 24); int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
} }
return c; return c;

View File

@ -572,14 +572,14 @@ inline void ThreeHalfLine32( uint32 *lpDst, uint16 *lpSrc, unsigned int Width){
#define AVERAGE_565(el0, el1) (((el0) & (el1)) + ((((el0) ^ (el1)) & 0xF7DE) >> 1)) #define AVERAGE_565(el0, el1) (((el0) & (el1)) + ((((el0) ^ (el1)) & 0xF7DE) >> 1))
void RenderMergeHires(void *src, int srcPitch , void* dst, int dstPitch, unsigned int width, unsigned int height) void RenderMergeHires(void *src, int srcPitch , void* dst, int dstPitch, unsigned int width, unsigned int height)
{ {
for (register int y = 0; y < height; y++) for (int y = 0; y < height; y++)
{ {
register uint16 *input = (uint16 *) ((uint8 *) src + y * srcPitch); uint16 *input = (uint16 *) ((uint8 *) src + y * srcPitch);
register uint16 *output = (uint16 *) ((uint8 *) dst + y * dstPitch); uint16 *output = (uint16 *) ((uint8 *) dst + y * dstPitch);
register uint16 l, r; uint16 l, r;
l = 0; l = 0;
for (register int x = 0; x < (width >> 1); x++) for (int x = 0; x < (width >> 1); x++)
{ {
r = *input++; r = *input++;
*output++ = AVERAGE_565 (l, r); *output++ = AVERAGE_565 (l, r);

View File

@ -900,10 +900,10 @@ void DeinitS9x()
// for (int l = 0; l < 32; l++) // for (int l = 0; l < 32; l++)
// levels [l] = l * brightness; // levels [l] = l * brightness;
// //
// for (register int y = 0; y < height; y++) // for (int y = 0; y < height; y++)
// { // {
// register uint8 *s = ((uint8 *) src->Surface + y * src->Pitch + offset1); // uint8 *s = ((uint8 *) src->Surface + y * src->Pitch + offset1);
// register uint8 *d = ((uint8 *) dst->Surface + y * dst->Pitch + offset2); // uint8 *d = ((uint8 *) dst->Surface + y * dst->Pitch + offset2);
// //
//#ifdef LSB_FIRST //#ifdef LSB_FIRST
// if (GUI.RedShift < GUI.BlueShift) // if (GUI.RedShift < GUI.BlueShift)
@ -912,7 +912,7 @@ void DeinitS9x()
//#endif //#endif
// { // {
// // Order is RGB // // Order is RGB
// for (register int x = 0; x < width; x++) // for (int x = 0; x < width; x++)
// { // {
// uint16 pixel = PPU.CGDATA [*s++]; // uint16 pixel = PPU.CGDATA [*s++];
// *(d + 0) = levels [(pixel & 0x1f)]; // *(d + 0) = levels [(pixel & 0x1f)];
@ -924,7 +924,7 @@ void DeinitS9x()
// else // else
// { // {
// // Order is BGR // // Order is BGR
// for (register int x = 0; x < width; x++) // for (int x = 0; x < width; x++)
// { // {
// uint16 pixel = PPU.CGDATA [*s++]; // uint16 pixel = PPU.CGDATA [*s++];
// *(d + 0) = levels [((pixel >> 10) & 0x1f)]; // *(d + 0) = levels [((pixel >> 10) & 0x1f)];

View File

@ -632,8 +632,8 @@ void Convert16To24 (SSurface *src, SSurface *dst, RECT *srect)
for (int y = 0; y < height; y++) for (int y = 0; y < height; y++)
{ {
register uint16 *s = (uint16 *) ((uint8 *) src->Surface + (doubledY ? y*2 : y) * src->Pitch + offset1); uint16 *s = (uint16 *) ((uint8 *) src->Surface + (doubledY ? y*2 : y) * src->Pitch + offset1);
register uint8 *d = ((uint8 *) dst->Surface + y * dst->Pitch + offset2); uint8 *d = ((uint8 *) dst->Surface + y * dst->Pitch + offset2);
#define Interp(c1, c2) \ #define Interp(c1, c2) \
(c1 == c2) ? c1 : \ (c1 == c2) ? c1 : \
@ -716,12 +716,12 @@ void Convert16To32 (SSurface *src, SSurface *dst, RECT *srect)
int offset2 = 0;//((dst->Height - height) >> 1) * dst->Pitch + int offset2 = 0;//((dst->Height - height) >> 1) * dst->Pitch +
//((dst->Width - width) >> 1) * sizeof (uint32); //((dst->Width - width) >> 1) * sizeof (uint32);
for (register int y = 0; y < height; y++) for (int y = 0; y < height; y++)
{ {
register uint16 *s = (uint16 *) ((uint8 *) src->Surface + y * src->Pitch + offset1); uint16 *s = (uint16 *) ((uint8 *) src->Surface + y * src->Pitch + offset1);
register uint32 *d = (uint32 *) ((uint8 *) dst->Surface + uint32 *d = (uint32 *) ((uint8 *) dst->Surface +
y * dst->Pitch + offset2); y * dst->Pitch + offset2);
for (register int x = 0; x < width; x++) for (int x = 0; x < width; x++)
{ {
uint32 pixel = *s++; uint32 pixel = *s++;
*d++ = (((pixel >> 11) & 0x1f) << GUI.RedShift) | *d++ = (((pixel >> 11) & 0x1f) << GUI.RedShift) |

View File

@ -5299,8 +5299,8 @@ inline int InfoScore(char *Buffer)
inline unsigned short sum(unsigned char *array, unsigned int size = HEADER_SIZE) inline unsigned short sum(unsigned char *array, unsigned int size = HEADER_SIZE)
{ {
register unsigned short theSum = 0; unsigned short theSum = 0;
for (register unsigned int i = 0; i < size; i++) for (unsigned int i = 0; i < size; i++)
{ {
theSum += array[i]; theSum += array[i];
} }