Changeset 2313


Ignore:
Timestamp:
Apr 23, 2008, 11:24:34 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Switch a few unsigned int variables to size_t where appropriate.
  • Synchronise parameter types in the C++ bindings with the C API.
Location:
libcaca/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/import.c

    r2304 r2313  
    223223{
    224224    uint8_t const *buf = (uint8_t const *)data;
    225     unsigned int control_size, data_size, expected_size, frames, f, n;
     225    size_t control_size, data_size, expected_size;
     226    unsigned int frames, f, n, offset;
    226227    uint16_t version, flags;
    227     unsigned int offset;
    228228    int32_t xmin = 0, ymin = 0, xmax = 0, ymax = 0;
    229229
     
    248248    if(control_size < 16 + frames * 32)
    249249    {
    250         debug("caca import error: control size %lu < expected %lu",
    251               (unsigned long int)control_size, 16 + frames * 32);
     250        debug("caca import error: control size %u < expected %u",
     251              (unsigned int)control_size, 16 + frames * 32);
    252252        goto invalid_caca;
    253253    }
     
    280280    if(expected_size != data_size)
    281281    {
    282         debug("caca import error: data size %lu < expected %lu",
    283               (unsigned long int)data_size, (unsigned long int)expected_size);
     282        debug("caca import error: data size %u < expected %u",
     283              (unsigned int)data_size, (unsigned int)expected_size);
    284284        goto invalid_caca;
    285285    }
  • libcaca/trunk/cucul/triangle.c

    r2303 r2313  
    9191{
    9292    int x, y, xmin, xmax, ymin, ymax;
    93     long int xx1, xx2, xa, xb, sl21, sl31, sl32;
     93    int xx1, xx2, xa, xb, sl21, sl31, sl32;
    9494
    9595    /* Bubble-sort y1 <= y2 <= y3 */
     
    110110
    111111    ymin = y1 < 0 ? 0 : y1;
    112     ymax = y3 + 1 < (int)cv->height ? y3 + 1 : (int)cv->height;
     112    ymax = y3 + 1 < cv->height ? y3 + 1 : cv->height;
    113113
    114114    if(ymin < y2)
     
    144144
    145145        xmin = xx1 < 0 ? 0 : xx1;
    146         xmax = xx2 + 1 < (int)cv->width ? xx2 + 1 : (int)cv->width;
     146        xmax = xx2 + 1 < cv->width ? xx2 + 1 : cv->width;
    147147
    148148        for(x = xmin; x < xmax; x++)
  • libcaca/trunk/cxx/cucul++.cpp

    r2304 r2313  
    280280}
    281281
    282 long int Cucul::importMemory(void const *buf, unsigned long int len, char const *fmt)
     282long int Cucul::importMemory(void const *buf, size_t len, char const *fmt)
    283283{
    284284    return cucul_import_memory(cv, buf, len, fmt);
     
    295295}
    296296
    297 void *Cucul::exportMemory(char const *fmt, unsigned long int *len)
     297void *Cucul::exportMemory(char const *fmt, size_t *len)
    298298{
    299299    return cucul_export_memory(cv, fmt, len);
     
    309309}
    310310
    311 void Dither::setPalette(unsigned int r[], unsigned int g[], unsigned int b[], unsigned int a[])
     311void Dither::setPalette(uint32_t r[], uint32_t g[], uint32_t b[], uint32_t a[])
    312312{
    313313    cucul_set_dither_palette(dither, r, g, b, a);
  • libcaca/trunk/cxx/cucul++.h

    r2304 r2313  
    6969    ~Dither();
    7070
    71     void setPalette(unsigned int r[], unsigned int g[],
    72                     unsigned int b[], unsigned int a[]);
     71    void setPalette(uint32_t r[], uint32_t g[],
     72                    uint32_t b[], uint32_t a[]);
    7373    void setBrightness(float);
    7474    void setGamma(float);
     
    137137
    138138    char const * const * getImportList(void);
    139     long int importMemory(void const *, unsigned long int, char const *);
     139    long int importMemory(void const *, size_t, char const *);
    140140    long int importFile(char const *, char const *);
    141141    char const * const * getExportList(void);
    142     void *exportMemory(char const *, unsigned long int *);
     142    void *exportMemory(char const *, size_t *);
    143143
    144144    static int Rand(int, int);
    145145    static char const * getVersion();
     146
    146147 protected:
    147148    cucul_canvas_t *get_cucul_canvas_t();
  • libcaca/trunk/examples/export.c

    r2299 r2313  
    3535    char *file, *format;
    3636    char const * const * exports, * const * p;
    37     unsigned long int len;
     37    size_t len;
    3838    int x, y;
    3939
  • libcaca/trunk/examples/figfont.c

    r2299 r2313  
    2626    cucul_canvas_t *cv;
    2727    void *buffer;
    28     unsigned long int len;
     28    size_t len;
    2929    uint8_t color = 0;
    3030
  • libcaca/trunk/examples/spritedit.c

    r2299 r2313  
    5050{
    5151    cucul_canvas_t *sprite;
    52     unsigned long int len;
     52    size_t len;
    5353    void *buffer;
    5454    int i;
  • libcaca/trunk/src/cacaserver.c

    r2300 r2313  
    113113    cucul_canvas_t *canvas;
    114114    void *buffer;
    115     unsigned long int buflen;
     115    size_t buflen;
    116116
    117117    int client_count;
     
    223223        for(;;)
    224224        {
    225             long int needed;
    226             ssize_t wanted;
     225            ssize_t needed, wanted;
    227226
    228227            needed = cucul_import_memory(server->canvas, server->input,
     
    244243            server->read += wanted;
    245244        }
    246            
     245
    247246        /* Free the previous export buffer, if any */
    248247        if(server->buffer)
  • libcaca/trunk/src/img2txt.c

    r2299 r2313  
    9696    cucul_canvas_t *cv;
    9797    void *export;
    98     unsigned long int len;
     98    size_t len;
    9999    struct image *i;
    100100    unsigned int cols = 0, lines = 0, font_width = 6, font_height = 10;
Note: See TracChangeset for help on using the changeset viewer.