From 37fb267fd6d1594b36a9092813b9afef1f5d55e5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 23 Apr 2005 23:09:08 +0000 Subject: [PATCH] Don't use "long" and "short", unless it's for passing to an API that explicitly expects them; they're too vague across archs. If you really want specific size ints, use int16_t, uint64_t, etc. In this case, "int" is fine. Flip error check. --- stepmania/src/archutils/Unix/X11Helper.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/stepmania/src/archutils/Unix/X11Helper.cpp b/stepmania/src/archutils/Unix/X11Helper.cpp index 6f448b56fb..16a1f3c008 100644 --- a/stepmania/src/archutils/Unix/X11Helper.cpp +++ b/stepmania/src/archutils/Unix/X11Helper.cpp @@ -11,7 +11,7 @@ static vector g_aiMasks; // Number of subsystems using the X connection: -static unsigned short int g_iRefCount = 0; +static int g_iRefCount = 0; Display *X11Helper::Dpy = NULL; Window X11Helper::Win; @@ -68,21 +68,17 @@ bool X11Helper::CloseMask( long mask ) static bool pApplyMasks() { - if( X11Helper::Dpy != NULL ) - { - long finalMask = 0; + if( X11Helper::Dpy == NULL ) + return true; - LOG->Trace("X11Helper: Reapplying event masks."); + LOG->Trace("X11Helper: Reapplying event masks."); - unsigned int i = 0; - while(i < g_aiMasks.size() ) - { - finalMask |= g_aiMasks[i]; - i++; - } + long iMask = 0; + for( unsigned i = 0; i < g_aiMasks.size(); ++i ) + iMask |= g_aiMasks[i]; - if(XSelectInput(X11Helper::Dpy, X11Helper::Win, finalMask) == 0) { return false; } - } + if( XSelectInput(X11Helper::Dpy, X11Helper::Win, iMask) == 0 ) + return false; return true; }