Fix default param using std::function

This commit is contained in:
Vinnie Falco
2013-06-28 14:15:10 -07:00
parent 6a6cb32b78
commit df9fa7b897
6 changed files with 21 additions and 5 deletions

View File

@@ -22,9 +22,15 @@
// beast_basics flags
#ifndef BEAST_USE_BOOST
#define BEAST_USE_BOOST 0
#endif
#define BEAST_USE_BOOST 1
// We bind functions that take references, which is
// unsupported on some platforms
//
// VFALCO TODO Rewrite functions to use pointers instead
// of references so we can get off boost::bind
//
//#define BEAST_BIND_USES_BOOST 1
#ifndef BEAST_USE_LEAKCHECKED
#define BEAST_USE_LEAKCHECKED BEAST_CHECK_MEMORY_LEAKS

View File

@@ -12,7 +12,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_VARIADIC_MAX=8;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>$(RepoDir);$(RepoDir)\src\cpp\protobuf\src;$(RepoDir)\src\cpp\protobuf\vsprojects;$(RepoDir)\build\proto;$(RepoDir)\Subtrees;$(RepoDir)\Subtrees\leveldb;$(RepoDir)\Subtrees\leveldb\include;$(RepoDir)\Subtrees\beast;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

View File

@@ -27,6 +27,9 @@ TODO
- lift beast into the ripple namespace, remove ripple's duplicated integer types
- lift unique_ptr / auto_ptr into ripple namespace, or replace with ScopedPointer
- Rewrite functions passed to bind to not take reference parameters, so we can
used std::bind instead of boost.
- Make LevelDB and Ripple code work with both Unicode and non-Unicode Windows APIs
- Raise the warning level and fix everything

View File

@@ -12,6 +12,9 @@ class JobQueue
public:
explicit JobQueue (boost::asio::io_service&);
// VFALCO TODO make convenience functions that allow the caller to not
// have to call bind.
//
void addJob (JobType type, const std::string& name, const FUNCTION_TYPE<void (Job&)>& job);
int getJobCount (JobType t); // Jobs waiting at this priority

View File

@@ -66,7 +66,7 @@ extern void callRPC (
const std::string& strUsername, const std::string& strPassword,
const std::string& strPath, const std::string& strMethod,
const Json::Value& jvParams, const bool bSSL,
FUNCTION_TYPE<void (const Json::Value& jvInput)> callbackFuncP = 0);
FUNCTION_TYPE<void (const Json::Value& jvInput)> callbackFuncP = FUNCTION_TYPE<void (const Json::Value& jvInput)> ());
#endif
// vim:ts=4

View File

@@ -1285,6 +1285,10 @@ void PeerImp::recvHaveTxSet (protocol::TMHaveTransactionSet& packet)
}
uint256 hash;
// VFALCO TODO There should be no use of memcpy() throughout the program.
// TODO Clean up this magic number
//
memcpy (hash.begin (), packet.hash ().data (), 32);
if (packet.status () == protocol::tsHAVE)