[PATCH 1/3] Standartize on C99 inline

Dan Nicholson dbn.lists at gmail.com
Fri Mar 20 11:03:11 PDT 2009


On Fri, Mar 20, 2009 at 10:36 AM, Tomas Carnecky <tom at dbservice.com> wrote:
> The current code uses a mix of inline, __inline, __inline__ and _X_INLINE.
> Standartize on C99 inline, but add AC_C_INLINE to configure.ac to take care
> of old compilers. Also remove reference to _X_INLINE in doc/c-extensions.
>
> Signed-off-by: Tomas Carnecky <tom at dbservice.com>
> ---
>  Xext/security.c  |    2 +-
>  configure.ac     |    1 +
>  dix/privates.c   |    2 +-
>  dix/resource.c   |    2 +-
>  dix/selection.c  |    2 +-
>  doc/c-extensions |    2 --
>  exa/exa.c        |    2 +-
>  exa/exa_priv.h   |    2 +-
>  mi/miarc.c       |    4 ++--
>  mi/mifpoly.h     |    2 +-
>  mi/miregion.c    |    4 ++--
>  11 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/Xext/security.c b/Xext/security.c
> index c9077c8..ad80e5f 100644
> --- a/Xext/security.c
> +++ b/Xext/security.c
> @@ -143,7 +143,7 @@ SecurityLabelInitial(void)
>  /*
>  * Looks up a request name
>  */
> -static _X_INLINE const char *
> +static inline const char *
>  SecurityLookupRequestName(ClientPtr client)
>  {
>     int major = ((xReq *)client->requestBuffer)->reqType;
> diff --git a/configure.ac b/configure.ac
> index f4e1dbb..f02292f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -109,6 +109,7 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
>
>  dnl Checks for typedefs, structures, and compiler characteristics.
>  AC_C_CONST
> +AC_C_INLINE
>  AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])

You could do this check once in xproto and define _X_INLINE
appropriately. Then all X users could take advantage of it.

--
Dan


More information about the xorg-devel mailing list