"Konstantin Klyatskin" <[EMAIL PROTECTED]> wrote in message
news:32797@palm-dev-forum...
>
> Hi,
>
> #define nextQEvent (firstUserEvent+1)
>
> void pushEvent() {
> EventType e;
> e.eType = nextQEvent; // this is problem line
> EvtAddEventToQueue(&e);
> }
>
> produces Warning: illegal implicit enum conversion from 'unsigned int' to
> 'enum$47Starter_c'.
>
> Any idea how to kill this warning? PalmOS 3.5 project.
You're using C++ which doesn't allow you to directly convert an int to an
enum.
Just code it like
void pushEvent() {
EventType e;
MemSet(&e, sizeof(e), 0); // needed to avoid PalmOS problems
e.eType = (eventsEnum) nextQEvent;
EvtAddEventToQueue(&e);
}
The cast will silence the compiler by making your conversion explicit.
You could also change your define to be
#define nextQEvent ((eventsEnum)(firstUserEvent+1))
which would include the cast.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/