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.
This commit is contained in:
Glenn Maynard
2005-04-23 23:09:08 +00:00
parent 33a5148081
commit 37fb267fd6
+8 -12
View File
@@ -11,7 +11,7 @@
static vector<long> g_aiMasks; static vector<long> g_aiMasks;
// Number of subsystems using the X connection: // Number of subsystems using the X connection:
static unsigned short int g_iRefCount = 0; static int g_iRefCount = 0;
Display *X11Helper::Dpy = NULL; Display *X11Helper::Dpy = NULL;
Window X11Helper::Win; Window X11Helper::Win;
@@ -68,21 +68,17 @@ bool X11Helper::CloseMask( long mask )
static bool pApplyMasks() static bool pApplyMasks()
{ {
if( X11Helper::Dpy != NULL ) if( X11Helper::Dpy == NULL )
{ return true;
long finalMask = 0;
LOG->Trace("X11Helper: Reapplying event masks."); LOG->Trace("X11Helper: Reapplying event masks.");
unsigned int i = 0; long iMask = 0;
while(i < g_aiMasks.size() ) for( unsigned i = 0; i < g_aiMasks.size(); ++i )
{ iMask |= g_aiMasks[i];
finalMask |= g_aiMasks[i];
i++;
}
if(XSelectInput(X11Helper::Dpy, X11Helper::Win, finalMask) == 0) { return false; } if( XSelectInput(X11Helper::Dpy, X11Helper::Win, iMask) == 0 )
} return false;
return true; return true;
} }