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/graphics.c

    r2299 r2305  
    6363 *  \return The display width.
    6464 */
    65 unsigned int caca_get_display_width(caca_display_t const *dp)
     65int caca_get_display_width(caca_display_t const *dp)
    6666{
    6767    return dp->drv.get_display_width(dp);
     
    8080 *  \return The display height.
    8181 */
    82 unsigned int caca_get_display_height(caca_display_t const *dp)
     82int caca_get_display_height(caca_display_t const *dp)
    8383{
    8484    return dp->drv.get_display_height(dp);
     
    9494 *  default behaviour.
    9595 *
    96  *  This function never fails.
     96 *  If an error occurs, -1 is returned and \b errno is set accordingly:
     97 *  - \c EINVAL Refresh delay value is invalid.
    9798 *
    9899 *  \param dp The libcaca display context.
    99100 *  \param usec The refresh delay in microseconds.
    100  *  \return This function always returns 0.
    101  */
    102 int caca_set_display_time(caca_display_t *dp, unsigned int usec)
    103 {
     101 *  \return 0 upon success, -1 if an error occurred.
     102 */
     103int caca_set_display_time(caca_display_t *dp, int usec)
     104{
     105    if(usec < 0)
     106    {
     107        seterrno(EINVAL);
     108        return -1;
     109    }
     110
    104111    dp->delay = usec;
    105112    return 0;
     
    119126 *  \return The render time in microseconds.
    120127 */
    121 unsigned int caca_get_display_time(caca_display_t const *dp)
     128int caca_get_display_time(caca_display_t const *dp)
    122129{
    123130    return dp->rendertime;
Note: See TracChangeset for help on using the changeset viewer.