Even more style checks.

This commit is contained in:
Daniel Kirchner
2019-02-14 11:53:00 +01:00
parent 8ca6715e18
commit 809b9a95f9
15 changed files with 35 additions and 34 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ bool DocStringAnalyser::analyseDocStrings(SourceUnit const& _sourceUnit)
bool DocStringAnalyser::visit(ContractDefinition const& _contract)
{
static const set<string> validTags = set<string>{"author", "title", "dev", "notice"};
static set<string> const validTags = set<string>{"author", "title", "dev", "notice"};
parseDocStrings(_contract, _contract.annotation(), validTags, "contracts");
return true;
@@ -99,7 +99,7 @@ void DocStringAnalyser::handleConstructor(
DocumentedAnnotation& _annotation
)
{
static const set<string> validTags = set<string>{"author", "dev", "notice", "param"};
static set<string> const validTags = set<string>{"author", "dev", "notice", "param"};
parseDocStrings(_node, _annotation, validTags, "constructor");
checkParameters(_callable, _annotation);
}
@@ -110,7 +110,7 @@ void DocStringAnalyser::handleCallable(
DocumentedAnnotation& _annotation
)
{
static const set<string> validTags = set<string>{"author", "dev", "notice", "return", "param"};
static set<string> const validTags = set<string>{"author", "dev", "notice", "return", "param"};
parseDocStrings(_node, _annotation, validTags, "functions");
checkParameters(_callable, _annotation);
}
+2 -2
View File
@@ -35,13 +35,13 @@ enum class ExperimentalFeature
TestOnlyAnalysis
};
static const std::map<ExperimentalFeature, bool> ExperimentalFeatureOnlyAnalysis =
static std::map<ExperimentalFeature, bool> const ExperimentalFeatureOnlyAnalysis =
{
{ ExperimentalFeature::SMTChecker, true },
{ ExperimentalFeature::TestOnlyAnalysis, true },
};
static const std::map<std::string, ExperimentalFeature> ExperimentalFeatureNames =
static std::map<std::string, ExperimentalFeature> const ExperimentalFeatureNames =
{
{ "ABIEncoderV2", ExperimentalFeature::ABIEncoderV2 },
{ "SMTChecker", ExperimentalFeature::SMTChecker },
+6 -6
View File
@@ -37,11 +37,11 @@ namespace dev
namespace solidity
{
const unsigned CompilerUtils::dataStartOffset = 4;
const size_t CompilerUtils::freeMemoryPointer = 64;
const size_t CompilerUtils::zeroPointer = CompilerUtils::freeMemoryPointer + 32;
const size_t CompilerUtils::generalPurposeMemoryStart = CompilerUtils::zeroPointer + 32;
const unsigned CompilerUtils::identityContractAddress = 4;
unsigned const CompilerUtils::dataStartOffset = 4;
size_t const CompilerUtils::freeMemoryPointer = 64;
size_t const CompilerUtils::zeroPointer = CompilerUtils::freeMemoryPointer + 32;
size_t const CompilerUtils::generalPurposeMemoryStart = CompilerUtils::zeroPointer + 32;
unsigned const CompilerUtils::identityContractAddress = 4;
static_assert(CompilerUtils::freeMemoryPointer >= 64, "Free memory pointer must not overlap with scratch area.");
static_assert(CompilerUtils::zeroPointer >= CompilerUtils::freeMemoryPointer + 32, "Zero pointer must not overlap with free memory pointer.");
@@ -653,7 +653,7 @@ void CompilerUtils::convertType(
bool chopSignBitsPending = _chopSignBits && targetTypeCategory == Type::Category::Integer;
if (chopSignBitsPending)
{
const IntegerType& targetIntegerType = dynamic_cast<IntegerType const&>(_targetType);
IntegerType const& targetIntegerType = dynamic_cast<IntegerType const&>(_targetType);
chopSignBitsPending = targetIntegerType.isSigned();
}
+5 -5
View File
@@ -273,18 +273,18 @@ public:
/// Bytes we need to the start of call data.
/// - The size in bytes of the function (hash) identifier.
static const unsigned dataStartOffset;
static unsigned const dataStartOffset;
/// Position of the free-memory-pointer in memory;
static const size_t freeMemoryPointer;
static size_t const freeMemoryPointer;
/// Position of the memory slot that is always zero.
static const size_t zeroPointer;
static size_t const zeroPointer;
/// Starting offset for memory available to the user (aka the contract).
static const size_t generalPurposeMemoryStart;
static size_t const generalPurposeMemoryStart;
private:
/// Address of the precompiled identity contract.
static const unsigned identityContractAddress;
static unsigned const identityContractAddress;
/// Stores the given string in memory.
/// Stack pre: mempos