Changeset 1852


Ignore:
Timestamp:
Oct 28, 2007, 11:23:59 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • C89 compilation fix for machines that do not have <endian.h>, thanks to Rado S.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test/font.c

    r1753 r1852  
    8686    dp = caca_create_display(cv);
    8787
     88    {
    8889#if defined(HAVE_ENDIAN_H)
    89     if(__BYTE_ORDER == __BIG_ENDIAN)
     90        if(__BYTE_ORDER == __BIG_ENDIAN)
    9091#else
    91     /* This is compile-time optimised with at least -O1 or -Os */
    92     uint32_t const tmp = 0x12345678;
    93     if(*(uint8_t const *)&tmp == 0x12)
     92        /* This is compile-time optimised with at least -O1 or -Os */
     93        uint32_t const tmp = 0x12345678;
     94        if(*(uint8_t const *)&tmp == 0x12)
    9495#endif
    95         d = cucul_create_dither(32, w, h, 4 * w,
    96                                 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
    97     else
    98         d = cucul_create_dither(32, w, h, 4 * w,
    99                                 0x0000ff00, 0x00ff0000, 0xff000000, 0x000000ff);
     96            d = cucul_create_dither(32, w, h, 4 * w,
     97                                    0xff0000, 0xff00, 0xff, 0xff000000);
     98        else
     99            d = cucul_create_dither(32, w, h, 4 * w,
     100                                    0xff00, 0xff0000, 0xff000000, 0xff);
     101    }
    100102
    101103    cucul_dither_bitmap(cv, 0, 0, cucul_get_canvas_width(cv),
Note: See TracChangeset for help on using the changeset viewer.