diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index 528294557..5d47937b0 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -35,6 +35,9 @@ using namespace std; using namespace dev; +namespace +{ + template inline _T contentsGeneric(std::string const& _file) { @@ -56,6 +59,8 @@ inline _T contentsGeneric(std::string const& _file) return ret; } +} + string dev::contentsString(string const& _file) { return contentsGeneric(_file); diff --git a/libdevcore/SwarmHash.cpp b/libdevcore/SwarmHash.cpp index 781886681..1c718200e 100644 --- a/libdevcore/SwarmHash.cpp +++ b/libdevcore/SwarmHash.cpp @@ -24,6 +24,8 @@ using namespace std; using namespace dev; +namespace +{ bytes toLittleEndian(size_t _size) { @@ -59,6 +61,8 @@ h256 swarmHashIntermediate(string const& _input, size_t _offset, size_t _length) return swarmHashSimple(ref, _length); } +} + h256 dev::swarmHash(string const& _input) { return swarmHashIntermediate(_input, 0, _input.size()); diff --git a/libevmasm/PeepholeOptimiser.cpp b/libevmasm/PeepholeOptimiser.cpp index e94a8ba4c..31fdd3176 100644 --- a/libevmasm/PeepholeOptimiser.cpp +++ b/libevmasm/PeepholeOptimiser.cpp @@ -30,6 +30,9 @@ using namespace dev; // TODO: Extend this to use the tools from ExpressionClasses.cpp +namespace +{ + struct OptimiserState { AssemblyItems const& items; @@ -246,6 +249,8 @@ void applyMethods(OptimiserState& _state, Method, OtherMethods... _other) applyMethods(_state, _other...); } +} + bool PeepholeOptimiser::optimise() { OptimiserState state {m_items, 0, std::back_inserter(m_optimisedItems)}; diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 65b098408..15475034d 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -304,6 +304,9 @@ MemberList::MemberMap Type::boundFunctions(Type const& _type, ContractDefinition return members; } +namespace +{ + bool isValidShiftAndAmountType(Token::Value _operator, Type const& _shiftAmountType) { // Disable >>> here. @@ -317,6 +320,8 @@ bool isValidShiftAndAmountType(Token::Value _operator, Type const& _shiftAmountT return false; } +} + IntegerType::IntegerType(int _bits, IntegerType::Modifier _modifier): m_bits(_bits), m_modifier(_modifier) { diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index e53f1b94e..24d3d959f 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -39,6 +39,9 @@ using namespace std; using namespace dev; using namespace dev::solidity; +namespace +{ + /** * Simple helper class to ensure that the stack height is the same at certain places in the code. */ @@ -53,6 +56,8 @@ private: unsigned stackHeight; }; +} + void ContractCompiler::compileContract( ContractDefinition const& _contract, std::map const& _contracts diff --git a/lllc/main.cpp b/lllc/main.cpp index adf181c7d..06a0fc81b 100644 --- a/lllc/main.cpp +++ b/lllc/main.cpp @@ -39,7 +39,7 @@ static string const VersionString = (string(SOL_VERSION_PRERELEASE).empty() ? "" : "-" + string(SOL_VERSION_PRERELEASE)) + (string(SOL_VERSION_BUILDINFO).empty() ? "" : "+" + string(SOL_VERSION_BUILDINFO)); -void help() +static void help() { cout << "Usage lllc [OPTIONS] " << endl @@ -54,7 +54,7 @@ void help() exit(0); } -void version() +static void version() { cout << "LLLC, the Lovely Little Language Compiler " << endl; cout << "Version: " << VersionString << endl; @@ -74,7 +74,7 @@ specified default locale if it is valid, and if not then it will modify the environment the process is running in to use a sensible default. This also means that users do not need to install language packs for their OS. */ -void setDefaultOrCLocale() +static void setDefaultOrCLocale() { #if __unix__ if (!std::setlocale(LC_ALL, "")) diff --git a/test/ExecutionFramework.cpp b/test/ExecutionFramework.cpp index f4e5fcef5..b2de814a9 100644 --- a/test/ExecutionFramework.cpp +++ b/test/ExecutionFramework.cpp @@ -31,8 +31,8 @@ using namespace dev::test; namespace // anonymous { - h256 const EmptyTrie("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"); -} + +h256 const EmptyTrie("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"); string getIPCSocketPath() { @@ -43,6 +43,8 @@ string getIPCSocketPath() return ipcPath; } +} + ExecutionFramework::ExecutionFramework() : m_rpc(RPCSession::instance(getIPCSocketPath())), m_optimize(dev::test::Options::get().optimize), diff --git a/test/fuzzer.cpp b/test/fuzzer.cpp index cf99755f1..c3a321f7a 100644 --- a/test/fuzzer.cpp +++ b/test/fuzzer.cpp @@ -40,6 +40,9 @@ typedef void (*CStyleReadFileCallback)(char const* _path, char** o_contents, cha extern char const* compileStandard(char const* _input, CStyleReadFileCallback _readCallback); } +namespace +{ + bool quiet = false; string contains(string const& _haystack, vector const& _needles) @@ -169,6 +172,8 @@ void testCompiler() } } +} + int main(int argc, char** argv) { po::options_description options(