Ignore:
Timestamp:
Apr 19, 2008, 9:25:52 PM (13 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/driver_cocoa.m

    r2138 r2305  
    6363    //NSFont* _font;
    6464    NSRect _font_rect;
    65     unsigned int _h, _w;
     65    int _h, _w;
    6666    uint32_t* _attrs;
    6767    uint32_t* _chars;
     
    100100
    101101#ifdef PRECACHE_WHOLE_COLOR_TABLE
    102     unsigned int i;
     102    int i;
    103103    for(i = 0; i < NCOLORS; i++)
    104104        _colorCache[i] = [[NSColor colorFromRgb12:i] retain];
     
    126126    //[_font release];
    127127#ifdef PRECACHE_WHOLE_COLOR_TABLE
    128     unsigned short i;
     128    short i;
    129129    for(i = 0; i < NCOLORS; i++)
    130130        [_colorCache[i] release];
     
    249249    }
    250250
    251     unsigned int x, y;
     251    int x, y;
    252252    float fw = _font_rect.size.width;
    253253    float fh = _font_rect.size.height;
     
    259259    NSRectFill(rect);
    260260
    261     unsigned int arrayLength = 0;
     261    int arrayLength = 0;
    262262    for(y = 0; y < _h; y++)
    263263    {
    264         unsigned int yoff = y * fh;
     264        int yoff = y * fh;
    265265        for(x = 0; x < _w; x++)
    266266        {
     
    308308    for(y = 0; y < _h; y++)
    309309    {
    310         unsigned int yoff = y * fh;
     310        int yoff = y * fh;
    311311        for(x = 0; x < _w; x++, chars++)
    312312        {
     
    598598}
    599599
    600 static unsigned int get_caca_keycode(NSEvent* event)
    601 {
    602     unsigned int caca_keycode = 0;
     600static int get_caca_keycode(NSEvent* event)
     601{
     602    int caca_keycode = 0;
    603603    /*
    604604    unsigned short mac_keycode = [event keyCode];
     
    748748    }
    749749
    750     unsigned int caca_keycode = get_caca_keycode(event);
     750    int caca_keycode = get_caca_keycode(event);
    751751    if(caca_keycode)
    752752    {
     
    801801        {
    802802            NSPoint mouseLoc = [NSEvent mouseLocation];
    803             unsigned int mouse_x = round(mouseLoc.x);
    804             unsigned int mouse_y = round(mouseLoc.y);
     803            int mouse_x = round(mouseLoc.x);
     804            int mouse_y = round(mouseLoc.y);
    805805            if(dp->mouse.x == mouse_x && dp->mouse.y == mouse_y)
    806806                break;
     
    827827static int cocoa_init_graphics(caca_display_t *dp)
    828828{
    829     unsigned int width = cucul_get_canvas_width(dp->cv);
    830     unsigned int height = cucul_get_canvas_height(dp->cv);
     829    int width = cucul_get_canvas_width(dp->cv);
     830    int height = cucul_get_canvas_height(dp->cv);
    831831
    832832    debug_log(@"%s dp->cv: %ux%u", __PRETTY_FUNCTION__, width, height);
     
    971971}
    972972
    973 static unsigned int cocoa_get_display_width(caca_display_t const *dp)
     973static int cocoa_get_display_width(caca_display_t const *dp)
    974974{
    975975    return [dp->drv.p->window frame].size.width;
    976976}
    977977
    978 static unsigned int cocoa_get_display_height(caca_display_t const *dp)
     978static int cocoa_get_display_height(caca_display_t const *dp)
    979979{
    980980    return [dp->drv.p->window frame].size.height;
Note: See TracChangeset for help on using the changeset viewer.