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/caca_internals.h

    r2299 r2305  
    9696    union
    9797    {
    98         struct { unsigned int x, y, button; } mouse;
    99         struct { unsigned int w, h; } resize;
    100         struct { unsigned int ch; unsigned long int utf32; char utf8[8]; } key;
     98        struct { int x, y, button; } mouse;
     99        struct { int w, h; } resize;
     100        struct { int ch; uint32_t utf32; char utf8[8]; } key;
    101101    } data;
    102102};
     
    123123        int (* end_graphics) (caca_display_t *);
    124124        int (* set_display_title) (caca_display_t *, char const *);
    125         unsigned int (* get_display_width) (caca_display_t const *);
    126         unsigned int (* get_display_height) (caca_display_t const *);
     125        int (* get_display_width) (caca_display_t const *);
     126        int (* get_display_height) (caca_display_t const *);
    127127        void (* display) (caca_display_t *);
    128128        void (* handle_resize) (caca_display_t *);
     
    135135    struct mouse
    136136    {
    137         unsigned int x, y;
     137        int x, y;
    138138    } mouse;
    139139
     
    143143        int resized;   /* A resize event was requested */
    144144        int allow;     /* The display driver allows resizing */
    145         unsigned w, h; /* Requested width and height */
     145        int w, h; /* Requested width and height */
    146146    } resize;
    147147
    148148    /* Framerate handling */
    149     unsigned int delay, rendertime;
     149    int delay, rendertime;
    150150    caca_timer_t timer;
    151151    int lastticks;
     
    159159#if defined(USE_SLANG) || defined(USE_NCURSES)
    160160        caca_timer_t key_timer;
    161         unsigned int last_key_ticks;
    162         unsigned int autorepeat_ticks;
     161        int last_key_ticks;
     162        int autorepeat_ticks;
    163163        caca_privevent_t last_key_event;
    164164#endif
    165165#if defined(USE_WIN32)
    166         unsigned char not_empty_struct;
     166        uint8_t not_empty_struct;
    167167#endif
    168168    } events;
     
    170170
    171171/* Internal timer functions */
    172 extern void _caca_sleep(unsigned int);
    173 extern unsigned int _caca_getticks(caca_timer_t *);
     172extern void _caca_sleep(int);
     173extern int _caca_getticks(caca_timer_t *);
    174174
    175175/* Internal event functions */
Note: See TracChangeset for help on using the changeset viewer.