From 1d3f5ebb0d3da35d1b5b1287f39115b188ac5f6a Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Wed, 4 Sep 2019 18:44:53 +0200 Subject: 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. --- .clang-tidy | 1 - Source/cmCPluginAPI.h | 11 +++++++++++ Source/cmListFileLexer.h | 13 +++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 6f96c22981..cfca64e6f5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -20,7 +20,6 @@ modernize-*,\ -modernize-use-nodiscard,\ -modernize-use-noexcept,\ -modernize-use-transparent-functors,\ --modernize-use-using,\ performance-*,\ readability-*,\ -readability-function-size,\ diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index adc57a2027..6a9514869c 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -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 cmCPLuginAPI.cxx =========================================================================*/ +/* NOLINTNEXTLINE(modernize-use-using) */ 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 =========================================================================*/ + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef const char*(CCONV* CM_DOC_FUNCTION)(); + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc, char* []); + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf); + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_DESTRUCTOR_FUNCTION)(void* info); +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct { unsigned long reserved1; /* Reserved for future use. DO NOT USE. */ @@ -216,6 +226,7 @@ typedef struct void* ClientData; } cmLoadedCommandInfo; +/* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_INIT_FUNCTION)(cmLoadedCommandInfo*); #ifdef __cplusplus diff --git a/Source/cmListFileLexer.h b/Source/cmListFileLexer.h index 8962396fd3..ec6b3cd77f 100644 --- a/Source/cmListFileLexer.h +++ b/Source/cmListFileLexer.h @@ -3,6 +3,11 @@ #ifndef cmListFileLexer_h #define cmListFileLexer_h +#ifdef __cplusplus +extern "C" { +#endif + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef enum cmListFileLexer_Type_e { cmListFileLexer_Token_None, @@ -20,6 +25,7 @@ typedef enum cmListFileLexer_Type_e cmListFileLexer_Token_BadString } cmListFileLexer_Type; +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct cmListFileLexer_Token_s cmListFileLexer_Token; struct cmListFileLexer_Token_s { @@ -40,14 +46,13 @@ enum cmListFileLexer_BOM_e cmListFileLexer_BOM_UTF32BE, cmListFileLexer_BOM_UTF32LE }; + +/* NOLINTNEXTLINE(modernize-use-using) */ typedef enum cmListFileLexer_BOM_e cmListFileLexer_BOM; +/* NOLINTNEXTLINE(modernize-use-using) */ typedef struct cmListFileLexer_s cmListFileLexer; -#ifdef __cplusplus -extern "C" { -#endif - cmListFileLexer* cmListFileLexer_New(void); int cmListFileLexer_SetFileName(cmListFileLexer*, const char*, cmListFileLexer_BOM* bom); -- cgit v1.2.1