Changeset 2300 for libcaca


Ignore:
Timestamp:
Apr 19, 2008, 4:07:50 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Changed most "unsigned char" variables into "uint8_t", including in prototypes. As they are equivalent, this does not break the ABI.
Location:
libcaca/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r2188 r2300  
    8484        struct { unsigned int ch; unsigned long int utf32; char utf8[8]; } key;
    8585    } data;
    86     unsigned char padding[16];
     86    uint8_t padding[16];
    8787};
    8888
  • libcaca/trunk/caca/driver_conio.c

    r2299 r2300  
    136136static int conio_get_event(caca_display_t *dp, caca_privevent_t *ev)
    137137{
    138     unsigned char ch;
     138    uint8_t ch;
    139139    caca_privevent_t release;
    140140
     
    149149    ev->type = CACA_EVENT_KEY_PRESS;
    150150    ev->data.key.ch = ch;
    151     ev->data.key.utf32 = (uint32_t)ch;
     151    ev->data.key.utf32 = ch;
    152152    ev->data.key.utf8[0] = ch;
    153153    ev->data.key.utf8[1] = '\0';
  • libcaca/trunk/caca/driver_gl.c

    r2299 r2300  
    7171    unsigned long int const *blocks;
    7272    int *txid;
    73     unsigned char close;
    74     unsigned char bit;
    75     unsigned char mouse_changed, mouse_clicked;
     73    uint8_t close;
     74    uint8_t bit;
     75    uint8_t mouse_changed, mouse_clicked;
    7676    unsigned int mouse_x, mouse_y;
    7777    unsigned int mouse_button, mouse_state;
    7878
    79     unsigned char key;
     79    uint8_t key;
    8080    int special_key;
    8181
  • libcaca/trunk/cucul/attr.c

    r2299 r2300  
    182182 *  \return 0 in case of success, -1 if an error occurred.
    183183 */
    184 int cucul_set_color_ansi(cucul_canvas_t *cv, unsigned char fg, unsigned char bg)
     184int cucul_set_color_ansi(cucul_canvas_t *cv, uint8_t fg, uint8_t bg)
    185185{
    186186    uint32_t attr;
     
    258258 *  \return The corresponding DOS ANSI value.
    259259 */
    260 unsigned char cucul_attr_to_ansi(unsigned long int attr)
     260uint8_t cucul_attr_to_ansi(unsigned long int attr)
    261261{
    262262    uint8_t fg = nearest_ansi((attr >> 4) & 0x3fff);
     
    282282 *  \return The corresponding ANSI foreground value.
    283283 */
    284 unsigned char cucul_attr_to_ansi_fg(unsigned long int attr)
     284uint8_t cucul_attr_to_ansi_fg(unsigned long int attr)
    285285{
    286286    return nearest_ansi(((uint16_t)attr >> 4) & 0x3fff);
     
    302302 *  \return The corresponding ANSI background value.
    303303 */
    304 unsigned char cucul_attr_to_ansi_bg(unsigned long int attr)
     304uint8_t cucul_attr_to_ansi_bg(unsigned long int attr)
    305305{
    306306    return nearest_ansi(attr >> 18);
     
    388388 *  \param argb An array of 8-bit integers.
    389389 */
    390 void cucul_attr_to_argb64(unsigned long int attr, unsigned char argb[8])
     390void cucul_attr_to_argb64(unsigned long int attr, uint8_t argb[8])
    391391{
    392392    uint16_t fg = (attr >> 4) & 0x3fff;
  • libcaca/trunk/cucul/charset.c

    r2299 r2300  
    191191 *  \return The corresponding CP437 character, or "?" if not representable.
    192192 */
    193 unsigned char cucul_utf32_to_cp437(unsigned long int ch)
     193uint8_t cucul_utf32_to_cp437(unsigned long int ch)
    194194{
    195195    unsigned int i;
     
    223223 *  \return The corresponding UTF-32 character, or zero if not representable.
    224224 */
    225 unsigned long int cucul_cp437_to_utf32(unsigned char ch)
     225unsigned long int cucul_cp437_to_utf32(uint8_t ch)
    226226{
    227227    if(ch > 0x7f)
  • libcaca/trunk/cucul/cucul.c

    r2299 r2300  
    255255 *  \return The canvas character array.
    256256 */
    257 unsigned char const * cucul_get_canvas_chars(cucul_canvas_t const *cv)
    258 {
    259     return (unsigned char const *)cv->chars;
     257uint8_t const * cucul_get_canvas_chars(cucul_canvas_t const *cv)
     258{
     259    return (uint8_t const *)cv->chars;
    260260}
    261261
     
    274274 *  \return The canvas attribute array.
    275275 */
    276 unsigned char const * cucul_get_canvas_attrs(cucul_canvas_t const *cv)
    277 {
    278     return (unsigned char const *)cv->attrs;
     276uint8_t const * cucul_get_canvas_attrs(cucul_canvas_t const *cv)
     277{
     278    return (uint8_t const *)cv->attrs;
    279279}
    280280
  • libcaca/trunk/cucul/cucul.h

    r2299 r2300  
    9494__extern unsigned int cucul_get_canvas_width(cucul_canvas_t const *);
    9595__extern unsigned int cucul_get_canvas_height(cucul_canvas_t const *);
    96 __extern unsigned char const * cucul_get_canvas_chars(cucul_canvas_t const *);
    97 __extern unsigned char const * cucul_get_canvas_attrs(cucul_canvas_t const *);
     96__extern uint8_t const * cucul_get_canvas_chars(cucul_canvas_t const *);
     97__extern uint8_t const * cucul_get_canvas_attrs(cucul_canvas_t const *);
    9898__extern int cucul_free_canvas(cucul_canvas_t *);
    9999__extern int cucul_rand(int, int);
     
    117117__extern int cucul_set_attr(cucul_canvas_t *, unsigned long int);
    118118__extern int cucul_put_attr(cucul_canvas_t *, int, int, unsigned long int);
    119 __extern int cucul_set_color_ansi(cucul_canvas_t *, unsigned char,
    120                                   unsigned char);
     119__extern int cucul_set_color_ansi(cucul_canvas_t *, uint8_t, uint8_t);
    121120__extern int cucul_set_color_argb(cucul_canvas_t *, unsigned int,
    122121                                  unsigned int);
     
    152151 *
    153152 *  @{ */
    154 __extern unsigned char cucul_attr_to_ansi(unsigned long int);
    155 __extern unsigned char cucul_attr_to_ansi_fg(unsigned long int);
    156 __extern unsigned char cucul_attr_to_ansi_bg(unsigned long int);
     153__extern uint8_t cucul_attr_to_ansi(unsigned long int);
     154__extern uint8_t cucul_attr_to_ansi_fg(unsigned long int);
     155__extern uint8_t cucul_attr_to_ansi_bg(unsigned long int);
    157156__extern unsigned int cucul_attr_to_rgb12_fg(unsigned long int);
    158157__extern unsigned int cucul_attr_to_rgb12_bg(unsigned long int);
    159 __extern void cucul_attr_to_argb64(unsigned long int, unsigned char[8]);
     158__extern void cucul_attr_to_argb64(unsigned long int, uint8_t[8]);
    160159/*  @} */
    161160
     
    167166__extern unsigned long int cucul_utf8_to_utf32(char const *, unsigned int *);
    168167__extern unsigned int cucul_utf32_to_utf8(char *, unsigned long int);
    169 __extern unsigned char cucul_utf32_to_cp437(unsigned long int);
    170 __extern unsigned long int cucul_cp437_to_utf32(unsigned char);
     168__extern uint8_t cucul_utf32_to_cp437(unsigned long int);
     169__extern unsigned long int cucul_cp437_to_utf32(uint8_t);
    171170__extern char cucul_utf32_to_ascii(unsigned long int);
    172171__extern int cucul_utf32_is_fullwidth(unsigned long int);
  • libcaca/trunk/cucul/dither.c

    r2299 r2300  
    4242#   define LOOKUP_HUE 16
    4343#endif
    44 static unsigned char hsv_distances[LOOKUP_VAL][LOOKUP_SAT][LOOKUP_HUE];
     44static uint8_t hsv_distances[LOOKUP_VAL][LOOKUP_SAT][LOOKUP_HUE];
    4545static uint16_t lookup_colors[8];
    4646static int lookup_initialised = 0;
     
    15321532        int i, distbg, distfg, dist;
    15331533        int val, sat, hue;
    1534         unsigned char outbg, outfg;
     1534        uint8_t outbg, outfg;
    15351535
    15361536        val = 0xfff * v / (LOOKUP_VAL - 1);
  • libcaca/trunk/cucul/export.c

    r2299 r2300  
    430430                    cur += sprintf(cur, " ");
    431431                else if(linechar[x + len] < 0x00000080)
    432                     cur += sprintf(cur, "%c",
    433                                    (unsigned char)linechar[x + len]);
     432                    cur += sprintf(cur, "%c", (uint8_t)linechar[x + len]);
    434433                else
    435434                    cur += sprintf(cur, "&#%i;",
     
    525524                    cur += sprintf(cur, "&nbsp;");
    526525                else if(linechar[x + i] < 0x00000080)
    527                     cur += sprintf(cur, "%c", (unsigned char)linechar[x + i]);
     526                    cur += sprintf(cur, "%c", (uint8_t)linechar[x + i]);
    528527                else
    529528                    cur += sprintf(cur, "&#%i;", (unsigned int)linechar[x + i]);
     
    854853                case '(':
    855854                case ')':
    856                     cur += sprintf(cur, "(\\%c) show\n", (unsigned char)ch);
     855                    cur += sprintf(cur, "(\\%c) show\n", (uint8_t)ch);
    857856                    break;
    858857                default:
    859                     cur += sprintf(cur, "(%c) show\n", (unsigned char)ch);
     858                    cur += sprintf(cur, "(%c) show\n", (uint8_t)ch);
    860859                    break;
    861860            }
  • libcaca/trunk/cucul/file.c

    r2299 r2300  
    4141{
    4242#   if defined HAVE_ZLIB_H
    43     unsigned char read_buffer[READSIZE];
     43    uint8_t read_buffer[READSIZE];
    4444    z_stream stream;
    4545    gzFile gz;
  • libcaca/trunk/examples/font.c

    r2299 r2300  
    3434    cucul_font_t *f;
    3535    cucul_dither_t *d;
    36     unsigned char *buf;
     36    uint8_t *buf;
    3737    unsigned int w, h;
    3838    char const * const * fonts;
  • libcaca/trunk/examples/swallow.c

    r2299 r2300  
    2929    static cucul_canvas_t *cv, *app;
    3030    static caca_display_t *dp;
    31     unsigned char *buf[4];
     31    uint8_t *buf[4];
    3232    long int bytes[4], total[4];
    3333    FILE *f[4];
  • libcaca/trunk/kernel/kernel.c

    r2299 r2300  
    191191int memcmp(const void *_s1, const void *_s2, size_t n)
    192192{
    193     unsigned char const *s1 = _s1, *s2 = _s2;
     193    uint8_t const *s1 = _s1, *s2 = _s2;
    194194
    195195    while(n--)
  • libcaca/trunk/src/cacaplay.c

    r2299 r2300  
    3232    cucul_canvas_t *cv, *app;
    3333    caca_display_t *dp;
    34     unsigned char *buf = NULL;
     34    uint8_t *buf = NULL;
    3535    long int bytes = 0, total = 0;
    3636    int fd;
  • libcaca/trunk/src/cacaserver.c

    r2299 r2300  
    150150    memcpy(server->prefix, INIT_PREFIX, sizeof(INIT_PREFIX));
    151151    tmp = strstr(server->prefix, "____");
    152     tmp[0] = (unsigned char) (server->width & 0xff00) >> 8;
    153     tmp[1] = (unsigned char) server->width & 0xff;
    154     tmp[2] = (unsigned char) (server->height & 0xff00) >> 8;
    155     tmp[3] = (unsigned char) server->height & 0xff;
     152    tmp[0] = (uint8_t) (server->width & 0xff00) >> 8;
     153    tmp[1] = (uint8_t) server->width & 0xff;
     154    tmp[2] = (uint8_t) (server->height & 0xff00) >> 8;
     155    tmp[3] = (uint8_t) server->height & 0xff;
    156156
    157157    if((server->sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1)
  • libcaca/trunk/src/common-image.c

    r2299 r2300  
    278278static unsigned int u32fread(FILE *fp)
    279279{
    280     unsigned char buffer[4];
     280    uint8_t buffer[4];
    281281    fread(buffer, 4, 1, fp);
    282282    return ((unsigned int)buffer[3] << 24) | ((unsigned int)buffer[2] << 16)
     
    286286static unsigned int u16fread(FILE *fp)
    287287{
    288     unsigned char buffer[2];
     288    uint8_t buffer[2];
    289289    fread(buffer, 2, 1, fp);
    290290    return ((unsigned int)buffer[1] << 8) | ((unsigned int)buffer[0]);
     
    293293static unsigned int u8fread(FILE *fp)
    294294{
    295     unsigned char buffer;
     295    uint8_t buffer;
    296296    fread(&buffer, 1, 1, fp);
    297297    return (unsigned int)buffer;
Note: See TracChangeset for help on using the changeset viewer.