[PATCH 2/2] Convert remaining code to use C99 inline

Tomas Carnecky tomas.carnecky at gmail.com
Thu Mar 22 02:50:14 PDT 2012


But keep compatibility defines for __inline and __inline__ in case some
drivers still use those (hw/xfree86/common/compiler.h).

Signed-off-by: Tomas Carnecky <tomas.carnecky at gmail.com>
---
 hw/xfree86/common/compiler.h |  289 ++++++++++++++++++++----------------------
 hw/xfree86/x86emu/sys.c      |   24 ++--
 hw/xquartz/xpr/x-hash.h      |    8 +-
 3 files changed, 153 insertions(+), 168 deletions(-)

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 0abdfb6..bb59d2a 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -75,25 +75,10 @@
 
 #include <pixman.h>             /* for uint*_t types */
 
-/* Allow drivers to use the GCC-supported __inline__ and/or __inline. */
-#ifndef __inline__
-#if defined(__GNUC__)
-    /* gcc has __inline__ */
-#elif defined(__HIGHC__)
-#define __inline__ _Inline
-#else
-#define __inline__ /**/
-#endif
-#endif                          /* __inline__ */
-#ifndef __inline
-#if defined(__GNUC__)
-    /* gcc has __inline */
-#elif defined(__HIGHC__)
-#define __inline _Inline
-#else
-#define __inline /**/
-#endif
-#endif                          /* __inline */
+/* FIXME: Remove once all drivers and other external modules are ported */
+#define __inline   inline
+#define __inline__ inline
+
 /* Support gcc's __FUNCTION__ for people using other compilers */
 #if !defined(__GNUC__) && !defined(__FUNCTION__)
 #define __FUNCTION__ __func__   /* C99 */
@@ -239,7 +224,7 @@ struct __una_u16 {
 
 /* Elemental unaligned loads */
 
-static __inline__ uint64_t
+static inline uint64_t
 ldq_u(uint64_t * p)
 {
     const struct __una_u64 *ptr = (const struct __una_u64 *) p;
@@ -247,7 +232,7 @@ ldq_u(uint64_t * p)
     return ptr->x;
 }
 
-static __inline__ uint32_t
+static inline uint32_t
 ldl_u(uint32_t * p)
 {
     const struct __una_u32 *ptr = (const struct __una_u32 *) p;
@@ -255,7 +240,7 @@ ldl_u(uint32_t * p)
     return ptr->x;
 }
 
-static __inline__ uint16_t
+static inline uint16_t
 ldw_u(uint16_t * p)
 {
     const struct __una_u16 *ptr = (const struct __una_u16 *) p;
@@ -265,7 +250,7 @@ ldw_u(uint16_t * p)
 
 /* Elemental unaligned stores */
 
-static __inline__ void
+static inline void
 stq_u(uint64_t val, uint64_t * p)
 {
     struct __una_u64 *ptr = (struct __una_u64 *) p;
@@ -273,7 +258,7 @@ stq_u(uint64_t val, uint64_t * p)
     ptr->x = val;
 }
 
-static __inline__ void
+static inline void
 stl_u(uint32_t val, uint32_t * p)
 {
     struct __una_u32 *ptr = (struct __una_u32 *) p;
@@ -281,7 +266,7 @@ stl_u(uint32_t val, uint32_t * p)
     ptr->x = val;
 }
 
-static __inline__ void
+static inline void
 stw_u(uint16_t val, uint16_t * p)
 {
     struct __una_u16 *ptr = (struct __una_u16 *) p;
@@ -292,7 +277,7 @@ stw_u(uint16_t val, uint16_t * p)
 
 #include <string.h>             /* needed for memmove */
 
-static __inline__ uint64_t
+static inline uint64_t
 ldq_u(uint64_t * p)
 {
     uint64_t ret;
@@ -301,7 +286,7 @@ ldq_u(uint64_t * p)
     return ret;
 }
 
-static __inline__ uint32_t
+static inline uint32_t
 ldl_u(uint32_t * p)
 {
     uint32_t ret;
@@ -310,7 +295,7 @@ ldl_u(uint32_t * p)
     return ret;
 }
 
-static __inline__ uint16_t
+static inline uint16_t
 ldw_u(uint16_t * p)
 {
     uint16_t ret;
@@ -319,7 +304,7 @@ ldw_u(uint16_t * p)
     return ret;
 }
 
-static __inline__ void
+static inline void
 stq_u(uint64_t val, uint64_t * p)
 {
     uint64_t tmp = val;
@@ -327,7 +312,7 @@ stq_u(uint64_t val, uint64_t * p)
     memmove(p, &tmp, sizeof(*p));
 }
 
-static __inline__ void
+static inline void
 stl_u(uint32_t val, uint32_t * p)
 {
     uint32_t tmp = val;
@@ -335,7 +320,7 @@ stl_u(uint32_t val, uint32_t * p)
     memmove(p, &tmp, sizeof(*p));
 }
 
-static __inline__ void
+static inline void
 stw_u(uint16_t val, uint16_t * p)
 {
     uint16_t tmp = val;
@@ -362,37 +347,37 @@ extern _X_EXPORT unsigned int _inb(unsigned long port);
 extern _X_EXPORT unsigned int _inw(unsigned long port);
 extern _X_EXPORT unsigned int _inl(unsigned long port);
 
-static __inline__ void
+static inline void
 outb(unsigned long port, unsigned char val)
 {
     _outb(val, port);
 }
 
-static __inline__ void
+static inline void
 outw(unsigned long port, unsigned short val)
 {
     _outw(val, port);
 }
 
-static __inline__ void
+static inline void
 outl(unsigned long port, unsigned int val)
 {
     _outl(val, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned long port)
 {
     return _inb(port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned long port)
 {
     return _inw(port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned long port)
 {
     return _inl(port);
@@ -425,25 +410,25 @@ extern _X_EXPORT unsigned int inl(unsigned int port);
 
 #include <inttypes.h>
 
-static __inline__ void
+static inline void
 outb(unsigned short port, unsigned char val)
 {
     __asm__ __volatile__("outb %0,%1"::"a"(val), "d"(port));
 }
 
-static __inline__ void
+static inline void
 outw(unsigned short port, unsigned short val)
 {
     __asm__ __volatile__("outw %0,%1"::"a"(val), "d"(port));
 }
 
-static __inline__ void
+static inline void
 outl(unsigned short port, unsigned int val)
 {
     __asm__ __volatile__("outl %0,%1"::"a"(val), "d"(port));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned short port)
 {
     unsigned char ret;
@@ -452,7 +437,7 @@ inb(unsigned short port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
     unsigned short ret;
@@ -461,7 +446,7 @@ inw(unsigned short port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
     unsigned int ret;
@@ -476,7 +461,7 @@ inl(unsigned short port)
 #define ASI_PL 0x88
 #endif
 
-static __inline__ void
+static inline void
 outb(unsigned long port, unsigned char val)
 {
     __asm__ __volatile__("stba %0, [%1] %2":    /* No outputs */
@@ -485,7 +470,7 @@ outb(unsigned long port, unsigned char val)
     barrier();
 }
 
-static __inline__ void
+static inline void
 outw(unsigned long port, unsigned short val)
 {
     __asm__ __volatile__("stha %0, [%1] %2":    /* No outputs */
@@ -494,7 +479,7 @@ outw(unsigned long port, unsigned short val)
     barrier();
 }
 
-static __inline__ void
+static inline void
 outl(unsigned long port, unsigned int val)
 {
     __asm__ __volatile__("sta %0, [%1] %2":     /* No outputs */
@@ -503,7 +488,7 @@ outl(unsigned long port, unsigned int val)
     barrier();
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned long port)
 {
     unsigned int ret;
@@ -513,7 +498,7 @@ inb(unsigned long port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned long port)
 {
     unsigned int ret;
@@ -523,7 +508,7 @@ inw(unsigned long port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned long port)
 {
     unsigned int ret;
@@ -533,7 +518,7 @@ inl(unsigned long port)
     return ret;
 }
 
-static __inline__ unsigned char
+static inline unsigned char
 xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -545,7 +530,7 @@ xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ unsigned short
+static inline unsigned short
 xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -557,7 +542,7 @@ xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ unsigned short
+static inline unsigned short
 xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -569,7 +554,7 @@ xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -581,7 +566,7 @@ xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -593,7 +578,7 @@ xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
                const unsigned int val)
 {
@@ -605,7 +590,7 @@ xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -617,7 +602,7 @@ xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -629,7 +614,7 @@ xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -641,7 +626,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -653,7 +638,7 @@ xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset,
                  const unsigned int val)
 {
@@ -663,7 +648,7 @@ xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset,
                          :"r"(val), "r"(addr), "i"(ASI_PL));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16BeNB(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -673,7 +658,7 @@ xf86WriteMmio16BeNB(__volatile__ void *base, const unsigned long offset,
                          :"r"(val), "r"(addr));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16LeNB(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -683,7 +668,7 @@ xf86WriteMmio16LeNB(__volatile__ void *base, const unsigned long offset,
                          :"r"(val), "r"(addr), "i"(ASI_PL));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32BeNB(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -693,7 +678,7 @@ xf86WriteMmio32BeNB(__volatile__ void *base, const unsigned long offset,
                          :"r"(val), "r"(addr));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -712,42 +697,42 @@ xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset,
 
 _X_EXPORT unsigned int IOPortBase;      /* Memory mapped I/O port area */
 
-static __inline__ void
+static inline void
 outb(unsigned PORT_SIZE port, unsigned char val)
 {
     *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)) + IOPortBase) =
         val;
 }
 
-static __inline__ void
+static inline void
 outw(unsigned PORT_SIZE port, unsigned short val)
 {
     *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)) + IOPortBase) =
         val;
 }
 
-static __inline__ void
+static inline void
 outl(unsigned PORT_SIZE port, unsigned int val)
 {
     *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)) + IOPortBase) =
         val;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned PORT_SIZE port)
 {
     return *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)) +
                                         IOPortBase);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned PORT_SIZE port)
 {
     return *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)) +
                                          IOPortBase);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned PORT_SIZE port)
 {
     return *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)) +
@@ -757,7 +742,7 @@ inl(unsigned PORT_SIZE port)
 #if defined(__mips__)
 #ifdef linux                    /* don't mess with other OSs */
 #if X_BYTE_ORDER == X_BIG_ENDIAN
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -769,7 +754,7 @@ xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -790,7 +775,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
 
 extern _X_EXPORT volatile unsigned char *ioBase;
 
-static __inline__ unsigned char
+static inline unsigned char
 xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
 {
     register unsigned char val;
@@ -800,7 +785,7 @@ xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
     return val;
 }
 
-static __inline__ unsigned short
+static inline unsigned short
 xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
 {
     register unsigned short val;
@@ -810,7 +795,7 @@ xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
     return val;
 }
 
-static __inline__ unsigned short
+static inline unsigned short
 xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
 {
     register unsigned short val;
@@ -820,7 +805,7 @@ xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
     return val;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
 {
     register unsigned int val;
@@ -830,7 +815,7 @@ xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
     return val;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
 {
     register unsigned int val;
@@ -840,7 +825,7 @@ xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
     return val;
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmioNB8(__volatile__ void *base, const unsigned long offset,
                  const unsigned char val)
 {
@@ -850,7 +835,7 @@ xf86WriteMmioNB8(__volatile__ void *base, const unsigned long offset,
                      :"r"(val), "b"(base), "r"(offset));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmioNB16Le(__volatile__ void *base, const unsigned long offset,
                     const unsigned short val)
 {
@@ -860,7 +845,7 @@ xf86WriteMmioNB16Le(__volatile__ void *base, const unsigned long offset,
                      :"r"(val), "b"(base), "r"(offset));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmioNB16Be(__volatile__ void *base, const unsigned long offset,
                     const unsigned short val)
 {
@@ -870,7 +855,7 @@ xf86WriteMmioNB16Be(__volatile__ void *base, const unsigned long offset,
                      :"r"(val), "b"(base), "r"(offset));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmioNB32Le(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -880,7 +865,7 @@ xf86WriteMmioNB32Le(__volatile__ void *base, const unsigned long offset,
                      :"r"(val), "b"(base), "r"(offset));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmioNB32Be(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -890,7 +875,7 @@ xf86WriteMmioNB32Be(__volatile__ void *base, const unsigned long offset,
                      :"r"(val), "b"(base), "r"(offset));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
                const unsigned char val)
 {
@@ -898,7 +883,7 @@ xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
     eieio();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
                   const unsigned short val)
 {
@@ -906,7 +891,7 @@ xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
     eieio();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
                   const unsigned short val)
 {
@@ -914,7 +899,7 @@ xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
     eieio();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -922,7 +907,7 @@ xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
     eieio();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -930,7 +915,7 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
     eieio();
 }
 
-static __inline__ void
+static inline void
 outb(unsigned short port, unsigned char value)
 {
     if (ioBase == MAP_FAILED)
@@ -938,7 +923,7 @@ outb(unsigned short port, unsigned char value)
     xf86WriteMmio8((void *) ioBase, port, value);
 }
 
-static __inline__ void
+static inline void
 outw(unsigned short port, unsigned short value)
 {
     if (ioBase == MAP_FAILED)
@@ -946,7 +931,7 @@ outw(unsigned short port, unsigned short value)
     xf86WriteMmio16Le((void *) ioBase, port, value);
 }
 
-static __inline__ void
+static inline void
 outl(unsigned short port, unsigned int value)
 {
     if (ioBase == MAP_FAILED)
@@ -954,7 +939,7 @@ outl(unsigned short port, unsigned int value)
     xf86WriteMmio32Le((void *) ioBase, port, value);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned short port)
 {
     if (ioBase == MAP_FAILED)
@@ -962,7 +947,7 @@ inb(unsigned short port)
     return xf86ReadMmio8((void *) ioBase, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
     if (ioBase == MAP_FAILED)
@@ -970,7 +955,7 @@ inw(unsigned short port)
     return xf86ReadMmio16Le((void *) ioBase, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
     if (ioBase == MAP_FAILED)
@@ -986,19 +971,19 @@ inl(unsigned short port)
 
 #include <sys/io.h>
 
-static __inline__ void
+static inline void
 xf_outb(unsigned short port, unsigned char val)
 {
     outb(val, port);
 }
 
-static __inline__ void
+static inline void
 xf_outw(unsigned short port, unsigned short val)
 {
     outw(val, port);
 }
 
-static __inline__ void
+static inline void
 xf_outl(unsigned short port, unsigned int val)
 {
     outl(val, port);
@@ -1020,13 +1005,13 @@ xf_outl(unsigned short port, unsigned int val)
 
 #define PORT_SIZE long
 
-static __inline__ unsigned char
+static inline unsigned char
 xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
 {
     return *(volatile unsigned char *) ((unsigned char *) base + offset);
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
                const unsigned int val)
 {
@@ -1034,14 +1019,14 @@ xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset,
                  const unsigned int val)
 {
     *(volatile unsigned char *) ((unsigned char *) base + offset) = val;
 }
 
-static __inline__ unsigned short
+static inline unsigned short
 xf86ReadMmio16Swap(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -1053,13 +1038,13 @@ xf86ReadMmio16Swap(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ unsigned short
+static inline unsigned short
 xf86ReadMmio16(__volatile__ void *base, const unsigned long offset)
 {
     return *(volatile unsigned short *) ((char *) base + offset);
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16Swap(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -1071,7 +1056,7 @@ xf86WriteMmio16Swap(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16(__volatile__ void *base, const unsigned long offset,
                 const unsigned int val)
 {
@@ -1079,7 +1064,7 @@ xf86WriteMmio16(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16SwapNB(__volatile__ void *base, const unsigned long offset,
                       const unsigned int val)
 {
@@ -1089,14 +1074,14 @@ xf86WriteMmio16SwapNB(__volatile__ void *base, const unsigned long offset,
                          :"r"(val), "r"(addr));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio16NB(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
     *(volatile unsigned short *) ((unsigned char *) base + offset) = val;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32Swap(__volatile__ void *base, const unsigned long offset)
 {
     unsigned long addr = ((unsigned long) base) + offset;
@@ -1109,13 +1094,13 @@ xf86ReadMmio32Swap(__volatile__ void *base, const unsigned long offset)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 xf86ReadMmio32(__volatile__ void *base, const unsigned long offset)
 {
     return *(volatile unsigned int *) ((unsigned char *) base + offset);
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32Swap(__volatile__ void *base, const unsigned long offset,
                     const unsigned int val)
 {
@@ -1127,7 +1112,7 @@ xf86WriteMmio32Swap(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32(__volatile__ void *base, const unsigned long offset,
                 const unsigned int val)
 {
@@ -1135,7 +1120,7 @@ xf86WriteMmio32(__volatile__ void *base, const unsigned long offset,
     barrier();
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32SwapNB(__volatile__ void *base, const unsigned long offset,
                       const unsigned int val)
 {
@@ -1145,7 +1130,7 @@ xf86WriteMmio32SwapNB(__volatile__ void *base, const unsigned long offset,
                          :"r"(val), "r"(addr));
 }
 
-static __inline__ void
+static inline void
 xf86WriteMmio32NB(__volatile__ void *base, const unsigned long offset,
                   const unsigned int val)
 {
@@ -1153,43 +1138,43 @@ xf86WriteMmio32NB(__volatile__ void *base, const unsigned long offset,
 }
 
 #if defined(NDS32_MMIO_SWAP)
-static __inline__ void
+static inline void
 outb(unsigned PORT_SIZE port, unsigned char val)
 {
     xf86WriteMmio8(IOPortBase, port, val);
 }
 
-static __inline__ void
+static inline void
 outw(unsigned PORT_SIZE port, unsigned short val)
 {
     xf86WriteMmio16Swap(IOPortBase, port, val);
 }
 
-static __inline__ void
+static inline void
 outl(unsigned PORT_SIZE port, unsigned int val)
 {
     xf86WriteMmio32Swap(IOPortBase, port, val);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned PORT_SIZE port)
 {
     return xf86ReadMmio8(IOPortBase, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned PORT_SIZE port)
 {
     return xf86ReadMmio16Swap(IOPortBase, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned PORT_SIZE port)
 {
     return xf86ReadMmio32Swap(IOPortBase, port);
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 ldq_u(unsigned long *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1202,7 +1187,7 @@ ldq_u(unsigned long *p)
     return ret;
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 ldl_u(unsigned int *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1215,7 +1200,7 @@ ldl_u(unsigned int *p)
     return ret;
 }
 
-static __inline__ void
+static inline void
 stq_u(unsigned long val, unsigned long *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1224,7 +1209,7 @@ stq_u(unsigned long val, unsigned long *p)
                          :"r"(val), "r"(addr));
 }
 
-static __inline__ void
+static inline void
 stl_u(unsigned long val, unsigned int *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1234,46 +1219,46 @@ stl_u(unsigned long val, unsigned int *p)
 }
 
 #else                           /* !NDS32_MMIO_SWAP */
-static __inline__ void
+static inline void
 outb(unsigned PORT_SIZE port, unsigned char val)
 {
     *(volatile unsigned char *) (((unsigned PORT_SIZE) (port))) = val;
     barrier();
 }
 
-static __inline__ void
+static inline void
 outw(unsigned PORT_SIZE port, unsigned short val)
 {
     *(volatile unsigned short *) (((unsigned PORT_SIZE) (port))) = val;
     barrier();
 }
 
-static __inline__ void
+static inline void
 outl(unsigned PORT_SIZE port, unsigned int val)
 {
     *(volatile unsigned int *) (((unsigned PORT_SIZE) (port))) = val;
     barrier();
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned PORT_SIZE port)
 {
     return *(volatile unsigned char *) (((unsigned PORT_SIZE) (port)));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned PORT_SIZE port)
 {
     return *(volatile unsigned short *) (((unsigned PORT_SIZE) (port)));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned PORT_SIZE port)
 {
     return *(volatile unsigned int *) (((unsigned PORT_SIZE) (port)));
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 ldq_u(unsigned long *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1285,7 +1270,7 @@ ldq_u(unsigned long *p)
     return ret;
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 ldl_u(unsigned int *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1297,7 +1282,7 @@ ldl_u(unsigned int *p)
     return ret;
 }
 
-static __inline__ void
+static inline void
 stq_u(unsigned long val, unsigned long *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1306,7 +1291,7 @@ stq_u(unsigned long val, unsigned long *p)
                          :"r"(val), "r"(addr));
 }
 
-static __inline__ void
+static inline void
 stl_u(unsigned long val, unsigned int *p)
 {
     unsigned long addr = (unsigned long) p;
@@ -1342,25 +1327,25 @@ stl_u(unsigned long val, unsigned int *p)
  * inlines has to be different.		DHD
  */
 
-static __inline__ void
+static inline void
 outb(unsigned short port, unsigned char val)
 {
     __asm__ __volatile__("outb %0,%1"::"a"(val), "d"(port));
 }
 
-static __inline__ void
+static inline void
 outw(unsigned short port, unsigned short val)
 {
     __asm__ __volatile__("outw %0,%1"::"a"(val), "d"(port));
 }
 
-static __inline__ void
+static inline void
 outl(unsigned short port, unsigned int val)
 {
     __asm__ __volatile__("outl %0,%1"::"a"(val), "d"(port));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned short port)
 {
     unsigned char ret;
@@ -1369,7 +1354,7 @@ inb(unsigned short port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
     unsigned short ret;
@@ -1378,7 +1363,7 @@ inw(unsigned short port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
     unsigned int ret;
@@ -1389,25 +1374,25 @@ inl(unsigned short port)
 
 #else                           /* GCCUSESGAS */
 
-static __inline__ void
+static inline void
 outb(unsigned short port, unsigned char val)
 {
     __asm__ __volatile__("out%B0 (%1)"::"a"(val), "d"(port));
 }
 
-static __inline__ void
+static inline void
 outw(unsigned short port, unsigned short val)
 {
     __asm__ __volatile__("out%W0 (%1)"::"a"(val), "d"(port));
 }
 
-static __inline__ void
+static inline void
 outl(unsigned short port, unsigned int val)
 {
     __asm__ __volatile__("out%L0 (%1)"::"a"(val), "d"(port));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned short port)
 {
     unsigned char ret;
@@ -1416,7 +1401,7 @@ inb(unsigned short port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
     unsigned short ret;
@@ -1425,7 +1410,7 @@ inw(unsigned short port)
     return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
     unsigned int ret;
@@ -1438,34 +1423,34 @@ inl(unsigned short port)
 
 #else                           /* !defined(FAKEIT) && !defined(__mc68000__)  && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__m32r__) */
 
-static __inline__ void
+static inline void
 outb(unsigned short port, unsigned char val)
 {
 }
 
-static __inline__ void
+static inline void
 outw(unsigned short port, unsigned short val)
 {
 }
 
-static __inline__ void
+static inline void
 outl(unsigned short port, unsigned int val)
 {
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned short port)
 {
     return 0;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
     return 0;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
     return 0;
@@ -1507,7 +1492,7 @@ extern _X_EXPORT int (*xf86ReadMmio16) (void *, unsigned long);
 extern _X_EXPORT int (*xf86ReadMmio32) (void *, unsigned long);
 #else
 /* Some DRI 3D drivers need MMIO_IN32. */
-static __inline__ int
+static inline int
 xf86ReadMmio32(void *Base, unsigned long Offset)
 {
     mem_barrier();
@@ -1674,7 +1659,7 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
        xf86WriteMmio32(base, offset, (CARD32)(val))
 
 #ifdef N1213_HC                 /* for NDS32 N1213 hardcore */
-static __inline__ void
+static inline void
 nds32_flush_icache(char *addr)
 {
     __asm__ volatile ("isync %0;"
@@ -1683,7 +1668,7 @@ nds32_flush_icache(char *addr)
                       "cctl %0,L1I_VA_INVAL;" "isb;"::"r" (addr):"memory");
 }
 #else
-static __inline__ void
+static inline void
 nds32_flush_icache(char *addr)
 {
     __asm__ volatile ("isync %0;" "isb;"::"r" (addr):"memory");
diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c
index c514dde..24d2bac 100644
--- a/hw/xfree86/x86emu/sys.c
+++ b/hw/xfree86/x86emu/sys.c
@@ -65,7 +65,7 @@ struct __una_u16 {
 
 /* Elemental unaligned loads */
 
-static __inline__ u64
+static inline u64
 ldq_u(u64 * p)
 {
     const struct __una_u64 *ptr = (const struct __una_u64 *) p;
@@ -73,7 +73,7 @@ ldq_u(u64 * p)
     return ptr->x;
 }
 
-static __inline__ u32
+static inline u32
 ldl_u(u32 * p)
 {
     const struct __una_u32 *ptr = (const struct __una_u32 *) p;
@@ -81,7 +81,7 @@ ldl_u(u32 * p)
     return ptr->x;
 }
 
-static __inline__ u16
+static inline u16
 ldw_u(u16 * p)
 {
     const struct __una_u16 *ptr = (const struct __una_u16 *) p;
@@ -91,7 +91,7 @@ ldw_u(u16 * p)
 
 /* Elemental unaligned stores */
 
-static __inline__ void
+static inline void
 stq_u(u64 val, u64 * p)
 {
     struct __una_u64 *ptr = (struct __una_u64 *) p;
@@ -99,7 +99,7 @@ stq_u(u64 val, u64 * p)
     ptr->x = val;
 }
 
-static __inline__ void
+static inline void
 stl_u(u32 val, u32 * p)
 {
     struct __una_u32 *ptr = (struct __una_u32 *) p;
@@ -107,7 +107,7 @@ stl_u(u32 val, u32 * p)
     ptr->x = val;
 }
 
-static __inline__ void
+static inline void
 stw_u(u16 val, u16 * p)
 {
     struct __una_u16 *ptr = (struct __una_u16 *) p;
@@ -116,7 +116,7 @@ stw_u(u16 val, u16 * p)
 }
 #else                           /* !__GNUC__ */
 
-static __inline__ u64
+static inline u64
 ldq_u(u64 * p)
 {
     u64 ret;
@@ -125,7 +125,7 @@ ldq_u(u64 * p)
     return ret;
 }
 
-static __inline__ u32
+static inline u32
 ldl_u(u32 * p)
 {
     u32 ret;
@@ -134,7 +134,7 @@ ldl_u(u32 * p)
     return ret;
 }
 
-static __inline__ u16
+static inline u16
 ldw_u(u16 * p)
 {
     u16 ret;
@@ -143,7 +143,7 @@ ldw_u(u16 * p)
     return ret;
 }
 
-static __inline__ void
+static inline void
 stq_u(u64 val, u64 * p)
 {
     u64 tmp = val;
@@ -151,7 +151,7 @@ stq_u(u64 val, u64 * p)
     memmove(p, &tmp, sizeof(*p));
 }
 
-static __inline__ void
+static inline void
 stl_u(u32 val, u32 * p)
 {
     u32 tmp = val;
@@ -159,7 +159,7 @@ stl_u(u32 val, u32 * p)
     memmove(p, &tmp, sizeof(*p));
 }
 
-static __inline__ void
+static inline void
 stw_u(u16 val, u16 * p)
 {
     u16 tmp = val;
diff --git a/hw/xquartz/xpr/x-hash.h b/hw/xquartz/xpr/x-hash.h
index c454334..cc3eb2e 100644
--- a/hw/xquartz/xpr/x-hash.h
+++ b/hw/xquartz/xpr/x-hash.h
@@ -62,17 +62,17 @@ X_EXTERN void X_PFX(hash_table_foreach) (x_hash_table * h,
 /* Conversion between unsigned int (e.g. xp_resource_id) and void pointer */
 
 /* Forward declarations */
-static __inline__ void *X_PFX(cvt_uint_to_vptr) (unsigned int val)
+static inline void *X_PFX(cvt_uint_to_vptr) (unsigned int val)
     __attribute__ ((always_inline));
-static __inline__ unsigned int
+static inline unsigned int
  X_PFX(cvt_vptr_to_uint) (void *val) __attribute__ ((always_inline));
 
 /* Implementations */
-static __inline__ void *X_PFX(cvt_uint_to_vptr) (unsigned int val) {
+static inline void *X_PFX(cvt_uint_to_vptr) (unsigned int val) {
     return (void *) ((unsigned long) (val));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
  X_PFX(cvt_vptr_to_uint) (void *val) {
     size_t sv = (size_t) val;
     unsigned int uv = (unsigned int) sv;
-- 
1.7.9.3



More information about the xorg-devel mailing list