diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-09-04 16:03:01 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-09-04 16:03:01 (GMT) |
commit | a1ddf2d0ba6268e29a9456948828f59d044791f1 (patch) | |
tree | b7046d67c6667c945e3683cf890d725c7123e2bd /Source/cmELF.cxx | |
parent | ee15bc7d7e7707fd8d7db92645c2c56a5df0f681 (diff) | |
download | CMake-a1ddf2d0ba6268e29a9456948828f59d044791f1.zip CMake-a1ddf2d0ba6268e29a9456948828f59d044791f1.tar.gz CMake-a1ddf2d0ba6268e29a9456948828f59d044791f1.tar.bz2 |
clang-tidy: Replace typedef with using
Automate the conversion with
perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g'
then manually fix a few places.
Diffstat (limited to 'Source/cmELF.cxx')
-rw-r--r-- | Source/cmELF.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 425f1a8..648a900 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -20,11 +20,11 @@ #elif defined(__HAIKU__) # include <elf32.h> # include <elf64.h> -typedef struct Elf32_Ehdr Elf32_Ehdr; -typedef struct Elf32_Shdr Elf32_Shdr; -typedef struct Elf32_Sym Elf32_Sym; -typedef struct Elf32_Rel Elf32_Rel; -typedef struct Elf32_Rela Elf32_Rela; +using Elf32_Ehdr = struct Elf32_Ehdr; +using Elf32_Shdr = struct Elf32_Shdr; +using Elf32_Sym = struct Elf32_Sym; +using Elf32_Rel = struct Elf32_Rel; +using Elf32_Rela = struct Elf32_Rela; # define ELFMAG0 0x7F # define ELFMAG1 'E' # define ELFMAG2 'L' @@ -289,9 +289,8 @@ public: } private: - // ByteSwap(ELF_Dyn) assumes d_val and d_ptr are the same size - typedef char dyn_size_assert - [sizeof(ELF_Dyn().d_un.d_val) == sizeof(ELF_Dyn().d_un.d_ptr) ? 1 : -1]; + static_assert(sizeof(ELF_Dyn().d_un.d_val) == sizeof(ELF_Dyn().d_un.d_ptr), + "ByteSwap(ELF_Dyn) assumes d_val and d_ptr are the same size"); void ByteSwap(ELF_Ehdr& elf_header) { |