Ignore:
Timestamp:
Apr 19, 2008, 9:25:52 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Remove all unsigned ints from exported functions. Signed arithmetic is far better for error checking.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/event.c

    r2303 r2305  
    6464 *  \return 1 if a matching event was received, or 0 if the wait timeouted.
    6565 */
    66 int caca_get_event(caca_display_t *dp, unsigned int event_mask,
     66int caca_get_event(caca_display_t *dp, int event_mask,
    6767                   caca_event_t *ev, int timeout)
    6868{
     
    128128 *  \return The X mouse coordinate.
    129129 */
    130 unsigned int caca_get_mouse_x(caca_display_t const *dp)
    131 {
    132     unsigned int width = cucul_get_canvas_width(dp->cv);
     130int caca_get_mouse_x(caca_display_t const *dp)
     131{
     132    int width = cucul_get_canvas_width(dp->cv);
    133133
    134134    if(dp->mouse.x >= width)
     
    150150 *  \return The Y mouse coordinate.
    151151 */
    152 unsigned int caca_get_mouse_y(caca_display_t const *dp)
    153 {
    154     unsigned int height = cucul_get_canvas_height(dp->cv);
     152int caca_get_mouse_y(caca_display_t const *dp)
     153{
     154    int height = cucul_get_canvas_height(dp->cv);
    155155
    156156    if(dp->mouse.y >= height)
     
    199199 *  \return The key value.
    200200 */
    201 unsigned int caca_get_event_key_ch(caca_event_t const *ev)
     201int caca_get_event_key_ch(caca_event_t const *ev)
    202202{
    203203    return ((caca_privevent_t const *)ev)->data.key.ch;
     
    250250 *  \return The event's mouse button.
    251251 */
    252 unsigned int caca_get_event_mouse_button(caca_event_t const *ev)
     252int caca_get_event_mouse_button(caca_event_t const *ev)
    253253{
    254254    return ((caca_privevent_t const *)ev)->data.mouse.button;
     
    266266 *  \return The event's X mouse coordinate.
    267267 */
    268 unsigned int caca_get_event_mouse_x(caca_event_t const *ev)
     268int caca_get_event_mouse_x(caca_event_t const *ev)
    269269{
    270270    return ((caca_privevent_t const *)ev)->data.mouse.x;
     
    282282 *  \return The event's Y mouse coordinate.
    283283 */
    284 unsigned int caca_get_event_mouse_y(caca_event_t const *ev)
     284int caca_get_event_mouse_y(caca_event_t const *ev)
    285285{
    286286    return ((caca_privevent_t const *)ev)->data.mouse.y;
     
    298298 *  \return The event's new display width value.
    299299 */
    300 unsigned int caca_get_event_resize_width(caca_event_t const *ev)
     300int caca_get_event_resize_width(caca_event_t const *ev)
    301301{
    302302    return ((caca_privevent_t const *)ev)->data.resize.w;
     
    314314 *  \return The event's new display height value.
    315315 */
    316 unsigned int caca_get_event_resize_height(caca_event_t const *ev)
     316int caca_get_event_resize_height(caca_event_t const *ev)
    317317{
    318318    return ((caca_privevent_t const *)ev)->data.resize.h;
     
    326326{
    327327#if defined(USE_SLANG) || defined(USE_NCURSES)
    328     unsigned int ticks;
     328    int ticks;
    329329#endif
    330330    int ret;
Note: See TracChangeset for help on using the changeset viewer.