xu4 Discussion

 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 static_cast
Author: Darrenor64 (67.204.201.---)
Date:   07-26-08 02:56

Hello.
I'm trying to get into the code, but am thwarted by two lines in event_sdl.cpp
(see lines that start with id assignment)

I'm using Eclipse under cygwin on Vista.
Suggestions?
This doesn't have anything to do with the SDL_mixer, does it?

- D

---
TimedEventMgr::TimedEventMgr(int i) : baseInterval(i) {
/* start the SDL timer */
if (instances == 0) {
if (u4_SDL_InitSubSystem(SDL_INIT_TIMER) < 0)
errorFatal("unable to init SDL: %s", SDL_GetError());
}

id = static_cast<void*>(SDL_AddTimer(i, &TimedEventMgr::callback, this));
instances++;
}

...

void TimedEventMgr::start() {
if (!id)
id = static_cast<void*>(SDL_AddTimer(baseInterval, &TimedEventMgr::callback, this));
}


event_sdl.cpp: In constructor `TimedEventMgr::TimedEventMgr(int)':
event_sdl.cpp:155: error: invalid conversion from `unsigned int (*)(unsigned int, void*)' to `Uint32 (*)(Uint32, void*)'
event_sdl.cpp:155: error: initializing argument 2 of `_SDL_TimerID* SDL_AddTimer(Uint32, Uint32 (*)(Uint32, void*), void*)'
event_sdl.cpp: In member function `void TimedEventMgr::start()':
event_sdl.cpp:209: error: invalid conversion from `unsigned int (*)(unsigned int, void*)' to `Uint32 (*)(Uint32, void*)'
event_sdl.cpp:209: error: initializing argument 2 of `_SDL_TimerID* SDL_AddTimer(Uint32, Uint32 (*)(Uint32, void*), void*)'
make: *** [event_sdl.o] Error 1



Reply To This Message
 Threaded View   Newer Topic  |  Older Topic 


 
 Reply To This Message
 Your Name:
 Your E-mail:
 Subject:
   

SourceForge.net Logo phorum.org