1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-20 04:24:36 +08:00

clang-tidy: Enable check modernize-use-using

Annotate the remaining typedefs with NOLINT.
Unfortunately, clang-tidy is not smart enough and suggests the use
of using inside extern "C" blocks.
This commit is contained in:
Regina Pfeifer
2019-09-04 18:44:53 +02:00
parent a1ddf2d0ba
commit 1d3f5ebb0d
3 changed files with 20 additions and 5 deletions

View File

@@ -20,7 +20,6 @@ modernize-*,\
-modernize-use-nodiscard,\ -modernize-use-nodiscard,\
-modernize-use-noexcept,\ -modernize-use-noexcept,\
-modernize-use-transparent-functors,\ -modernize-use-transparent-functors,\
-modernize-use-using,\
performance-*,\ performance-*,\
readability-*,\ readability-*,\
-readability-function-size,\ -readability-function-size,\

View File

@@ -28,6 +28,7 @@ this is the structure of function entry points that a plugin may call. This
structure must be kept in sync with the static decaled at the bottom of structure must be kept in sync with the static decaled at the bottom of
cmCPLuginAPI.cxx cmCPLuginAPI.cxx
=========================================================================*/ =========================================================================*/
/* NOLINTNEXTLINE(modernize-use-using) */
typedef struct typedef struct
{ {
/*========================================================================= /*=========================================================================
@@ -194,12 +195,21 @@ define the different types of custom commands for a target
/*========================================================================= /*=========================================================================
Finally we define the key data structures and function prototypes Finally we define the key data structures and function prototypes
=========================================================================*/ =========================================================================*/
/* NOLINTNEXTLINE(modernize-use-using) */
typedef const char*(CCONV* CM_DOC_FUNCTION)(); typedef const char*(CCONV* CM_DOC_FUNCTION)();
/* NOLINTNEXTLINE(modernize-use-using) */
typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc, typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc,
char* []); char* []);
/* NOLINTNEXTLINE(modernize-use-using) */
typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf); typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf);
/* NOLINTNEXTLINE(modernize-use-using) */
typedef void(CCONV* CM_DESTRUCTOR_FUNCTION)(void* info); typedef void(CCONV* CM_DESTRUCTOR_FUNCTION)(void* info);
/* NOLINTNEXTLINE(modernize-use-using) */
typedef struct typedef struct
{ {
unsigned long reserved1; /* Reserved for future use. DO NOT USE. */ unsigned long reserved1; /* Reserved for future use. DO NOT USE. */
@@ -216,6 +226,7 @@ typedef struct
void* ClientData; void* ClientData;
} cmLoadedCommandInfo; } cmLoadedCommandInfo;
/* NOLINTNEXTLINE(modernize-use-using) */
typedef void(CCONV* CM_INIT_FUNCTION)(cmLoadedCommandInfo*); typedef void(CCONV* CM_INIT_FUNCTION)(cmLoadedCommandInfo*);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -3,6 +3,11 @@
#ifndef cmListFileLexer_h #ifndef cmListFileLexer_h
#define cmListFileLexer_h #define cmListFileLexer_h
#ifdef __cplusplus
extern "C" {
#endif
/* NOLINTNEXTLINE(modernize-use-using) */
typedef enum cmListFileLexer_Type_e typedef enum cmListFileLexer_Type_e
{ {
cmListFileLexer_Token_None, cmListFileLexer_Token_None,
@@ -20,6 +25,7 @@ typedef enum cmListFileLexer_Type_e
cmListFileLexer_Token_BadString cmListFileLexer_Token_BadString
} cmListFileLexer_Type; } cmListFileLexer_Type;
/* NOLINTNEXTLINE(modernize-use-using) */
typedef struct cmListFileLexer_Token_s cmListFileLexer_Token; typedef struct cmListFileLexer_Token_s cmListFileLexer_Token;
struct cmListFileLexer_Token_s struct cmListFileLexer_Token_s
{ {
@@ -40,14 +46,13 @@ enum cmListFileLexer_BOM_e
cmListFileLexer_BOM_UTF32BE, cmListFileLexer_BOM_UTF32BE,
cmListFileLexer_BOM_UTF32LE cmListFileLexer_BOM_UTF32LE
}; };
/* NOLINTNEXTLINE(modernize-use-using) */
typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM; typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM;
/* NOLINTNEXTLINE(modernize-use-using) */
typedef struct cmListFileLexer_s cmListFileLexer; typedef struct cmListFileLexer_s cmListFileLexer;
#ifdef __cplusplus
extern "C" {
#endif
cmListFileLexer* cmListFileLexer_New(void); cmListFileLexer* cmListFileLexer_New(void);
int cmListFileLexer_SetFileName(cmListFileLexer*, const char*, int cmListFileLexer_SetFileName(cmListFileLexer*, const char*,
cmListFileLexer_BOM* bom); cmListFileLexer_BOM* bom);