Ignore:
Timestamp:
Apr 19, 2008, 9:25:41 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Changed most of the long ints in the API into C99 types. WARNING: this completely breaks compatibility with previous versions of libcaca on 64-bit systems.
Location:
libcaca/trunk/cxx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cxx/cucul++.cpp

    r2074 r2303  
    2626
    2727
    28 unsigned long int Charset::utf8ToUtf32(char const *s, unsigned int *read)
     28uint32_t Charset::utf8ToUtf32(char const *s, unsigned int *read)
    2929{
    3030    return cucul_utf8_to_utf32(s, read);
    3131}
    32 unsigned int Charset::utf32ToUtf8(char *buf, unsigned long int ch)
     32unsigned int Charset::utf32ToUtf8(char *buf, uint32_t ch)
    3333{
    3434    return cucul_utf32_to_utf8(buf, ch);
    3535}
    36 unsigned char Charset::utf32ToCp437(unsigned long int ch)
     36uint8_t Charset::utf32ToCp437(uint32_t ch)
    3737{
    3838    return cucul_utf32_to_cp437(ch);
    3939}
    40 unsigned long int Charset::cp437ToUtf32(unsigned char ch)
     40uint32_t Charset::cp437ToUtf32(uint8_t ch)
    4141{
    4242    return cucul_cp437_to_utf32(ch);
     
    8383}
    8484
    85 int Cucul::setColorANSI(unsigned char f, unsigned char b)
     85int Cucul::setColorANSI(uint8_t f, uint8_t b)
    8686{
    8787    return cucul_set_color_ansi(cv, f, b);
     
    9393}
    9494
    95 void Cucul::putChar(int x, int y, unsigned long int ch)
     95void Cucul::putChar(int x, int y, uint32_t ch)
    9696{
    9797    cucul_put_char(cv, x, y, ch);
    9898}
    9999
    100 unsigned long int Cucul::getChar(int x, int y)
     100uint32_t Cucul::getChar(int x, int y)
    101101{
    102102    return cucul_get_char(cv, x, y);
     
    157157}
    158158
    159 void Cucul::drawLine(int x1, int y1, int x2, int y2, unsigned long int ch)
     159void Cucul::drawLine(int x1, int y1, int x2, int y2, uint32_t ch)
    160160{
    161161    cucul_draw_line(cv, x1, y1, x2, y2, ch);
    162162}
    163163
    164 void Cucul::drawPolyline(int const x[], int const y[], int f, unsigned long int ch)
     164void Cucul::drawPolyline(int const x[], int const y[], int f, uint32_t ch)
    165165{
    166166    cucul_draw_polyline(cv, x, y, f, ch);
     
    177177}
    178178
    179 void Cucul::drawCircle(int x, int y, int d, unsigned long int ch)
     179void Cucul::drawCircle(int x, int y, int d, uint32_t ch)
    180180{
    181181    cucul_draw_circle(cv, x, y, d, ch);
    182182}
    183183
    184 void Cucul::drawEllipse(int x, int y, int d1, int d2, unsigned long int ch)
     184void Cucul::drawEllipse(int x, int y, int d1, int d2, uint32_t ch)
    185185{
    186186    cucul_draw_ellipse(cv, x, y, d1, d2, ch);
     
    192192}
    193193
    194 void Cucul::fillEllipse(int x, int y, int d1, int d2, unsigned long int ch)
     194void Cucul::fillEllipse(int x, int y, int d1, int d2, uint32_t ch)
    195195{
    196196    cucul_fill_ellipse(cv, x, y, d1, d2, ch);
    197197}
    198198
    199 void Cucul::drawBox(int x, int y, int w, int h, unsigned long int ch)
     199void Cucul::drawBox(int x, int y, int w, int h, uint32_t ch)
    200200{
    201201    cucul_draw_box(cv, x, y, w, h, ch);
     
    212212}
    213213
    214 void Cucul::fillBox(int x, int y, int w, int h, unsigned long int ch)
     214void Cucul::fillBox(int x, int y, int w, int h, uint32_t ch)
    215215{
    216216    cucul_fill_box(cv, x, y, w, h, ch);
    217217}
    218218
    219 void Cucul::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, unsigned long int ch)
     219void Cucul::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch)
    220220{
    221221    cucul_draw_triangle(cv, x1, y1, x2, y2, x3, y3, ch);
     
    227227}
    228228
    229 void Cucul::fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, unsigned long int ch)
     229void Cucul::fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t ch)
    230230{
    231231    cucul_fill_triangle(cv, x1, y1, x2, y2, x3, y3, ch);
     
    242242}
    243243
    244 int Cucul::setAttr(unsigned long int attr)
     244int Cucul::setAttr(uint32_t attr)
    245245{
    246246    return cucul_set_attr(cv, attr);
    247247}
    248248
    249 unsigned long int Cucul::getAttr(int x, int y)
     249uint32_t Cucul::getAttr(int x, int y)
    250250{
    251251    return cucul_get_attr(cv, x, y);
     
    395395}
    396396
    397 void Font::renderCanvas(Cucul *cv, unsigned char *buf, unsigned int x, unsigned int y, unsigned int w)
     397void Font::renderCanvas(Cucul *cv, uint8_t *buf, unsigned int x, unsigned int y, unsigned int w)
    398398{
    399399    cucul_render_canvas(cv->get_cucul_canvas_t(), font, buf, x, y, w);
    400400}
    401401
    402 unsigned long int const *Font::getBlocks()
     402uint32_t const *Font::getBlocks()
    403403{
    404404    return cucul_get_font_blocks(font);
  • libcaca/trunk/cxx/cucul++.h

    r2074 r2303  
    3939{
    4040 public:
    41     unsigned long int utf8ToUtf32(char const *, unsigned int *);
    42     unsigned int utf32ToUtf8(char *, unsigned long int);
    43     unsigned char utf32ToCp437(unsigned long int);
    44     unsigned long int cp437ToUtf32(unsigned char);
     41    uint32_t utf8ToUtf32(char const *, unsigned int *);
     42    unsigned int utf32ToUtf8(char *, uint32_t);
     43    uint8_t utf32ToCp437(uint32_t);
     44    uint32_t cp437ToUtf32(uint8_t);
    4545};
    4646
     
    5454    unsigned int getWidth();
    5555    unsigned int getHeight();
    56     void renderCanvas(Cucul *, unsigned char *, unsigned int,
     56    void renderCanvas(Cucul *, uint8_t *, unsigned int,
    5757                               unsigned int, unsigned int);
    58     unsigned long int const *getBlocks();
     58    uint32_t const *getBlocks();
    5959
    6060 private:
     
    101101    unsigned int getWidth(void);
    102102    unsigned int getHeight(void);
    103     unsigned long int getAttr(int, int);
    104     int setAttr(unsigned long int);
    105     int setColorANSI(unsigned char f, unsigned char b);
     103    uint32_t getAttr(int, int);
     104    int setAttr(uint32_t);
     105    int setColorANSI(uint8_t f, uint8_t b);
    106106    int setColorARGB(unsigned int f, unsigned int b);
    107107    void Printf(int x, int y , char const * format, ...);
    108     void putChar(int x, int y, unsigned long int ch);
    109     unsigned long int getChar(int, int);
     108    void putChar(int x, int y, uint32_t ch);
     109    uint32_t getChar(int, int);
    110110    void putStr(int x, int y, char *str);
    111111    void Clear(void);
     
    115115    void Flop();
    116116    void Rotate();
    117     void drawLine(int, int, int, int, unsigned long int);
    118     void drawPolyline(int const x[], int const y[], int, unsigned long int);
     117    void drawLine(int, int, int, int, uint32_t);
     118    void drawPolyline(int const x[], int const y[], int, uint32_t);
    119119    void drawThinLine(int, int, int, int);
    120120    void drawThinPolyline(int const x[], int const y[], int);
    121     void drawCircle(int, int, int, unsigned long int);
    122     void drawEllipse(int, int, int, int, unsigned long int);
     121    void drawCircle(int, int, int, uint32_t);
     122    void drawEllipse(int, int, int, int, uint32_t);
    123123    void drawThinEllipse(int, int, int, int);
    124     void fillEllipse(int, int, int, int, unsigned long int);
    125     void drawBox(int, int, int, int, unsigned long int);
     124    void fillEllipse(int, int, int, int, uint32_t);
     125    void drawBox(int, int, int, int, uint32_t);
    126126    void drawThinBox(int, int, int, int);
    127127    void drawCP437Box(int, int, int, int);
    128     void fillBox(int, int, int, int, unsigned long int);
    129     void drawTriangle(int, int, int, int, int, int, unsigned long int);
     128    void fillBox(int, int, int, int, uint32_t);
     129    void drawTriangle(int, int, int, int, int, int, uint32_t);
    130130    void drawThinTriangle(int, int, int, int, int, int);
    131     void fillTriangle(int, int, int, int, int, int, unsigned long int);
     131    void fillTriangle(int, int, int, int, int, int, uint32_t);
    132132    int setBoundaries(cucul_canvas_t *, int, int, unsigned int, unsigned int);
    133133    unsigned int getFrameCount();
Note: See TracChangeset for help on using the changeset viewer.