Fixed annoying warning about left-shifting negative values.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3285 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2016-02-18 00:38:21 +00:00
parent ced55a8977
commit 1e56f18b7e
2 changed files with 7 additions and 7 deletions

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "4.7.1"
#define STELLA_VERSION "4.7.2_pre"
#define STELLA_BUILD atoi("$Rev$" + 6)
#endif

View File

@ -679,7 +679,7 @@ int Thumbulator::execute ( void )
{
rb=(inst>>0)&0xFF;
if(rb&0x80)
rb|=(~0)<<8; // FIXME - shifting a negative signed value is undefined
rb|=(~0u)<<8;
op=(inst>>8)&0xF;
rb<<=1;
rb+=pc;
@ -827,7 +827,7 @@ int Thumbulator::execute ( void )
{
rb=(inst>>0)&0x7FF;
if(rb&(1<<10))
rb|=(~0)<<11; // FIXME - shifting a negative signed value is undefined
rb|=(~0u)<<11;
rb<<=1;
rb+=pc;
rb+=2;
@ -1224,7 +1224,7 @@ int Thumbulator::execute ( void )
}
rc&=0xFF;
if(rc&0x80)
rc|=((~0)<<8); // FIXME - shifting a negative signed value is undefined
rc|=((~0u)<<8);
write_register(rd,rc);
return(0);
}
@ -1240,7 +1240,7 @@ int Thumbulator::execute ( void )
rc=read16(rb);
rc&=0xFFFF;
if(rc&0x8000)
rc|=((~0)<<16); // FIXME - shifting a negative signed value is undefined
rc|=((~0u)<<16);
write_register(rd,rc);
return(0);
}
@ -1886,7 +1886,7 @@ int Thumbulator::execute ( void )
ra=read_register(rm);
rc=ra&0xFF;
if(rc&0x80)
rc|=(~0)<<8; // FIXME - shifting a negative signed value is undefined
rc|=(~0u)<<8;
write_register(rd,rc);
return(0);
}
@ -1900,7 +1900,7 @@ int Thumbulator::execute ( void )
ra=read_register(rm);
rc=ra&0xFFFF;
if(rc&0x8000)
rc|=(~0)<<16; // FIXME - shifting a negative signed value is undefined
rc|=(~0u)<<16;
write_register(rd,rc);
return(0);
}