[SDL] testwm.c error in Dev-C++

Ken Mortimer grano at tampabay.rr.com
Thu Mar 20 06:40:02 PST 2003


Hey all,
I've been having problems compiling the testwm.c that comes with the CVS 
build of SDL. More specifically, the function listed below. It appears 
Dev-C++ can't use the logical not operator on non-bool types?

void HotKey_ToggleGrab(void)
{
SDL_GrabMode mode;

printf("Ctrl-G: toggling input grab!\n");
mode = SDL_WM_GrabInput(SDL_GRAB_QUERY);
if ( mode == SDL_GRAB_ON ) {
printf("Grab was on\n");
} else {
printf("Grab was off\n");
}
mode = SDL_WM_GrabInput(!mode); /* Error occurs here */
if ( mode == SDL_GRAB_ON ) {
printf("Grab is now on\n");
} else {
printf("Grab is now off\n");
}
}

The errors reported are as follows:

C:\SDL-1.2.6\test\testwm.c
[Warning] In function `void HotKey_ToggleGrab()':

96
C:\SDL-1.2.6\test\testwm.c
cannot convert `bool' to `SDL_GrabMode'

C:\Documents and Settings\Granoblastic Man\My Documents\Dev-C++ 
Projects\Makefile.win
[Build Error] [../../../../SDL-1.2.6/test/testwm.o] Error 1





More information about the SDL mailing list