include/SDL_endian.h
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/include/SDL_endian.h	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/include/SDL_endian.h	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -64,37 +64,37 @@
     1.4  #if defined(__GNUC__) && defined(__i386__) && \
     1.5     !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
     1.6  static __inline__ Uint16
     1.7 -SDL_Swap16 (Uint16 x)
     1.8 +SDL_Swap16(Uint16 x)
     1.9  {
    1.10 -  __asm__ ("xchgb %b0,%h0": "=q" (x):"0" (x));
    1.11 +  __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
    1.12      return x;
    1.13  }
    1.14  #elif defined(__GNUC__) && defined(__x86_64__)
    1.15  static __inline__ Uint16
    1.16 -SDL_Swap16 (Uint16 x)
    1.17 +SDL_Swap16(Uint16 x)
    1.18  {
    1.19 -  __asm__ ("xchgb %b0,%h0": "=Q" (x):"0" (x));
    1.20 +  __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
    1.21      return x;
    1.22  }
    1.23  #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
    1.24  static __inline__ Uint16
    1.25 -SDL_Swap16 (Uint16 x)
    1.26 +SDL_Swap16(Uint16 x)
    1.27  {
    1.28      Uint16 result;
    1.29  
    1.30 -  __asm__ ("rlwimi %0,%2,8,16,23": "=&r" (result):"0" (x >> 8), "r" (x));
    1.31 +  __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
    1.32      return result;
    1.33  }
    1.34  #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
    1.35  static __inline__ Uint16
    1.36 -SDL_Swap16 (Uint16 x)
    1.37 +SDL_Swap16(Uint16 x)
    1.38  {
    1.39 -  __asm__ ("rorw #8,%0": "=d" (x): "0" (x):"cc");
    1.40 +  __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
    1.41      return x;
    1.42  }
    1.43  #else
    1.44  static __inline__ Uint16
    1.45 -SDL_Swap16 (Uint16 x)
    1.46 +SDL_Swap16(Uint16 x)
    1.47  {
    1.48      return ((x << 8) | (x >> 8));
    1.49  }
    1.50 @@ -102,40 +102,39 @@
    1.51  
    1.52  #if defined(__GNUC__) && defined(__i386__)
    1.53  static __inline__ Uint32
    1.54 -SDL_Swap32 (Uint32 x)
    1.55 +SDL_Swap32(Uint32 x)
    1.56  {
    1.57 -  __asm__ ("bswap %0": "=r" (x):"0" (x));
    1.58 +  __asm__("bswap %0": "=r"(x):"0"(x));
    1.59      return x;
    1.60  }
    1.61  #elif defined(__GNUC__) && defined(__x86_64__)
    1.62  static __inline__ Uint32
    1.63 -SDL_Swap32 (Uint32 x)
    1.64 +SDL_Swap32(Uint32 x)
    1.65  {
    1.66 -  __asm__ ("bswapl %0": "=r" (x):"0" (x));
    1.67 +  __asm__("bswapl %0": "=r"(x):"0"(x));
    1.68      return x;
    1.69  }
    1.70  #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
    1.71  static __inline__ Uint32
    1.72 -SDL_Swap32 (Uint32 x)
    1.73 +SDL_Swap32(Uint32 x)
    1.74  {
    1.75      Uint32 result;
    1.76  
    1.77 -  __asm__ ("rlwimi %0,%2,24,16,23": "=&r" (result):"0" (x >> 24),
    1.78 -             "r" (x));
    1.79 -  __asm__ ("rlwimi %0,%2,8,8,15": "=&r" (result):"0" (result), "r" (x));
    1.80 -  __asm__ ("rlwimi %0,%2,24,0,7": "=&r" (result):"0" (result), "r" (x));
    1.81 +  __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
    1.82 +  __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
    1.83 +  __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
    1.84      return result;
    1.85  }
    1.86  #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
    1.87  static __inline__ Uint32
    1.88 -SDL_Swap32 (Uint32 x)
    1.89 +SDL_Swap32(Uint32 x)
    1.90  {
    1.91 -  __asm__ ("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d" (x): "0" (x):"cc");
    1.92 +  __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
    1.93      return x;
    1.94  }
    1.95  #else
    1.96  static __inline__ Uint32
    1.97 -SDL_Swap32 (Uint32 x)
    1.98 +SDL_Swap32(Uint32 x)
    1.99  {
   1.100      return ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) |
   1.101              (x >> 24));
   1.102 @@ -145,7 +144,7 @@
   1.103  #ifdef SDL_HAS_64BIT_TYPE
   1.104  #if defined(__GNUC__) && defined(__i386__)
   1.105  static __inline__ Uint64
   1.106 -SDL_Swap64 (Uint64 x)
   1.107 +SDL_Swap64(Uint64 x)
   1.108  {
   1.109      union
   1.110      {
   1.111 @@ -156,21 +155,21 @@
   1.112          Uint64 u;
   1.113      } v;
   1.114      v.u = x;
   1.115 -  __asm__ ("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r" (v.s.a), "=r" (v.s.b):"0" (v.s.a),
   1.116 -             "1" (v.s.
   1.117 -                  b));
   1.118 +  __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
   1.119 +            "1"(v.s.
   1.120 +                b));
   1.121      return v.u;
   1.122  }
   1.123  #elif defined(__GNUC__) && defined(__x86_64__)
   1.124  static __inline__ Uint64
   1.125 -SDL_Swap64 (Uint64 x)
   1.126 +SDL_Swap64(Uint64 x)
   1.127  {
   1.128 -  __asm__ ("bswapq %0": "=r" (x):"0" (x));
   1.129 +  __asm__("bswapq %0": "=r"(x):"0"(x));
   1.130      return x;
   1.131  }
   1.132  #else
   1.133  static __inline__ Uint64
   1.134 -SDL_Swap64 (Uint64 x)
   1.135 +SDL_Swap64(Uint64 x)
   1.136  {
   1.137      Uint32 hi, lo;
   1.138  
   1.139 @@ -178,9 +177,9 @@
   1.140      lo = (Uint32) (x & 0xFFFFFFFF);
   1.141      x >>= 32;
   1.142      hi = (Uint32) (x & 0xFFFFFFFF);
   1.143 -    x = SDL_Swap32 (lo);
   1.144 +    x = SDL_Swap32(lo);
   1.145      x <<= 32;
   1.146 -    x |= SDL_Swap32 (hi);
   1.147 +    x |= SDL_Swap32(hi);
   1.148      return (x);
   1.149  }
   1.150  #endif