From 1e56f18b7e2f355f7c70396836e0d11eaf7debd6 Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 18 Feb 2016 00:38:21 +0000 Subject: [PATCH] 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 --- src/common/Version.hxx | 2 +- src/emucore/Thumbulator.cxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 7cb7997bc..1cdd1fbc2 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -22,7 +22,7 @@ #include -#define STELLA_VERSION "4.7.1" +#define STELLA_VERSION "4.7.2_pre" #define STELLA_BUILD atoi("$Rev$" + 6) #endif diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index bf2b4fcd8..ad045ec28 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -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); }