Ignore:
Timestamp:
Nov 24, 2007, 12:08:21 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Added as many "const" qualifiers as possible to the public API.
Location:
libcaca/trunk/caca
Files:
12 edited

Legend:

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

    r2039 r2043  
    193193__extern int caca_refresh_display(caca_display_t *);
    194194__extern int caca_set_display_time(caca_display_t *, unsigned int);
    195 __extern unsigned int caca_get_display_time(caca_display_t *);
    196 __extern unsigned int caca_get_display_width(caca_display_t *);
    197 __extern unsigned int caca_get_display_height(caca_display_t *);
     195__extern unsigned int caca_get_display_time(caca_display_t const *);
     196__extern unsigned int caca_get_display_width(caca_display_t const *);
     197__extern unsigned int caca_get_display_height(caca_display_t const *);
    198198__extern int caca_set_display_title(caca_display_t *, char const *);
    199199/*  @} */
     
    207207__extern int caca_get_event(caca_display_t *, unsigned int,
    208208                            caca_event_t *, int);
    209 __extern unsigned int caca_get_mouse_x(caca_display_t *);
    210 __extern unsigned int caca_get_mouse_y(caca_display_t *);
     209__extern unsigned int caca_get_mouse_x(caca_display_t const *);
     210__extern unsigned int caca_get_mouse_y(caca_display_t const *);
    211211__extern int caca_set_mouse(caca_display_t *, int);
    212212__extern int caca_set_cursor(caca_display_t *, int);
  • libcaca/trunk/caca/caca_internals.h

    r1462 r2043  
    109109        int (* end_graphics) (caca_display_t *);
    110110        int (* set_display_title) (caca_display_t *, char const *);
    111         unsigned int (* get_display_width) (caca_display_t *);
    112         unsigned int (* get_display_height) (caca_display_t *);
     111        unsigned int (* get_display_width) (caca_display_t const *);
     112        unsigned int (* get_display_height) (caca_display_t const *);
    113113        void (* display) (caca_display_t *);
    114114        void (* handle_resize) (caca_display_t *);
  • libcaca/trunk/caca/driver_conio.c

    r2040 r2043  
    8484}
    8585
    86 static unsigned int conio_get_display_width(caca_display_t *dp)
     86static unsigned int conio_get_display_width(caca_display_t const *dp)
    8787{
    8888    /* Fallback to a 6x10 font */
     
    9090}
    9191
    92 static unsigned int conio_get_display_height(caca_display_t *dp)
     92static unsigned int conio_get_display_height(caca_display_t const *dp)
    9393{
    9494    /* Fallback to a 6x10 font */
  • libcaca/trunk/caca/driver_gl.c

    r2040 r2043  
    198198}
    199199
    200 static unsigned int gl_get_display_width(caca_display_t *dp)
     200static unsigned int gl_get_display_width(caca_display_t const *dp)
    201201{
    202202    return dp->drv.p->width;
    203203}
    204204
    205 static unsigned int gl_get_display_height(caca_display_t *dp)
     205static unsigned int gl_get_display_height(caca_display_t const *dp)
    206206{
    207207    return dp->drv.p->height;
  • libcaca/trunk/caca/driver_ncurses.c

    r2040 r2043  
    327327}
    328328
    329 static unsigned int ncurses_get_display_width(caca_display_t *dp)
     329static unsigned int ncurses_get_display_width(caca_display_t const *dp)
    330330{
    331331    /* Fallback to a 6x10 font */
     
    333333}
    334334
    335 static unsigned int ncurses_get_display_height(caca_display_t *dp)
     335static unsigned int ncurses_get_display_height(caca_display_t const *dp)
    336336{
    337337    /* Fallback to a 6x10 font */
  • libcaca/trunk/caca/driver_raw.c

    r2040 r2043  
    5656}
    5757
    58 static unsigned int raw_get_display_width(caca_display_t *dp)
     58static unsigned int raw_get_display_width(caca_display_t const *dp)
    5959{
    6060    return 0;
    6161}
    6262
    63 static unsigned int raw_get_display_height(caca_display_t *dp)
     63static unsigned int raw_get_display_height(caca_display_t const *dp)
    6464{
    6565    return 0;
  • libcaca/trunk/caca/driver_slang.c

    r2040 r2043  
    194194}
    195195
    196 static unsigned int slang_get_display_width(caca_display_t *dp)
     196static unsigned int slang_get_display_width(caca_display_t const *dp)
    197197{
    198198    /* Fallback to a 6x10 font */
     
    200200}
    201201
    202 static unsigned int slang_get_display_height(caca_display_t *dp)
     202static unsigned int slang_get_display_height(caca_display_t const *dp)
    203203{
    204204    /* Fallback to a 6x10 font */
  • libcaca/trunk/caca/driver_vga.c

    r2040 r2043  
    102102}
    103103
    104 static unsigned int vga_get_display_width(caca_display_t *dp)
     104static unsigned int vga_get_display_width(caca_display_t const *dp)
    105105{
    106106    /* Fallback to a 320x200 screen */
     
    108108}
    109109
    110 static unsigned int vga_get_display_height(caca_display_t *dp)
     110static unsigned int vga_get_display_height(caca_display_t const *dp)
    111111{
    112112    /* Fallback to a 320x200 screen */
  • libcaca/trunk/caca/driver_win32.c

    r2040 r2043  
    172172}
    173173
    174 static unsigned int win32_get_display_width(caca_display_t *dp)
     174static unsigned int win32_get_display_width(caca_display_t const *dp)
    175175{
    176176    /* FIXME */
     
    180180}
    181181
    182 static unsigned int win32_get_display_height(caca_display_t *dp)
     182static unsigned int win32_get_display_height(caca_display_t const *dp)
    183183{
    184184    /* FIXME */
  • libcaca/trunk/caca/driver_x11.c

    r2040 r2043  
    275275}
    276276
    277 static unsigned int x11_get_display_width(caca_display_t *dp)
     277static unsigned int x11_get_display_width(caca_display_t const *dp)
    278278{
    279279    return dp->cv->width * dp->drv.p->font_width;
    280280}
    281281
    282 static unsigned int x11_get_display_height(caca_display_t *dp)
     282static unsigned int x11_get_display_height(caca_display_t const *dp)
    283283{
    284284    return dp->cv->height * dp->drv.p->font_height;
  • libcaca/trunk/caca/event.c

    r1556 r2043  
    126126 *  \return The X mouse coordinate.
    127127 */
    128 unsigned int caca_get_mouse_x(caca_display_t *dp)
     128unsigned int caca_get_mouse_x(caca_display_t const *dp)
    129129{
    130130    if(dp->mouse.x >= dp->cv->width)
    131         dp->mouse.x = dp->cv->width - 1;
     131        return dp->cv->width - 1;
    132132
    133133    return dp->mouse.x;
     
    146146 *  \return The Y mouse coordinate.
    147147 */
    148 unsigned int caca_get_mouse_y(caca_display_t *dp)
     148unsigned int caca_get_mouse_y(caca_display_t const *dp)
    149149{
    150150    if(dp->mouse.y >= dp->cv->height)
    151         dp->mouse.y = dp->cv->height - 1;
     151        return dp->cv->height - 1;
    152152
    153153    return dp->mouse.y;
  • libcaca/trunk/caca/graphics.c

    r2040 r2043  
    6565 *  \return The display width.
    6666 */
    67 unsigned int caca_get_display_width(caca_display_t *dp)
     67unsigned int caca_get_display_width(caca_display_t const *dp)
    6868{
    6969    return dp->drv.get_display_width(dp);
     
    8282 *  \return The display height.
    8383 */
    84 unsigned int caca_get_display_height(caca_display_t *dp)
     84unsigned int caca_get_display_height(caca_display_t const *dp)
    8585{
    8686    return dp->drv.get_display_height(dp);
     
    121121 *  \return The render time in microseconds.
    122122 */
    123 unsigned int caca_get_display_time(caca_display_t *dp)
     123unsigned int caca_get_display_time(caca_display_t const *dp)
    124124{
    125125    return dp->rendertime;
Note: See TracChangeset for help on using the changeset viewer.