Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of

This commit is contained in:
practicalswift
2017-06-06 21:15:28 +02:00
parent 1b708f2cf3
commit 3fb81a8480
16 changed files with 108 additions and 124 deletions

View File

@@ -26,9 +26,7 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <univalue.h>
@@ -38,24 +36,25 @@ typedef std::vector<unsigned char> valtype;
// In script_tests.cpp
extern UniValue read_json(const std::string& jsondata);
static std::map<std::string, unsigned int> mapFlagNames = boost::assign::map_list_of
(std::string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE)
(std::string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH)
(std::string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC)
(std::string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG)
(std::string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S)
(std::string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY)
(std::string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA)
(std::string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY)
(std::string("DISCOURAGE_UPGRADABLE_NOPS"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
(std::string("CLEANSTACK"), (unsigned int)SCRIPT_VERIFY_CLEANSTACK)
(std::string("MINIMALIF"), (unsigned int)SCRIPT_VERIFY_MINIMALIF)
(std::string("NULLFAIL"), (unsigned int)SCRIPT_VERIFY_NULLFAIL)
(std::string("CHECKLOCKTIMEVERIFY"), (unsigned int)SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)
(std::string("CHECKSEQUENCEVERIFY"), (unsigned int)SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)
(std::string("WITNESS"), (unsigned int)SCRIPT_VERIFY_WITNESS)
(std::string("DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)
(std::string("WITNESS_PUBKEYTYPE"), (unsigned int)SCRIPT_VERIFY_WITNESS_PUBKEYTYPE);
static std::map<std::string, unsigned int> mapFlagNames = {
{std::string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE},
{std::string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH},
{std::string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC},
{std::string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG},
{std::string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S},
{std::string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY},
{std::string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA},
{std::string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY},
{std::string("DISCOURAGE_UPGRADABLE_NOPS"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS},
{std::string("CLEANSTACK"), (unsigned int)SCRIPT_VERIFY_CLEANSTACK},
{std::string("MINIMALIF"), (unsigned int)SCRIPT_VERIFY_MINIMALIF},
{std::string("NULLFAIL"), (unsigned int)SCRIPT_VERIFY_NULLFAIL},
{std::string("CHECKLOCKTIMEVERIFY"), (unsigned int)SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY},
{std::string("CHECKSEQUENCEVERIFY"), (unsigned int)SCRIPT_VERIFY_CHECKSEQUENCEVERIFY},
{std::string("WITNESS"), (unsigned int)SCRIPT_VERIFY_WITNESS},
{std::string("DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM},
{std::string("WITNESS_PUBKEYTYPE"), (unsigned int)SCRIPT_VERIFY_WITNESS_PUBKEYTYPE},
};
unsigned int ParseScriptFlags(std::string strFlags)
{