Replace all the "static __inline__" functions with SDL_FORCE_INLINE.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 15 Mar 2013 01:09:19 -0400
changeset 700418d4df6942c2
parent 7003 eeaf77005c30
child 7005 6c69ad0b184e
Replace all the "static __inline__" functions with SDL_FORCE_INLINE.
include/SDL_atomic.h
include/SDL_bits.h
include/SDL_endian.h
     1.1 --- a/include/SDL_atomic.h	Fri Mar 15 01:01:20 2013 -0400
     1.2 +++ b/include/SDL_atomic.h	Fri Mar 15 01:09:19 2013 -0400
     1.3 @@ -205,7 +205,7 @@
     1.4   * \return The previous value of the atomic variable.
     1.5   */
     1.6  #ifndef SDL_AtomicSet
     1.7 -static __inline__ int SDL_AtomicSet(SDL_atomic_t *a, int v)
     1.8 +SDL_FORCE_INLINE int SDL_AtomicSet(SDL_atomic_t *a, int v)
     1.9  {
    1.10      int value;
    1.11      do {
    1.12 @@ -219,7 +219,7 @@
    1.13   * \brief Get the value of an atomic variable
    1.14   */
    1.15  #ifndef SDL_AtomicGet
    1.16 -static __inline__ int SDL_AtomicGet(SDL_atomic_t *a)
    1.17 +SDL_FORCE_INLINE int SDL_AtomicGet(SDL_atomic_t *a)
    1.18  {
    1.19      int value = a->value;
    1.20      SDL_CompilerBarrier();
    1.21 @@ -235,7 +235,7 @@
    1.22   * \note This same style can be used for any number operation
    1.23   */
    1.24  #ifndef SDL_AtomicAdd
    1.25 -static __inline__ int SDL_AtomicAdd(SDL_atomic_t *a, int v)
    1.26 +SDL_FORCE_INLINE int SDL_AtomicAdd(SDL_atomic_t *a, int v)
    1.27  {
    1.28      int value;
    1.29      do {
    1.30 @@ -279,7 +279,7 @@
    1.31   * \return The previous value of the pointer.
    1.32   */
    1.33  #ifndef SDL_AtomicSetPtr
    1.34 -static __inline__ void* SDL_AtomicSetPtr(void* *a, void* v)
    1.35 +SDL_FORCE_INLINE void* SDL_AtomicSetPtr(void* *a, void* v)
    1.36  {
    1.37      void* value;
    1.38      do {
    1.39 @@ -293,7 +293,7 @@
    1.40   * \brief Get the value of a pointer atomically.
    1.41   */
    1.42  #ifndef SDL_AtomicGetPtr
    1.43 -static __inline__ void* SDL_AtomicGetPtr(void* *a)
    1.44 +SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a)
    1.45  {
    1.46      void* value = *a;
    1.47      SDL_CompilerBarrier();
     2.1 --- a/include/SDL_bits.h	Fri Mar 15 01:01:20 2013 -0400
     2.2 +++ b/include/SDL_bits.h	Fri Mar 15 01:09:19 2013 -0400
     2.3 @@ -40,11 +40,6 @@
     2.4  
     2.5  /**
     2.6   *  \file SDL_bits.h
     2.7 - *
     2.8 - *  Uses inline functions for compilers that support them, and static
     2.9 - *  functions for those that do not.  Because these functions become
    2.10 - *  static for compilers that do not support inline functions, this
    2.11 - *  header should only be included in files that actually use them.
    2.12   */
    2.13  
    2.14  /**
    2.15 @@ -54,7 +49,7 @@
    2.16   *
    2.17   *  \return Index of the most significant bit.
    2.18   */
    2.19 -static __inline__ Sint8
    2.20 +SDL_FORCE_INLINE Sint8
    2.21  SDL_MostSignificantBitIndex32(Uint32 x)
    2.22  {
    2.23  #if defined(__GNUC__)
     3.1 --- a/include/SDL_endian.h	Fri Mar 15 01:01:20 2013 -0400
     3.2 +++ b/include/SDL_endian.h	Fri Mar 15 01:09:19 2013 -0400
     3.3 @@ -66,29 +66,24 @@
     3.4  
     3.5  /**
     3.6   *  \file SDL_endian.h
     3.7 - *  
     3.8 - *  Uses inline functions for compilers that support them, and static
     3.9 - *  functions for those that do not.  Because these functions become
    3.10 - *  static for compilers that do not support inline functions, this
    3.11 - *  header should only be included in files that actually use them.
    3.12   */
    3.13  #if defined(__GNUC__) && defined(__i386__) && \
    3.14     !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
    3.15 -static __inline__ Uint16
    3.16 +SDL_FORCE_INLINE Uint16
    3.17  SDL_Swap16(Uint16 x)
    3.18  {
    3.19    __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
    3.20      return x;
    3.21  }
    3.22  #elif defined(__GNUC__) && defined(__x86_64__)
    3.23 -static __inline__ Uint16
    3.24 +SDL_FORCE_INLINE Uint16
    3.25  SDL_Swap16(Uint16 x)
    3.26  {
    3.27    __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
    3.28      return x;
    3.29  }
    3.30  #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
    3.31 -static __inline__ Uint16
    3.32 +SDL_FORCE_INLINE Uint16
    3.33  SDL_Swap16(Uint16 x)
    3.34  {
    3.35      int result;
    3.36 @@ -97,14 +92,14 @@
    3.37      return (Uint16)result;
    3.38  }
    3.39  #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
    3.40 -static __inline__ Uint16
    3.41 +SDL_FORCE_INLINE Uint16
    3.42  SDL_Swap16(Uint16 x)
    3.43  {
    3.44    __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
    3.45      return x;
    3.46  }
    3.47  #else
    3.48 -static __inline__ Uint16
    3.49 +SDL_FORCE_INLINE Uint16
    3.50  SDL_Swap16(Uint16 x)
    3.51  {
    3.52      return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
    3.53 @@ -112,21 +107,21 @@
    3.54  #endif
    3.55  
    3.56  #if defined(__GNUC__) && defined(__i386__)
    3.57 -static __inline__ Uint32
    3.58 +SDL_FORCE_INLINE Uint32
    3.59  SDL_Swap32(Uint32 x)
    3.60  {
    3.61    __asm__("bswap %0": "=r"(x):"0"(x));
    3.62      return x;
    3.63  }
    3.64  #elif defined(__GNUC__) && defined(__x86_64__)
    3.65 -static __inline__ Uint32
    3.66 +SDL_FORCE_INLINE Uint32
    3.67  SDL_Swap32(Uint32 x)
    3.68  {
    3.69    __asm__("bswapl %0": "=r"(x):"0"(x));
    3.70      return x;
    3.71  }
    3.72  #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
    3.73 -static __inline__ Uint32
    3.74 +SDL_FORCE_INLINE Uint32
    3.75  SDL_Swap32(Uint32 x)
    3.76  {
    3.77      Uint32 result;
    3.78 @@ -137,14 +132,14 @@
    3.79      return result;
    3.80  }
    3.81  #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
    3.82 -static __inline__ Uint32
    3.83 +SDL_FORCE_INLINE Uint32
    3.84  SDL_Swap32(Uint32 x)
    3.85  {
    3.86    __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
    3.87      return x;
    3.88  }
    3.89  #else
    3.90 -static __inline__ Uint32
    3.91 +SDL_FORCE_INLINE Uint32
    3.92  SDL_Swap32(Uint32 x)
    3.93  {
    3.94      return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
    3.95 @@ -153,7 +148,7 @@
    3.96  #endif
    3.97  
    3.98  #if defined(__GNUC__) && defined(__i386__)
    3.99 -static __inline__ Uint64
   3.100 +SDL_FORCE_INLINE Uint64
   3.101  SDL_Swap64(Uint64 x)
   3.102  {
   3.103      union
   3.104 @@ -171,14 +166,14 @@
   3.105      return v.u;
   3.106  }
   3.107  #elif defined(__GNUC__) && defined(__x86_64__)
   3.108 -static __inline__ Uint64
   3.109 +SDL_FORCE_INLINE Uint64
   3.110  SDL_Swap64(Uint64 x)
   3.111  {
   3.112    __asm__("bswapq %0": "=r"(x):"0"(x));
   3.113      return x;
   3.114  }
   3.115  #else
   3.116 -static __inline__ Uint64
   3.117 +SDL_FORCE_INLINE Uint64
   3.118  SDL_Swap64(Uint64 x)
   3.119  {
   3.120      Uint32 hi, lo;
   3.121 @@ -195,7 +190,7 @@
   3.122  #endif
   3.123  
   3.124  
   3.125 -static __inline__ float
   3.126 +SDL_FORCE_INLINE float
   3.127  SDL_SwapFloat(float x)
   3.128  {
   3.129      union