mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 04:28:33 +00:00
*: Fix new linter errors
This commit is contained in:
@@ -12,8 +12,8 @@
|
|||||||
#define REMOTE_TYPE(type) typedef uint64_t type
|
#define REMOTE_TYPE(type) typedef uint64_t type
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
#define ArrayOf(...) Array
|
# define ArrayOf(...) Array
|
||||||
#define DictionaryOf(...) Dictionary
|
# define DictionaryOf(...) Dictionary
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Basic types
|
// Basic types
|
||||||
|
@@ -42,168 +42,168 @@
|
|||||||
// $ echo | clang -dM -E -
|
// $ echo | clang -dM -E -
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_MALLOC
|
#ifdef FUNC_ATTR_MALLOC
|
||||||
#undef FUNC_ATTR_MALLOC
|
# undef FUNC_ATTR_MALLOC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_ALLOC_SIZE
|
#ifdef FUNC_ATTR_ALLOC_SIZE
|
||||||
#undef FUNC_ATTR_ALLOC_SIZE
|
# undef FUNC_ATTR_ALLOC_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_ALLOC_SIZE_PROD
|
#ifdef FUNC_ATTR_ALLOC_SIZE_PROD
|
||||||
#undef FUNC_ATTR_ALLOC_SIZE_PROD
|
# undef FUNC_ATTR_ALLOC_SIZE_PROD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_ALLOC_ALIGN
|
#ifdef FUNC_ATTR_ALLOC_ALIGN
|
||||||
#undef FUNC_ATTR_ALLOC_ALIGN
|
# undef FUNC_ATTR_ALLOC_ALIGN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_PURE
|
#ifdef FUNC_ATTR_PURE
|
||||||
#undef FUNC_ATTR_PURE
|
# undef FUNC_ATTR_PURE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_CONST
|
#ifdef FUNC_ATTR_CONST
|
||||||
#undef FUNC_ATTR_CONST
|
# undef FUNC_ATTR_CONST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_WARN_UNUSED_RESULT
|
#ifdef FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
#undef FUNC_ATTR_WARN_UNUSED_RESULT
|
# undef FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_ALWAYS_INLINE
|
#ifdef FUNC_ATTR_ALWAYS_INLINE
|
||||||
#undef FUNC_ATTR_ALWAYS_INLINE
|
# undef FUNC_ATTR_ALWAYS_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_UNUSED
|
#ifdef FUNC_ATTR_UNUSED
|
||||||
#undef FUNC_ATTR_UNUSED
|
# undef FUNC_ATTR_UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_NONNULL_ALL
|
#ifdef FUNC_ATTR_NONNULL_ALL
|
||||||
#undef FUNC_ATTR_NONNULL_ALL
|
# undef FUNC_ATTR_NONNULL_ALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_NONNULL_ARG
|
#ifdef FUNC_ATTR_NONNULL_ARG
|
||||||
#undef FUNC_ATTR_NONNULL_ARG
|
# undef FUNC_ATTR_NONNULL_ARG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUNC_ATTR_NONNULL_RET
|
#ifdef FUNC_ATTR_NONNULL_RET
|
||||||
#undef FUNC_ATTR_NONNULL_RET
|
# undef FUNC_ATTR_NONNULL_RET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DID_REAL_ATTR
|
#ifndef DID_REAL_ATTR
|
||||||
#define DID_REAL_ATTR
|
# define DID_REAL_ATTR
|
||||||
#ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
// place defines for all gnulikes here, for now that's gcc, clang and
|
// place defines for all gnulikes here, for now that's gcc, clang and
|
||||||
// intel.
|
// intel.
|
||||||
|
|
||||||
// place these after the argument list of the function declaration
|
// place these after the argument list of the function declaration
|
||||||
// (not definition), like so:
|
// (not definition), like so:
|
||||||
// void myfunc(void) REAL_FATTR_ALWAYS_INLINE;
|
// void myfunc(void) REAL_FATTR_ALWAYS_INLINE;
|
||||||
#define REAL_FATTR_MALLOC __attribute__((malloc))
|
# define REAL_FATTR_MALLOC __attribute__((malloc))
|
||||||
#define REAL_FATTR_ALLOC_ALIGN(x) __attribute__((alloc_align(x)))
|
# define REAL_FATTR_ALLOC_ALIGN(x) __attribute__((alloc_align(x)))
|
||||||
#define REAL_FATTR_PURE __attribute__ ((pure))
|
# define REAL_FATTR_PURE __attribute__ ((pure))
|
||||||
#define REAL_FATTR_CONST __attribute__((const))
|
# define REAL_FATTR_CONST __attribute__((const))
|
||||||
#define REAL_FATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
# define REAL_FATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||||
#define REAL_FATTR_ALWAYS_INLINE __attribute__((always_inline))
|
# define REAL_FATTR_ALWAYS_INLINE __attribute__((always_inline))
|
||||||
#define REAL_FATTR_UNUSED __attribute__((unused))
|
# define REAL_FATTR_UNUSED __attribute__((unused))
|
||||||
#define REAL_FATTR_NONNULL_ALL __attribute__((nonnull))
|
# define REAL_FATTR_NONNULL_ALL __attribute__((nonnull))
|
||||||
#define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__)))
|
# define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||||
|
|
||||||
#ifdef __clang__
|
# ifdef __clang__
|
||||||
// clang only
|
// clang only
|
||||||
#elif defined(__INTEL_COMPILER)
|
# elif defined(__INTEL_COMPILER)
|
||||||
// intel only
|
// intel only
|
||||||
#else
|
# else
|
||||||
#define GCC_VERSION \
|
# define GCC_VERSION \
|
||||||
(__GNUC__ * 10000 + \
|
(__GNUC__ * 10000 + \
|
||||||
__GNUC_MINOR__ * 100 + \
|
__GNUC_MINOR__ * 100 + \
|
||||||
__GNUC_PATCHLEVEL__)
|
__GNUC_PATCHLEVEL__)
|
||||||
// gcc only
|
// gcc only
|
||||||
#define REAL_FATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
# define REAL_FATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
||||||
#define REAL_FATTR_ALLOC_SIZE_PROD(x,y) __attribute__((alloc_size(x,y)))
|
# define REAL_FATTR_ALLOC_SIZE_PROD(x,y) __attribute__((alloc_size(x,y)))
|
||||||
#if GCC_VERSION >= 40900
|
# if GCC_VERSION >= 40900
|
||||||
#define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull))
|
# define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull))
|
||||||
#endif
|
# endif
|
||||||
#endif
|
# endif
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
// define function attributes that haven't been defined for this specific
|
// define function attributes that haven't been defined for this specific
|
||||||
// compiler.
|
// compiler.
|
||||||
|
|
||||||
#ifndef REAL_FATTR_MALLOC
|
# ifndef REAL_FATTR_MALLOC
|
||||||
#define REAL_FATTR_MALLOC
|
# define REAL_FATTR_MALLOC
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_ALLOC_SIZE
|
# ifndef REAL_FATTR_ALLOC_SIZE
|
||||||
#define REAL_FATTR_ALLOC_SIZE(x)
|
# define REAL_FATTR_ALLOC_SIZE(x)
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_ALLOC_SIZE_PROD
|
# ifndef REAL_FATTR_ALLOC_SIZE_PROD
|
||||||
#define REAL_FATTR_ALLOC_SIZE_PROD(x,y)
|
# define REAL_FATTR_ALLOC_SIZE_PROD(x,y)
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_ALLOC_ALIGN
|
# ifndef REAL_FATTR_ALLOC_ALIGN
|
||||||
#define REAL_FATTR_ALLOC_ALIGN(x)
|
# define REAL_FATTR_ALLOC_ALIGN(x)
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_PURE
|
# ifndef REAL_FATTR_PURE
|
||||||
#define REAL_FATTR_PURE
|
# define REAL_FATTR_PURE
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_CONST
|
# ifndef REAL_FATTR_CONST
|
||||||
#define REAL_FATTR_CONST
|
# define REAL_FATTR_CONST
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_WARN_UNUSED_RESULT
|
# ifndef REAL_FATTR_WARN_UNUSED_RESULT
|
||||||
#define REAL_FATTR_WARN_UNUSED_RESULT
|
# define REAL_FATTR_WARN_UNUSED_RESULT
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_ALWAYS_INLINE
|
# ifndef REAL_FATTR_ALWAYS_INLINE
|
||||||
#define REAL_FATTR_ALWAYS_INLINE
|
# define REAL_FATTR_ALWAYS_INLINE
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_UNUSED
|
# ifndef REAL_FATTR_UNUSED
|
||||||
#define REAL_FATTR_UNUSED
|
# define REAL_FATTR_UNUSED
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_NONNULL_ALL
|
# ifndef REAL_FATTR_NONNULL_ALL
|
||||||
#define REAL_FATTR_NONNULL_ALL
|
# define REAL_FATTR_NONNULL_ALL
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_NONNULL_ARG
|
# ifndef REAL_FATTR_NONNULL_ARG
|
||||||
#define REAL_FATTR_NONNULL_ARG(...)
|
# define REAL_FATTR_NONNULL_ARG(...)
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
#ifndef REAL_FATTR_NONNULL_RET
|
# ifndef REAL_FATTR_NONNULL_RET
|
||||||
#define REAL_FATTR_NONNULL_RET
|
# define REAL_FATTR_NONNULL_RET
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEFINE_FUNC_ATTRIBUTES
|
#ifdef DEFINE_FUNC_ATTRIBUTES
|
||||||
#define FUNC_API_ASYNC
|
# define FUNC_API_ASYNC
|
||||||
#define FUNC_API_NOEXPORT
|
# define FUNC_API_NOEXPORT
|
||||||
#define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC
|
# define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC
|
||||||
#define FUNC_ATTR_ALLOC_SIZE(x) REAL_FATTR_ALLOC_SIZE(x)
|
# define FUNC_ATTR_ALLOC_SIZE(x) REAL_FATTR_ALLOC_SIZE(x)
|
||||||
#define FUNC_ATTR_ALLOC_SIZE_PROD(x,y) REAL_FATTR_ALLOC_SIZE_PROD(x,y)
|
# define FUNC_ATTR_ALLOC_SIZE_PROD(x,y) REAL_FATTR_ALLOC_SIZE_PROD(x,y)
|
||||||
#define FUNC_ATTR_ALLOC_ALIGN(x) REAL_FATTR_ALLOC_ALIGN(x)
|
# define FUNC_ATTR_ALLOC_ALIGN(x) REAL_FATTR_ALLOC_ALIGN(x)
|
||||||
#define FUNC_ATTR_PURE REAL_FATTR_PURE
|
# define FUNC_ATTR_PURE REAL_FATTR_PURE
|
||||||
#define FUNC_ATTR_CONST REAL_FATTR_CONST
|
# define FUNC_ATTR_CONST REAL_FATTR_CONST
|
||||||
#define FUNC_ATTR_WARN_UNUSED_RESULT REAL_FATTR_WARN_UNUSED_RESULT
|
# define FUNC_ATTR_WARN_UNUSED_RESULT REAL_FATTR_WARN_UNUSED_RESULT
|
||||||
#define FUNC_ATTR_ALWAYS_INLINE REAL_FATTR_ALWAYS_INLINE
|
# define FUNC_ATTR_ALWAYS_INLINE REAL_FATTR_ALWAYS_INLINE
|
||||||
#define FUNC_ATTR_UNUSED REAL_FATTR_UNUSED
|
# define FUNC_ATTR_UNUSED REAL_FATTR_UNUSED
|
||||||
#define FUNC_ATTR_NONNULL_ALL REAL_FATTR_NONNULL_ALL
|
# define FUNC_ATTR_NONNULL_ALL REAL_FATTR_NONNULL_ALL
|
||||||
#define FUNC_ATTR_NONNULL_ARG(...) REAL_FATTR_NONNULL_ARG(__VA_ARGS__)
|
# define FUNC_ATTR_NONNULL_ARG(...) REAL_FATTR_NONNULL_ARG(__VA_ARGS__)
|
||||||
#define FUNC_ATTR_NONNULL_RET REAL_FATTR_NONNULL_RET
|
# define FUNC_ATTR_NONNULL_RET REAL_FATTR_NONNULL_RET
|
||||||
#elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
|
#elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
|
||||||
#define FUNC_ATTR_MALLOC
|
# define FUNC_ATTR_MALLOC
|
||||||
#define FUNC_ATTR_ALLOC_SIZE(x)
|
# define FUNC_ATTR_ALLOC_SIZE(x)
|
||||||
#define FUNC_ATTR_ALLOC_SIZE_PROD(x,y)
|
# define FUNC_ATTR_ALLOC_SIZE_PROD(x,y)
|
||||||
#define FUNC_ATTR_ALLOC_ALIGN(x)
|
# define FUNC_ATTR_ALLOC_ALIGN(x)
|
||||||
#define FUNC_ATTR_PURE
|
# define FUNC_ATTR_PURE
|
||||||
#define FUNC_ATTR_CONST
|
# define FUNC_ATTR_CONST
|
||||||
#define FUNC_ATTR_WARN_UNUSED_RESULT
|
# define FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
#define FUNC_ATTR_ALWAYS_INLINE
|
# define FUNC_ATTR_ALWAYS_INLINE
|
||||||
#define FUNC_ATTR_UNUSED
|
# define FUNC_ATTR_UNUSED
|
||||||
#define FUNC_ATTR_NONNULL_ALL
|
# define FUNC_ATTR_NONNULL_ALL
|
||||||
#define FUNC_ATTR_NONNULL_ARG(...)
|
# define FUNC_ATTR_NONNULL_ARG(...)
|
||||||
#define FUNC_ATTR_NONNULL_RET
|
# define FUNC_ATTR_NONNULL_RET
|
||||||
#endif
|
#endif
|
||||||
|
@@ -60,7 +60,7 @@ static int height, width;
|
|||||||
// See http://stackoverflow.com/a/11172679 for a better explanation of how it
|
// See http://stackoverflow.com/a/11172679 for a better explanation of how it
|
||||||
// works.
|
// works.
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define UI_CALL(funname, ...) \
|
# define UI_CALL(funname, ...) \
|
||||||
do { \
|
do { \
|
||||||
flush_cursor_update(); \
|
flush_cursor_update(); \
|
||||||
for (size_t i = 0; i < ui_count; i++) { \
|
for (size_t i = 0; i < ui_count; i++) { \
|
||||||
@@ -69,7 +69,7 @@ static int height, width;
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define UI_CALL(...) \
|
# define UI_CALL(...) \
|
||||||
do { \
|
do { \
|
||||||
flush_cursor_update(); \
|
flush_cursor_update(); \
|
||||||
for (size_t i = 0; i < ui_count; i++) { \
|
for (size_t i = 0; i < ui_count; i++) { \
|
||||||
|
Reference in New Issue
Block a user