apply suggestions from #1570

This commit is contained in:
zeromus 2016-07-26 17:17:36 +00:00
parent 2d143a9147
commit d6677ef42f
2 changed files with 4 additions and 4 deletions

View File

@ -155,8 +155,8 @@ private:
enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };
enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };
enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };
enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
enum { TAGMASK = (u32)(~0U << TAGSHIFT) };
enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) };
enum { WORDSIZE = sizeof(u32) };
enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };
enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };

View File

@ -200,7 +200,7 @@ u16 get_joy_key(int index) {
break;
case SDL_JOYAXISMOTION:
/* Dead zone of 50% */
if( (abs(event.jaxis.value) >> 14) != 0 )
if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
{
key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1);
if (event.jaxis.value > 0) {
@ -370,7 +370,7 @@ do_process_joystick_events( u16 *keypad, SDL_Event *event) {
Note: button constants have a 1bit offset. */
case SDL_JOYAXISMOTION:
key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1);
if( (abs(event->jaxis.value) >> 14) != 0 )
if( (u32)(abs(event->jaxis.value) >> 14) != 0 )
{
if (event->jaxis.value > 0)
key_code |= 1;