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

Tomas Carnecky tom at dbservice.com
Fri Mar 20 10:36:56 PDT 2009


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 <tom at dbservice.com>
---

I think this will break drivers if you try to compile them with a compiler
that doesn't support C99 inline. Each driver probably also needs AC_C_INLINE
in its configure.ac. Is there some kind of common AC macro that is executed
by all xorg modules where this check could be added? Or does each module have
to be update individually?

 hw/xfree86/common/compiler.h           |  238 +++++++++++++++-----------------
 hw/xfree86/os-support/bus/linuxPci.c   |    2 +-
 hw/xfree86/os-support/misc/BUSmemcpy.c |    4 +-
 hw/xfree86/x86emu/sys.c                |   12 +-
 hw/xquartz/xpr/x-hash.h                |    8 +-
 5 files changed, 124 insertions(+), 140 deletions(-)

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 2601693..6810a4c 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -59,25 +59,9 @@
 # include <X11/Xfuncproto.h>
 #endif
 
-/* 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__)
@@ -137,42 +121,42 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
 /*  *before* any inx/outx is done. */
 
 extern _X_EXPORT void (*_alpha_outb)(char val, unsigned long port);
-static __inline__ void
+static inline void
 outb(unsigned long port, unsigned char val)
 {
     _alpha_outb(val, port);
 }
 
 extern _X_EXPORT void (*_alpha_outw)(short val, unsigned long port);
-static __inline__ void
+static inline void
 outw(unsigned long port, unsigned short val)
 {
     _alpha_outw(val, port);
 }
 
 extern _X_EXPORT void (*_alpha_outl)(int val, unsigned long port);
-static __inline__ void
+static inline void
 outl(unsigned long port, unsigned int val)
 {
     _alpha_outl(val, port);
 }
 
 extern _X_EXPORT unsigned int (*_alpha_inb)(unsigned long port);
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned long port)
 {
   return _alpha_inb(port);
 }
 
 extern _X_EXPORT unsigned int (*_alpha_inw)(unsigned long port);
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned long port)
 {
   return _alpha_inw(port);
 }
 
 extern _X_EXPORT unsigned int (*_alpha_inl)(unsigned long port);
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned long port)
 {
   return _alpha_inl(port);
@@ -221,7 +205,7 @@ struct __una_u16 { unsigned short x __attribute__((packed)); };
  */
 /* let's try making these things static */
 
-static __inline__ unsigned long ldq_u(unsigned long * r11)
+static inline unsigned long ldq_u(unsigned long * r11)
 {
 #    if defined(__GNUC__)
 	const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
@@ -240,7 +224,7 @@ static __inline__ unsigned long ldq_u(unsigned long * r11)
 #    endif
 }
 
-static __inline__ unsigned long ldl_u(unsigned int * r11)
+static inline unsigned long ldl_u(unsigned int * r11)
 {
 #    if defined(__GNUC__)
 	const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
@@ -259,7 +243,7 @@ static __inline__ unsigned long ldl_u(unsigned int * r11)
 #    endif
 }
 
-static __inline__ unsigned long ldw_u(unsigned short * r11)
+static inline unsigned long ldw_u(unsigned short * r11)
 {
 #    if defined(__GNUC__)
 	const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
@@ -282,7 +266,7 @@ static __inline__ unsigned long ldw_u(unsigned short * r11)
  * Elemental unaligned stores 
  */
 
-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
+static inline void stq_u(unsigned long r5, unsigned long * r11)
 {
 #    if defined(__GNUC__)
 	struct __una_u64 *ptr = (struct __una_u64 *) r11;
@@ -307,7 +291,7 @@ static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
 #    endif
 }
 
-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
+static inline void stl_u(unsigned long r5, unsigned int * r11)
 {
 #    if defined(__GNUC__)
 	struct __una_u32 *ptr = (struct __una_u32 *) r11;
@@ -332,7 +316,7 @@ static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
 #    endif
 }
 
-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
+static inline void stw_u(unsigned long r5, unsigned short * r11)
 {
 #    if defined(__GNUC__)
 	struct __una_u16 *ptr = (struct __una_u16 *) r11;
@@ -369,42 +353,42 @@ struct __una_u64 { uint64_t x __attribute__((packed)); };
 struct __una_u32 { uint32_t x __attribute__((packed)); };
 struct __una_u16 { uint16_t x __attribute__((packed)); };
 
-static __inline__ unsigned long
+static inline unsigned long
 __uldq (const unsigned long * r11)
 {
 	const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
 	return ptr->x;
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 __uldl (const unsigned int * r11)
 {
 	const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
 	return ptr->x;
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 __uldw (const unsigned short * r11)
 {
 	const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
 	return ptr->x;
 }
 
-static __inline__ void
+static inline void
 __ustq (unsigned long r5, unsigned long * r11)
 {
 	struct __una_u64 *ptr = (struct __una_u64 *) r11;
 	ptr->x = r5;
 }
 
-static __inline__ void
+static inline void
 __ustl (unsigned long r5, unsigned int * r11)
 {
 	struct __una_u32 *ptr = (struct __una_u32 *) r11;
 	ptr->x = r5;
 }
 
-static __inline__ void
+static inline void
 __ustw (unsigned long r5, unsigned short * r11)
 {
 	struct __una_u16 *ptr = (struct __una_u16 *) r11;
@@ -478,26 +462,26 @@ extern _X_EXPORT unsigned int inl(unsigned long port);
        __asm__ __volatile__ ("": : :"memory")
 
 
-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;
@@ -507,7 +491,7 @@ inb(unsigned short port)
    return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
    unsigned short ret;
@@ -517,7 +501,7 @@ inw(unsigned short port)
    return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
    unsigned int ret;
@@ -535,7 +519,7 @@ inl(unsigned short port)
 
 #     define barrier() __asm__ __volatile__(".word 0x8143e00a": : :"memory")
 
-static __inline__ void
+static inline void
 outb(unsigned long port, unsigned char val)
 {
 	__asm__ __volatile__("stba %0, [%1] %2"
@@ -544,7 +528,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"
@@ -553,7 +537,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"
@@ -562,7 +546,7 @@ outl(unsigned long port, unsigned int val)
 	barrier();
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned long port)
 {
 	unsigned int ret;
@@ -572,7 +556,7 @@ inb(unsigned long port)
 	return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned long port)
 {
 	unsigned int ret;
@@ -582,7 +566,7 @@ inw(unsigned long port)
 	return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned long port)
 {
 	unsigned int ret;
@@ -592,7 +576,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;
@@ -604,7 +588,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;
@@ -616,7 +600,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;
@@ -628,7 +612,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;
@@ -640,7 +624,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;
@@ -652,7 +636,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)
 {
@@ -664,7 +648,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)
 {
@@ -676,7 +660,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)
 {
@@ -688,7 +672,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)
 {
@@ -700,7 +684,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)
 {
@@ -712,7 +696,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)
 {
@@ -723,7 +707,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)
 {
@@ -734,7 +718,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)
 {
@@ -745,7 +729,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)
 {
@@ -756,7 +740,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)
 {
@@ -779,7 +763,7 @@ struct __una_u64 { unsigned long  x __attribute__((packed)); };
 struct __una_u32 { unsigned int   x __attribute__((packed)); };
 struct __una_u16 { unsigned short x __attribute__((packed)); };
 
-static __inline__ unsigned long ldq_u(unsigned long *p)
+static inline unsigned long ldq_u(unsigned long *p)
 {
 #    if defined(__GNUC__)
 #     if defined(__arch64__) || defined(__sparcv9)
@@ -795,7 +779,7 @@ static __inline__ unsigned long ldq_u(unsigned long *p)
 #    endif
 }
 
-static __inline__ unsigned long ldl_u(unsigned int *p)
+static inline unsigned long ldl_u(unsigned int *p)
 {
 #    if defined(__GNUC__)
 	const struct __una_u32 *ptr = (const struct __una_u32 *) p;
@@ -807,7 +791,7 @@ static __inline__ unsigned long ldl_u(unsigned int *p)
 #    endif
 }
 
-static __inline__ unsigned long ldw_u(unsigned short *p)
+static inline unsigned long ldw_u(unsigned short *p)
 {
 #    if defined(__GNUC__)
 	const struct __una_u16 *ptr = (const struct __una_u16 *) p;
@@ -819,7 +803,7 @@ static __inline__ unsigned long ldw_u(unsigned short *p)
 #    endif
 }
 
-static __inline__ void stq_u(unsigned long val, unsigned long *p)
+static inline void stq_u(unsigned long val, unsigned long *p)
 {
 #    if defined(__GNUC__)
 #     if defined(__arch64__) || defined(__sparcv9)
@@ -834,7 +818,7 @@ static __inline__ void stq_u(unsigned long val, unsigned long *p)
 #    endif
 }
 
-static __inline__ void stl_u(unsigned long val, unsigned int *p)
+static inline void stl_u(unsigned long val, unsigned int *p)
 {
 #    if defined(__GNUC__)
 	struct __una_u32 *ptr = (struct __una_u32 *) p;
@@ -845,7 +829,7 @@ static __inline__ void stl_u(unsigned long val, unsigned int *p)
 #    endif
 }
 
-static __inline__ void stw_u(unsigned long val, unsigned short *p)
+static inline void stw_u(unsigned long val, unsigned short *p)
 {
 #    if defined(__GNUC__)
 	struct __una_u16 *ptr = (struct __una_u16 *) p;
@@ -868,37 +852,37 @@ static __inline__ void stw_u(unsigned long val, unsigned short *p)
 
 _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))+IOPortBase);
@@ -906,7 +890,7 @@ inl(unsigned PORT_SIZE port)
 
 
 #    if defined(__mips__)
-static __inline__ unsigned long ldq_u(unsigned long * r11)
+static inline unsigned long ldq_u(unsigned long * r11)
 {
 	unsigned long r1;
 	__asm__("lwr %0,%2\n\t"
@@ -918,7 +902,7 @@ static __inline__ unsigned long ldq_u(unsigned long * r11)
 	return r1;
 }
 
-static __inline__ unsigned long ldl_u(unsigned int * r11)
+static inline unsigned long ldl_u(unsigned int * r11)
 {
 	unsigned long r1;
 	__asm__("lwr %0,%2\n\t"
@@ -930,7 +914,7 @@ static __inline__ unsigned long ldl_u(unsigned int * r11)
 	return r1;
 }
 
-static __inline__ unsigned long ldw_u(unsigned short * r11)
+static inline unsigned long ldw_u(unsigned short * r11)
 {
 	unsigned long r1;
 	__asm__("lwr %0,%2\n\t"
@@ -953,20 +937,20 @@ static __inline__ unsigned long ldw_u(unsigned short * r11)
 struct __una_u32 { unsigned int   x __attribute__((packed)); };
 struct __una_u16 { unsigned short x __attribute__((packed)); };
 
-static __inline__ void stw_u(unsigned long val, unsigned short *p)
+static inline void stw_u(unsigned long val, unsigned short *p)
 {
 	struct __una_u16 *ptr = (struct __una_u16 *) p;
 	ptr->x = val;
 }
 
-static __inline__ void stl_u(unsigned long val, unsigned int *p)
+static inline void stl_u(unsigned long val, unsigned int *p)
 {
 	struct __una_u32 *ptr = (struct __una_u32 *) p;
 	ptr->x = val;
 }
 
 #       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;
@@ -978,7 +962,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)
 {
@@ -1046,7 +1030,7 @@ extern _X_EXPORT volatile unsigned char *ioBase;
 # define eieio() __asm__ __volatile__ ("eieio" ::: "memory")
 #endif /* eieio */
 
-static __inline__ unsigned char
+static inline unsigned char
 xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
 {
         register unsigned char val;
@@ -1059,7 +1043,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;
@@ -1072,7 +1056,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;
@@ -1085,7 +1069,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;
@@ -1098,7 +1082,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;
@@ -1111,7 +1095,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)
 {
@@ -1121,7 +1105,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)
 {
@@ -1131,7 +1115,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)
 {
@@ -1141,7 +1125,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)
 {
@@ -1151,7 +1135,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)
 {
@@ -1161,7 +1145,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)
 {
@@ -1169,7 +1153,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)
 {
@@ -1177,7 +1161,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)
 {
@@ -1185,7 +1169,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)
 {
@@ -1193,7 +1177,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)
 {
@@ -1202,42 +1186,42 @@ xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
 }
 
 
-static __inline__ void
+static inline void
 outb(unsigned short port, unsigned char value)
 {
         if(ioBase == MAP_FAILED) return;
         xf86WriteMmio8((void *)ioBase, port, value);
 }
 
-static __inline__ void
+static inline void
 outw(unsigned short port, unsigned short value)
 {
         if(ioBase == MAP_FAILED) return;
         xf86WriteMmio16Le((void *)ioBase, port, value);
 }
 
-static __inline__ void
+static inline void
 outl(unsigned short port, unsigned int value)
 {
         if(ioBase == MAP_FAILED) return;
         xf86WriteMmio32Le((void *)ioBase, port, value);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inb(unsigned short port)
 {
         if(ioBase == MAP_FAILED) return 0;
         return xf86ReadMmio8((void *)ioBase, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
         if(ioBase == MAP_FAILED) return 0;
         return xf86ReadMmio16Le((void *)ioBase, port);
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
         if(ioBase == MAP_FAILED) return 0;
@@ -1280,19 +1264,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);
@@ -1332,26 +1316,26 @@ do {									\
  * 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;
@@ -1361,7 +1345,7 @@ inb(unsigned short port)
    return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
    unsigned short ret;
@@ -1371,7 +1355,7 @@ inw(unsigned short port)
    return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
    unsigned int ret;
@@ -1383,25 +1367,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;
@@ -1411,7 +1395,7 @@ inb(unsigned short port)
   return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inw(unsigned short port)
 {
   unsigned short ret;
@@ -1421,7 +1405,7 @@ inw(unsigned short port)
   return ret;
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 inl(unsigned short port)
 {
   unsigned int ret;
@@ -1435,34 +1419,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;
@@ -1524,7 +1508,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)
 {
 	__asm__ __volatile__("mb"  : : : "memory");
@@ -1608,7 +1592,7 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
 #  define MMIO_MOVE32(base, offset, val) \
        xf86WriteMmio32Be(base, offset, (CARD32)(val))
 
-static __inline__ void ppc_flush_icache(char *addr)
+static inline void ppc_flush_icache(char *addr)
 {
 	__asm__ volatile (
 		"dcbf 0,%0;" 
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index a60df25..8ec39f6 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -284,7 +284,7 @@ linuxGetSizesStruct(const struct pci_device *dev)
     return & default_size;
 }
 
-static __inline__ unsigned long
+static inline unsigned long
 linuxGetIOSize(const struct pci_device *dev)
 {
     const struct pciSizes * const sizes = linuxGetSizesStruct(dev);
diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.c b/hw/xfree86/os-support/misc/BUSmemcpy.c
index e6ffde9..d5887c3 100644
--- a/hw/xfree86/os-support/misc/BUSmemcpy.c
+++ b/hw/xfree86/os-support/misc/BUSmemcpy.c
@@ -110,7 +110,7 @@ xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
  *
  * Note the ordering to try to avoid load (and address generation) latencies.
  */
-static __inline__ void __memcpy_unaligned(unsigned long d, unsigned long s, long n)
+static inline void __memcpy_unaligned(unsigned long d, unsigned long s, long n)
 {
 	ALIGN_DEST_TO8(d,s,n);
 	n -= 8;			/* to avoid compare against 8 in the loop */
@@ -145,7 +145,7 @@ static __inline__ void __memcpy_unaligned(unsigned long d, unsigned long s, long
  *
  * Note the ordering to try to avoid load (and address generation) latencies.
  */
-static __inline__ void __memcpy_aligned(unsigned long d, unsigned long s, long n)
+static inline void __memcpy_aligned(unsigned long d, unsigned long s, long n)
 {
 	ALIGN_DEST_TO8(d,s,n);
 	n -= 8;
diff --git a/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c
index e15fb09..e5806eb 100644
--- a/hw/xfree86/x86emu/sys.c
+++ b/hw/xfree86/x86emu/sys.c
@@ -74,7 +74,7 @@ struct __una_u32 { unsigned int   x __attribute__((packed)); };
 struct __una_u16 { unsigned short x __attribute__((packed)); };
 #endif
 
-static __inline__ unsigned long ldq_u(unsigned long * r11)
+static inline unsigned long ldq_u(unsigned long * r11)
 {
 #if defined(__GNUC__)
 	const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
@@ -93,7 +93,7 @@ static __inline__ unsigned long ldq_u(unsigned long * r11)
 #endif
 }
 
-static __inline__ unsigned long ldl_u(unsigned int * r11)
+static inline unsigned long ldl_u(unsigned int * r11)
 {
 #if defined(__GNUC__)
 	const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
@@ -112,7 +112,7 @@ static __inline__ unsigned long ldl_u(unsigned int * r11)
 #endif
 }
 
-static __inline__ unsigned long ldw_u(unsigned short * r11)
+static inline unsigned long ldw_u(unsigned short * r11)
 {
 #if defined(__GNUC__)
 	const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
@@ -135,7 +135,7 @@ static __inline__ unsigned long ldw_u(unsigned short * r11)
  * Elemental unaligned stores 
  */
 
-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
+static inline void stq_u(unsigned long r5, unsigned long * r11)
 {
 #if defined(__GNUC__)
 	struct __una_u64 *ptr = (struct __una_u64 *) r11;
@@ -160,7 +160,7 @@ static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
 #endif
 }
 
-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
+static inline void stl_u(unsigned long r5, unsigned int * r11)
 {
 #if defined(__GNUC__)
 	struct __una_u32 *ptr = (struct __una_u32 *) r11;
@@ -185,7 +185,7 @@ static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
 #endif
 }
 
-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
+static inline void stw_u(unsigned long r5, unsigned short * r11)
 {
 #if defined(__GNUC__)
 	struct __una_u16 *ptr = (struct __una_u16 *) r11;
diff --git a/hw/xquartz/xpr/x-hash.h b/hw/xquartz/xpr/x-hash.h
index 78bc7b3..99b2bf0 100644
--- a/hw/xquartz/xpr/x-hash.h
+++ b/hw/xquartz/xpr/x-hash.h
@@ -63,19 +63,19 @@ 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 *
+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 *
+static inline void *
 X_PFX (cvt_uint_to_vptr) (unsigned int val)
 {
 	return (void*)((size_t)(val));
 }
 
-static __inline__ unsigned int
+static inline unsigned int
 X_PFX (cvt_vptr_to_uint) (void * val)
 {
 	size_t sv = (size_t)val;
-- 
1.6.2




More information about the xorg-devel mailing list