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
+9 -13
View File
@@ -11,7 +11,7 @@
static vector<long> 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;
}