Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -60,7 +60,7 @@ in this Software without prior written authorization from The Open Group.
|
||||
#ifdef NARROWPROTO
|
||||
#define NeedWidePrototypes 0
|
||||
#else
|
||||
#define NeedWidePrototypes 1 /* default to make interropt. easier */
|
||||
#define NeedWidePrototypes 1 /* default to make interropt. easier */
|
||||
#endif
|
||||
#endif /* NeedWidePrototypes */
|
||||
|
||||
@@ -68,7 +68,9 @@ in this Software without prior written authorization from The Open Group.
|
||||
|
||||
#ifndef _XFUNCPROTOBEGIN
|
||||
#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
|
||||
#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
|
||||
#define _XFUNCPROTOBEGIN \
|
||||
extern "C" \
|
||||
{ /* do not leave open across includes */
|
||||
#define _XFUNCPROTOEND }
|
||||
#else
|
||||
#define _XFUNCPROTOBEGIN
|
||||
@@ -78,98 +80,97 @@ in this Software without prior written authorization from The Open Group.
|
||||
|
||||
/* Added in X11R6.9, so available in any version of modular xproto */
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
|
||||
#define _X_SENTINEL(x) __attribute__((__sentinel__(x)))
|
||||
#else
|
||||
# define _X_SENTINEL(x)
|
||||
#define _X_SENTINEL(x)
|
||||
#endif /* GNUC >= 4 */
|
||||
|
||||
/* Added in X11R6.9, so available in any version of modular xproto */
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(__MINGW32__)
|
||||
# define _X_EXPORT __attribute__((visibility("default")))
|
||||
# define _X_HIDDEN __attribute__((visibility("hidden")))
|
||||
# define _X_INTERNAL __attribute__((visibility("internal")))
|
||||
#define _X_EXPORT __attribute__((visibility("default")))
|
||||
#define _X_HIDDEN __attribute__((visibility("hidden")))
|
||||
#define _X_INTERNAL __attribute__((visibility("internal")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
||||
# define _X_EXPORT __global
|
||||
# define _X_HIDDEN __hidden
|
||||
# define _X_INTERNAL __hidden
|
||||
#define _X_EXPORT __global
|
||||
#define _X_HIDDEN __hidden
|
||||
#define _X_INTERNAL __hidden
|
||||
#else /* not gcc >= 4 and not Sun Studio >= 8 */
|
||||
# define _X_EXPORT
|
||||
# define _X_HIDDEN
|
||||
# define _X_INTERNAL
|
||||
#define _X_EXPORT
|
||||
#define _X_HIDDEN
|
||||
#define _X_INTERNAL
|
||||
#endif /* GNUC >= 4 */
|
||||
|
||||
/* requires xproto >= 7.0.9 */
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
|
||||
# define _X_LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#define _X_LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
#define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#else /* not gcc >= 3.3 */
|
||||
# define _X_LIKELY(x) (x)
|
||||
# define _X_UNLIKELY(x) (x)
|
||||
#define _X_LIKELY(x) (x)
|
||||
#define _X_UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
/* Added in X11R6.9, so available in any version of modular xproto */
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
|
||||
# define _X_DEPRECATED __attribute__((deprecated))
|
||||
#define _X_DEPRECATED __attribute__((deprecated))
|
||||
#else /* not gcc >= 3.1 */
|
||||
# define _X_DEPRECATED
|
||||
#define _X_DEPRECATED
|
||||
#endif
|
||||
|
||||
/* requires xproto >= 7.0.17 */
|
||||
#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
|
||||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||
# define _X_NORETURN __attribute((noreturn))
|
||||
#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||
#define _X_NORETURN __attribute((noreturn))
|
||||
#else
|
||||
# define _X_NORETURN
|
||||
#define _X_NORETURN
|
||||
#endif /* GNUC */
|
||||
|
||||
/* Added in X11R6.9, so available in any version of modular xproto */
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
|
||||
# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
|
||||
#define _X_ATTRIBUTE_PRINTF(x, y) __attribute__((__format__(__printf__, x, y)))
|
||||
#else /* not gcc >= 2.3 */
|
||||
# define _X_ATTRIBUTE_PRINTF(x,y)
|
||||
#define _X_ATTRIBUTE_PRINTF(x, y)
|
||||
#endif
|
||||
|
||||
/* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable
|
||||
argument macros, must be only used inside #ifdef _X_NONNULL guards, as
|
||||
many legacy X clients are compiled in C89 mode still. */
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
|
||||
#define _X_NONNULL(args...) __attribute__((nonnull(args)))
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
|
||||
#define _X_NONNULL(args...) __attribute__((nonnull(args)))
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
|
||||
#define _X_NONNULL(...) /* */
|
||||
#define _X_NONNULL(...) /* */
|
||||
#endif
|
||||
|
||||
/* requires xproto >= 7.0.22 */
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
|
||||
#define _X_UNUSED __attribute__((__unused__))
|
||||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
|
||||
#define _X_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
#define _X_UNUSED /* */
|
||||
#define _X_UNUSED /* */
|
||||
#endif
|
||||
|
||||
/* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */
|
||||
/* requires xproto >= 7.0.9
|
||||
(introduced in 7.0.8 but didn't support all compilers until 7.0.9) */
|
||||
#if defined(inline) /* assume autoconf set it correctly */ || \
|
||||
(defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \
|
||||
(defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
|
||||
# define _X_INLINE inline
|
||||
#if defined(inline) /* assume autoconf set it correctly */ || \
|
||||
(defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \
|
||||
(defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
|
||||
#define _X_INLINE inline
|
||||
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
|
||||
# define _X_INLINE __inline__
|
||||
#define _X_INLINE __inline__
|
||||
#else
|
||||
# define _X_INLINE
|
||||
#define _X_INLINE
|
||||
#endif
|
||||
|
||||
/* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */
|
||||
/* requires xproto >= 7.0.21 */
|
||||
#ifndef _X_RESTRICT_KYWD
|
||||
# if defined(restrict) /* assume autoconf set it correctly */ || \
|
||||
(defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \
|
||||
&& !defined(__cplusplus)) /* Workaround g++ issue on Solaris */
|
||||
# define _X_RESTRICT_KYWD restrict
|
||||
# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
|
||||
# define _X_RESTRICT_KYWD __restrict__
|
||||
# else
|
||||
# define _X_RESTRICT_KYWD
|
||||
# endif
|
||||
#if defined(restrict) /* assume autoconf set it correctly */ || \
|
||||
(defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \
|
||||
&& !defined(__cplusplus)) /* Workaround g++ issue on Solaris */
|
||||
#define _X_RESTRICT_KYWD restrict
|
||||
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
|
||||
#define _X_RESTRICT_KYWD __restrict__
|
||||
#else
|
||||
#define _X_RESTRICT_KYWD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _XFUNCPROTO_H_ */
|
||||
|
||||
Reference in New Issue
Block a user