Re: [AD] event source casts |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sun, 2009-08-02 at 11:30 +0200, Elias Pschernig wrote:
> Here's a proposal to fix this bug:
> https://sourceforge.net/tracker/?func=detail&aid=2329841&group_id=5665&atid=105665
>
> The idea is to add the following functions:
>
> ALLEGRO_EVENT_SOURCE *al_get_stream_event_source(ALLEGRO_STREAM *)
>
> That's the one directly fixing the ugly cast. And further:
>
> ALLEGRO_EVENT_SOURCE *al_get_display_event_source(ALLEGRO_DISPLAY *)
> ALLEGRO_EVENT_SOURCE *al_get_keyboard_event_source(ALLEGRO_KEYBOARD *)
> ALLEGRO_EVENT_SOURCE *al_get_mouse_event_source(ALLEGRO_MOUSE *)
> ALLEGRO_EVENT_SOURCE *al_get_timer_event_source(ALLEGRO_TIMER *)
> ALLEGRO_EVENT_SOURCE *al_get_joystick_event_source(ALLEGRO_JOYSTICK *)
>
> Which fixes a few more (not quite as ugly) casts. Any thoughts?
>
Ok, committed to SVN as I couldn't see much reason against it - now the
A5 API is 100% cast-free, and typing (ALLEGRO_EVENT_SOURCE *) is
actually more work than typing al_get_display_event_source() because of
the caps lock.
One thing Chris requested in #allegro is making all those functions
inline. I couldn't figure out how to do it so need some help... does
anyone know if a public A5 function is currently an inline function? If
so I'll just look how it is declared and do the same.
--
Elias Pschernig <elias@xxxxxxxxxx>