From 29471be317b5e4971a2f26abb7a9333c7531fb75 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Fri, 29 Sep 2017 01:23:45 +0100 Subject: [PATCH] Standardize location of storage-class specifiers: Place at beginning of declarations Justification: C99 specifies that doing otherwise is an obsolescent feature. --- src/backend_x64/constant_pool.h | 2 +- src/backend_x64/reg_alloc.cpp | 2 +- src/frontend/decoder/arm.h | 2 +- src/frontend/decoder/thumb16.h | 2 +- src/frontend/decoder/thumb32.h | 2 +- src/frontend/decoder/vfp2.h | 2 +- src/frontend/ir/opcodes.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend_x64/constant_pool.h b/src/backend_x64/constant_pool.h index 033061b3..7ed708ac 100644 --- a/src/backend_x64/constant_pool.h +++ b/src/backend_x64/constant_pool.h @@ -28,7 +28,7 @@ public: Xbyak::Address GetConstant(u64 constant); private: - constexpr static size_t align_size = 16; // bytes + static constexpr size_t align_size = 16; // bytes std::map constant_info; diff --git a/src/backend_x64/reg_alloc.cpp b/src/backend_x64/reg_alloc.cpp index 72d26f24..20eb147d 100644 --- a/src/backend_x64/reg_alloc.cpp +++ b/src/backend_x64/reg_alloc.cpp @@ -291,7 +291,7 @@ void RegAlloc::HostCall(IR::Inst* result_def, boost::optional arg0, b constexpr std::array args_hostloc = { ABI_PARAM1, ABI_PARAM2, ABI_PARAM3, ABI_PARAM4 }; const std::array, args_count> args = { arg0, arg1, arg2, arg3 }; - const static std::vector other_caller_save = [args_hostloc]() { + static const std::vector other_caller_save = [args_hostloc]() { std::vector ret(ABI_ALL_CALLER_SAVE.begin(), ABI_ALL_CALLER_SAVE.end()); for (auto hostloc : args_hostloc) diff --git a/src/frontend/decoder/arm.h b/src/frontend/decoder/arm.h index 6bde0b6d..95949c76 100644 --- a/src/frontend/decoder/arm.h +++ b/src/frontend/decoder/arm.h @@ -322,7 +322,7 @@ std::vector> GetArmDecodeTable() { template boost::optional&> DecodeArm(u32 instruction) { - const static auto table = GetArmDecodeTable(); + static const auto table = GetArmDecodeTable(); const auto matches_instruction = [instruction](const auto& matcher) { return matcher.Matches(instruction); }; diff --git a/src/frontend/decoder/thumb16.h b/src/frontend/decoder/thumb16.h index a857d93d..a057ee97 100644 --- a/src/frontend/decoder/thumb16.h +++ b/src/frontend/decoder/thumb16.h @@ -22,7 +22,7 @@ using Thumb16Matcher = Matcher; template boost::optional&> DecodeThumb16(u16 instruction) { - const static std::vector> table = { + static const std::vector> table = { #define INST(fn, name, bitstring) detail::detail>::GetMatcher(fn, name, bitstring) diff --git a/src/frontend/decoder/thumb32.h b/src/frontend/decoder/thumb32.h index 843988c8..9653b238 100644 --- a/src/frontend/decoder/thumb32.h +++ b/src/frontend/decoder/thumb32.h @@ -22,7 +22,7 @@ using Thumb32Matcher = Matcher; template boost::optional&> DecodeThumb32(u32 instruction) { - const static std::vector> table = { + static const std::vector> table = { #define INST(fn, name, bitstring) detail::detail>::GetMatcher(fn, name, bitstring) diff --git a/src/frontend/decoder/vfp2.h b/src/frontend/decoder/vfp2.h index fd9162e0..485ef876 100644 --- a/src/frontend/decoder/vfp2.h +++ b/src/frontend/decoder/vfp2.h @@ -22,7 +22,7 @@ using VFP2Matcher = Matcher; template boost::optional&> DecodeVFP2(u32 instruction) { - const static std::vector> table = { + static const std::vector> table = { #define INST(fn, name, bitstring) detail::detail>::GetMatcher(fn, name, bitstring) diff --git a/src/frontend/ir/opcodes.cpp b/src/frontend/ir/opcodes.cpp index 19f9b391..c96f53f8 100644 --- a/src/frontend/ir/opcodes.cpp +++ b/src/frontend/ir/opcodes.cpp @@ -50,7 +50,7 @@ const char* GetNameOf(Opcode op) { } const char* GetNameOf(Type type) { - const static std::array names = { + static const std::array names = { "Void", "RegRef", "ExtRegRef", "Opaque", "U1", "U8", "U16", "U32", "U64", "F32", "F64", "CoprocInfo" }; return names.at(static_cast(type));