Changeset 305


Ignore:
Timestamp:
Jan 2, 2004, 5:52:10 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • src/ examples/ test/: + Changed <const type> constructs into <type const>.
Location:
libcaca/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/examples/aafire.c

    r304 r305  
    5151static unsigned int table[MAXTABLE];
    5252#ifdef LIBCACA
    53 const static int pal[] =
     53static int const pal[] =
    5454#else
    5555__AA_CONST static int pal[] =
  • libcaca/trunk/examples/cacaview.c

    r302 r305  
    4343
    4444/* Local functions */
    45 static void load_image(const char *);
     45static void load_image(char const *);
    4646static void unload_image(void);
    4747static void draw_checkers(unsigned int, unsigned int,
     
    406406}
    407407
    408 static void load_image(const char *name)
     408static void load_image(char const *name)
    409409{
    410410#if defined(HAVE_IMLIB2_H)
  • libcaca/trunk/src/bitmap.c

    r298 r305  
    5959static void mask2shift(unsigned int, int *, int *);
    6060
    61 static void get_rgba_default(const struct caca_bitmap *, uint8_t *, int, int,
     61static void get_rgba_default(struct caca_bitmap const *, uint8_t *, int, int,
    6262                             unsigned int *, unsigned int *, unsigned int *,
    6363                             unsigned int *);
     
    242242}
    243243
    244 static void get_rgba_default(const struct caca_bitmap *bitmap, uint8_t *pixels,
     244static void get_rgba_default(struct caca_bitmap const *bitmap, uint8_t *pixels,
    245245                             int x, int y, unsigned int *r, unsigned int *g,
    246246                             unsigned int *b, unsigned int *a)
     
    261261#else
    262262            /* This is compile-time optimised with at least -O1 or -Os */
    263             const uint32_t rmask = 0x12345678;
    264             if(*(const uint8_t *)&rmask == 0x12)
     263            uint32_t const rmask = 0x12345678;
     264            if(*(uint8_t const *)&rmask == 0x12)
    265265#endif
    266266                bits = ((uint32_t)pixels[0] << 16) |
     
    340340 */
    341341void caca_draw_bitmap(int x1, int y1, int x2, int y2,
    342                       const struct caca_bitmap *bitmap, void *pixels)
     342                      struct caca_bitmap const *bitmap, void *pixels)
    343343{
    344344    /* Current dithering method */
     
    348348
    349349    /* Only used when background is black */
    350     static const int white_colors[] =
     350    static int const white_colors[] =
    351351    {
    352352        CACA_COLOR_BLACK,
     
    356356    };
    357357
    358     static const int light_colors[] =
     358    static int const light_colors[] =
    359359    {
    360360        CACA_COLOR_LIGHTMAGENTA,
     
    367367    };
    368368
    369     static const int dark_colors[] =
     369    static int const dark_colors[] =
    370370    {
    371371        CACA_COLOR_MAGENTA,
     
    380380    /* FIXME: choose better characters! */
    381381#   define DENSITY_CHARS 13
    382     static const char density_chars[] =
     382    static char const density_chars[] =
    383383        "    "
    384384        ".   "
  • libcaca/trunk/src/caca.c

    r300 r305  
    189189 *  \return A static string containing the colour's name.
    190190 */
    191 const char *caca_get_color_name(enum caca_color color)
    192 {
    193     static const char *color_names[] =
     191char const *caca_get_color_name(enum caca_color color)
     192{
     193    static char const *color_names[] =
    194194    {
    195195        "black",
     
    292292 *  \return A static string containing the feature's name.
    293293 */
    294 const char *caca_get_feature_name(enum caca_feature feature)
     294char const *caca_get_feature_name(enum caca_feature feature)
    295295{
    296296    switch(feature)
  • libcaca/trunk/src/caca.h

    r298 r305  
    223223enum caca_feature caca_get_feature(enum caca_feature);
    224224void caca_set_feature(enum caca_feature);
    225 const char *caca_get_feature_name(enum caca_feature);
     225char const *caca_get_feature_name(enum caca_feature);
    226226unsigned int caca_get_rendertime(void);
    227227unsigned int caca_get_width(void);
     
    249249enum caca_color caca_get_fg_color(void);
    250250enum caca_color caca_get_bg_color(void);
    251 const char *caca_get_color_name(enum caca_color);
     251char const *caca_get_color_name(enum caca_color);
    252252void caca_putchar(int, int, char);
    253 void caca_putstr(int, int, const char *);
    254 void caca_printf(int, int, const char *, ...);
     253void caca_putstr(int, int, char const *);
     254void caca_printf(int, int, char const *, ...);
    255255void caca_clear(void);
    256256/*  @} */
     
    263263 *  @{ */
    264264void caca_draw_line(int, int, int, int, char);
    265 void caca_draw_polyline(const int x[], const int y[], int, char);
     265void caca_draw_polyline(int const x[], int const y[], int, char);
    266266void caca_draw_thin_line(int, int, int, int);
    267 void caca_draw_thin_polyline(const int x[], const int y[], int);
     267void caca_draw_thin_polyline(int const x[], int const y[], int);
    268268
    269269void caca_draw_circle(int, int, int, char);
     
    297297 *  @{ */
    298298struct caca_sprite;
    299 struct caca_sprite * caca_load_sprite(const char *);
    300 int caca_get_sprite_frames(const struct caca_sprite *);
    301 int caca_get_sprite_width(const struct caca_sprite *, int);
    302 int caca_get_sprite_height(const struct caca_sprite *, int);
    303 int caca_get_sprite_dx(const struct caca_sprite *, int);
    304 int caca_get_sprite_dy(const struct caca_sprite *, int);
    305 void caca_draw_sprite(int, int, const struct caca_sprite *, int);
     299struct caca_sprite * caca_load_sprite(char const *);
     300int caca_get_sprite_frames(struct caca_sprite const *);
     301int caca_get_sprite_width(struct caca_sprite const *, int);
     302int caca_get_sprite_height(struct caca_sprite const *, int);
     303int caca_get_sprite_dx(struct caca_sprite const *, int);
     304int caca_get_sprite_dy(struct caca_sprite const *, int);
     305void caca_draw_sprite(int, int, struct caca_sprite const *, int);
    306306void caca_free_sprite(struct caca_sprite *);
    307307/*  @} */
     
    321321                             unsigned int r[], unsigned int g[],
    322322                             unsigned int b[], unsigned int a[]);
    323 void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, void *);
     323void caca_draw_bitmap(int, int, int, int, struct caca_bitmap const *, void *);
    324324void caca_free_bitmap(struct caca_bitmap *);
    325325/*  @} */
  • libcaca/trunk/src/graphics.c

    r303 r305  
    7676#if defined(USE_SLANG)
    7777/* Tables generated by test/optipal.c */
    78 const static int slang_palette[2*16*16] =
     78static int const slang_palette[2*16*16] =
    7979{
    8080     1,  0,   2,  0,   3,  0,   4,  0,   5,  0,   6,  0,   7,  0,   8,  0,
     
    112112};
    113113
    114 const static int slang_assoc[16*16] =
     114static int const slang_assoc[16*16] =
    115115{
    116116    134, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
     
    337337 *  \param s The string to print.
    338338 */
    339 void caca_putstr(int x, int y, const char *s)
     339void caca_putstr(int x, int y, char const *s)
    340340{
    341341#if defined(USE_CONIO) | defined(USE_X11)
     
    429429 *  \param ... Arguments to the format string.
    430430 */
    431 void caca_printf(int x, int y, const char *format, ...)
     431void caca_printf(int x, int y, char const *format, ...)
    432432{
    433433    char tmp[BUFSIZ];
     
    603603        XSetWindowAttributes x11_winattr;
    604604        int (*old_error_handler)(Display *, XErrorEvent *);
    605         const char *font_name = "8x13bold";
     605        char const *font_name = "8x13bold";
    606606        int i;
    607607
  • libcaca/trunk/src/line.c

    r298 r305  
    8989 * \return void
    9090 */
    91 void caca_draw_polyline(const int x[], const int y[], int n, char c)
     91void caca_draw_polyline(int const x[], int const y[], int n, char c)
    9292{
    9393    int i;
     
    137137 * \return void
    138138 */
    139 void caca_draw_thin_polyline(const int x[], const int y[], int n)
     139void caca_draw_thin_polyline(int const x[], int const y[], int n)
    140140{
    141141    int i;
  • libcaca/trunk/src/sprite.c

    r268 r305  
    5757 * \return The sprite, or NULL if an error occured.
    5858 */
    59 struct caca_sprite *caca_load_sprite(const char *file)
     59struct caca_sprite *caca_load_sprite(char const *file)
    6060{
    6161    char buf[BUFSIZ];
     
    178178 * \return The number of frames.
    179179 */
    180 int caca_get_sprite_frames(const struct caca_sprite *sprite)
     180int caca_get_sprite_frames(struct caca_sprite const *sprite)
    181181{
    182182    if(sprite == NULL)
     
    193193 * \return The width of the given frame of the sprite.
    194194 */
    195 int caca_get_sprite_width(const struct caca_sprite *sprite, int f)
     195int caca_get_sprite_width(struct caca_sprite const *sprite, int f)
    196196{
    197197    if(sprite == NULL)
     
    211211 * \return The height of the given frame of the sprite.
    212212 */
    213 int caca_get_sprite_height(const struct caca_sprite *sprite, int f)
     213int caca_get_sprite_height(struct caca_sprite const *sprite, int f)
    214214{
    215215    if(sprite == NULL)
     
    229229 * \return The X coordinate of the given frame's handle.
    230230 */
    231 int caca_get_sprite_dx(const struct caca_sprite *sprite, int f)
     231int caca_get_sprite_dx(struct caca_sprite const *sprite, int f)
    232232{
    233233    if(sprite == NULL)
     
    247247 * \return The Y coordinate of the given frame's handle.
    248248 */
    249 int caca_get_sprite_dy(const struct caca_sprite *sprite, int f)
     249int caca_get_sprite_dy(struct caca_sprite const *sprite, int f)
    250250{
    251251    if(sprite == NULL)
     
    268268 * \return void
    269269 */
    270 void caca_draw_sprite(int x, int y, const struct caca_sprite *sprite, int f)
     270void caca_draw_sprite(int x, int y, struct caca_sprite const *sprite, int f)
    271271{
    272272    int i, j;
  • libcaca/trunk/test/optipal.c

    r293 r305  
    3535
    3636/* 6 colours in hue order */
    37 static const enum caca_color hue_list[] =
     37static enum caca_color const hue_list[] =
    3838{
    3939    CACA_COLOR_RED,
     
    7676
    7777    /* Output the palette */
    78     printf("const static int slang_palette[2*16*16] =\n{\n");
     78    printf("static int const slang_palette[2*16*16] =\n{\n");
    7979    for(i = 0; i < 16 * 16; i++)
    8080    {
     
    8686
    8787    /* Output the association table */
    88     printf("const static int slang_assoc[16*16] =\n{\n");
     88    printf("static int const slang_assoc[16*16] =\n{\n");
    8989    for(i = 0; i < 16 * 16; i++)
    9090    {
Note: See TracChangeset for help on using the changeset viewer.