Ignore:
Timestamp:
Nov 10, 2005, 9:41:13 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • absolute shitloads of 64 bit fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/include/system.h

    r7 r17  
    3030
    3131
    32 #define short_swap(x) (((((uint16_t) (x)))<<8)|((((uint16_t) (x)))>>8))
    33 #define long_swap(x) \
     32#define uint16_swap(x) (((((uint16_t) (x)))<<8)|((((uint16_t) (x)))>>8))
     33#define uint32_swap(x) \
    3434   ((( ((uint32_t)(x)) )>>24)|((( ((uint32_t)(x)) )&0x00ff0000)>>8)| \
    3535   ((( ((uint32_t)(x)) )&0x0000ff00)<<8)|(( ((uint32_t)(x)) )<<24))
     
    3737#if defined BIG_ENDIANS
    3838#define LONG int32_t
    39 #define int_to_intel(x) short_swap(x)
    40 #define int_to_local(x) int_to_intel(x)
    41 #define big_long_to_local(x) (x)
    42 #define big_short_to_local(x) (x)
    43 #define long_to_intel(x) long_swap(x)
    44 #define long_to_local(x) long_to_intel(x)
     39#define uint16_to_intel(x) uint16_swap(x)
     40#define uint16_to_local(x) uint16_to_intel(x)
     41#define big_uint32_to_local(x) (x)
     42#define big_uint16_to_local(x) (x)
     43#define uint32_to_intel(x) uint32_swap(x)
     44#define uint32_to_local(x) uint32_to_intel(x)
    4545#else
    4646#define LONG int32_t
    47 #define int_to_intel(x) (x)
    48 #define int_to_local(x) (x)
    49 #define long_to_local(x) (x)
    50 #define long_to_intel(x) (x)
    51 #define big_long_to_local(x) long_swap(x)
    52 #define big_short_to_local(x) short_swap(x)
     47#define uint16_to_intel(x) (x)
     48#define uint16_to_local(x) (x)
     49#define uint32_to_local(x) (x)
     50#define uint32_to_intel(x) (x)
     51#define big_uint32_to_local(x) uint32_swap(x)
     52#define big_uint16_to_local(x) uint16_swap(x)
    5353#endif
    5454
    55 #define bltl(x) big_long_to_local(x)
    56 #define bstl(x) big_short_to_local(x)
    57 #define lltl(x) long_to_intel(x)
    58 #define lstl(x) int_to_intel(x)
     55#define bltl(x) big_uint32_to_local(x)
     56#define bstl(x) big_uint16_to_local(x)
     57#define lltl(x) uint32_to_intel(x)
     58#define lstl(x) uint16_to_intel(x)
    5959
    6060#endif
Note: See TracChangeset for help on using the changeset viewer.