Skip to content
Permalink
Browse files

Fix compilation warnings for MacOS build.

  • Loading branch information...
denisfa authored and rkitover committed Apr 3, 2019
1 parent 5540790 commit 331d9d331cdf2605eba5d84964f182a08823be2b
@@ -157,10 +157,10 @@ static inline uint32_t INTERPOLATE (uint32_t A, uint32_t B)

static inline uint32_t Q_INTERPOLATE (uint32_t A, uint32_t B, uint32_t C, uint32_t D)
{
register uint32_t x = ((A & qcolorMask) >> 2) +
uint32_t x = ((A & qcolorMask) >> 2) +
((B & qcolorMask) >> 2) +
((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
register uint32_t y = (A & qlowpixelMask) +
uint32_t y = (A & qlowpixelMask) +
(B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask);

y = (y >> 2) & qlowpixelMask;
@@ -283,7 +283,7 @@ void Super2xSaI (uint8_t *srcPtr, uint32_t srcPitch,
} else if (color5 == color3 && color2 != color6) {
product2b = product1b = color5;
} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;

r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@@ -415,7 +415,7 @@ void Super2xSaI32 (uint8_t *srcPtr, uint32_t srcPitch,
} else if (color5 == color3 && color2 != color6) {
product2b = product1b = color5;
} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;

r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@@ -575,7 +575,7 @@ void SuperEagle (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
}

} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;

r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@@ -710,7 +710,7 @@ void SuperEagle32 (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
}

} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;

r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@@ -790,7 +790,7 @@ void _2xSaI (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,

for (uint32_t finish = width; finish; finish -= inc_bP) {

register uint32_t colorA, colorB;
uint32_t colorA, colorB;
uint32_t colorC, colorD,
colorE, colorF, colorG, colorH,
colorI, colorJ, colorK, colorL,
@@ -863,7 +863,7 @@ void _2xSaI (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
product1 = colorA;
product2 = colorA;
} else {
register int r = 0;
int r = 0;

product1 = INTERPOLATE (colorA, colorC);
product = INTERPOLATE (colorA, colorB);
@@ -950,7 +950,7 @@ void _2xSaI32 (uint8_t *srcPtr, uint32_t srcPitch, uint8_t * /* deltaPtr */,
dP = (uint32_t *) dstPtr;

for (uint32_t finish = width; finish; finish -= inc_bP) {
register uint32_t colorA, colorB;
uint32_t colorA, colorB;
uint32_t colorC, colorD,
colorE, colorF, colorG, colorH,
colorI, colorJ, colorK, colorL,
@@ -1023,7 +1023,7 @@ void _2xSaI32 (uint8_t *srcPtr, uint32_t srcPitch, uint8_t * /* deltaPtr */,
product1 = colorA;
product2 = colorA;
} else {
register int r = 0;
int r = 0;

product1 = INTERPOLATE (colorA, colorC);
product = INTERPOLATE (colorA, colorB);
@@ -152,7 +152,7 @@ inline unsigned int RGBtoYUV_32(unsigned int c)
{
// Division through 3 slows down the emulation about 10% !!!

register unsigned char r, g, b;
unsigned char r, g, b;
b = c & 0x0000FF;
g = (c & 0x00FF00) >> 8;
r = c >> 16;
@@ -254,7 +254,7 @@ inline unsigned int RGBtoYUV_16(unsigned short c)
{
// Division through 3 slows down the emulation about 10% !!!

register unsigned char r, g, b;
unsigned char r, g, b;
#ifdef RGB555
r = (c & 0x7C00) >> 7;
g = (c & 0x03E0) >> 2;
@@ -900,7 +900,7 @@ void gbCompareLYToLYC()
}
}

void gbWriteMemory(register uint16_t address, register uint8_t value)
void gbWriteMemory(uint16_t address, uint8_t value)
{

if (address < 0x8000) {
@@ -1720,7 +1720,7 @@ void gbWriteMemory(register uint16_t address, register uint8_t value)
gbMemory[address] = value;
}

uint8_t gbReadMemory(register uint16_t address)
uint8_t gbReadMemory(uint16_t address)
{
if (gbCheatMap[address])
return gbCheatRead(address);
@@ -4505,7 +4505,7 @@ void gbEmulate(int ticksToStop)
clockTicks = 0;
gbDmaTicks = 0;

register int opcode = 0;
int opcode = 0;

int opcode1 = 0;
int opcode2 = 0;
@@ -24,7 +24,7 @@ int gbDis(char*, uint16_t);
bool gbLoadRom(const char*);
bool gbUpdateSizes();
void gbEmulate(int);
void gbWriteMemory(register uint16_t, register uint8_t);
void gbWriteMemory(uint16_t, uint8_t);
void gbDrawLine();
bool gbIsGameboyRom(const char*);
void gbGetHardwareType();
@@ -119,15 +119,15 @@ void gbSgbFillScreen(uint16_t color)
int yLine = (y + gbBorderRowSkip + 1) * (gbBorderLineSkip + 2) + gbBorderColumnSkip;
#endif
uint16_t* dest = (uint16_t*)pix + yLine;
for (register int x = 0; x < 160; x++)
for (int x = 0; x < 160; x++)
gbSgbDraw16Bit(dest++, color);
}
} break;
case 24: {
for (int y = 0; y < 144; y++) {
int yLine = (y + gbBorderRowSkip) * gbBorderLineSkip + gbBorderColumnSkip;
uint8_t* dest = (uint8_t*)pix + yLine * 3;
for (register int x = 0; x < 160; x++) {
for (int x = 0; x < 160; x++) {
gbSgbDraw24Bit(dest, color);
dest += 3;
}
@@ -141,7 +141,7 @@ void gbSgbFillScreen(uint16_t color)
int yLine = (y + gbBorderRowSkip + 1) * (gbBorderLineSkip + 1) + gbBorderColumnSkip;
#endif
uint32_t* dest = (uint32_t*)pix + yLine;
for (register int x = 0; x < 160; x++) {
for (int x = 0; x < 160; x++) {
gbSgbDraw32Bit(dest++, color);
}
}
@@ -37,7 +37,7 @@ uint8_t gbSoundRead(uint16_t address)
return gbMemory[address];
}

void gbSoundEvent(register uint16_t address, register int data)
void gbSoundEvent(uint16_t address, int data)
{
gbMemory[address] = data;

@@ -144,8 +144,8 @@ static void count(uint32_t opcode, int cond_res)
//#ifdef __POWERPC__
#define OP_SUBS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -161,8 +161,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_RSBS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subfco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -178,8 +178,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_ADDS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -195,8 +195,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_ADCS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr xer, %4\n" \
"addeo. %0, %2, %3\n" \
"mcrxr cr1\n" \
@@ -214,8 +214,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_SBCS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr xer, %4\n" \
"subfeo. %0, %3, %2\n" \
"mcrxr cr1\n" \
@@ -233,8 +233,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_RSCS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr xer, %4\n" \
"subfeo. %0, %2, %3\n" \
"mcrxr cr1\n" \
@@ -252,8 +252,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_CMP \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -268,8 +268,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_CMN \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -89,8 +89,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
#ifdef __POWERPC__
#define ADD_RD_RS_RN(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -106,8 +106,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define ADD_RD_RS_O3(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -124,8 +124,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
#define ADD_RD_RS_O3_0 ADD_RD_RS_O3
#define ADD_RN_O8(d) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -141,8 +141,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define CMN_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -157,8 +157,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define ADC_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr 1, %4\n" \ /* reg 1 is xer */
"addeo. %0, %2, %3\n" \
"mcrxr cr1\n" \
@@ -177,8 +177,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define SUB_RD_RS_RN(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -194,8 +194,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define SUB_RD_RS_O3(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -212,8 +212,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
#define SUB_RD_RS_O3_0 SUB_RD_RS_O3
#define SUB_RN_O8(d) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -229,8 +229,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define CMP_RN_O8(d) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -245,8 +245,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define SBC_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr 1, %4\n" \ /* reg 1 is xer */
"subfeo. %0, %3, %2\n" \
"mcrxr cr1\n" \
@@ -265,8 +265,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define NEG_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subfco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@@ -282,8 +282,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define CMP_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \

0 comments on commit 331d9d3

Please sign in to comment.
You can’t perform that action at this time.